AnsweredAssumed Answered

Asterisk-IM not working properly

Question asked by multitel on Feb 25, 2008

 

Hello,

 

 

Prerequisites:

 

 

- asterisk setup tested with softphones and found to be working

- using Asterisk-IM 1.4 and Openfire  3.4.5

 

 

Problems: 

 

 

- can receive calls on Spark , but after 2 or 3 seconds the call hangs up.

- can dial on Spark, but after 2 or 3 seconds the call hangs up.

 

 

Setup:

 

 

sip.conf :

 

 

 

 

 

context=default

recordhistory=yes

bindaddr = 0.0.0.0

bindport = 5060

disallow=all

allow=gsm

allow=ulaw

allow=alaw

progressinband = yes

canreinvite = no

useragent=asterisk

qualify = yes

;register test accounts

register => 40341569039:mypassword@mysipgateway/40341569039

 

 

 

disallow=all

allow=gsm

allow=ulaw

type = friend

insecure = very

username = 40341569039

fromuser = 40341569039

secret = wirme6me

host = sip.netmaster.ro

fromdomain = netmaster.ro

canreinvite = yes

qualify = no

nat = yes

context = smartcall-incoming

 

 

 

type=friend

;auth=md5

dtmfmode = rfc2833

username=40341569039

secret=test

callerid="40341569039" <40341569039>

host=dynamic

canreinvite=yes

disallow=all

allow=gsm

allow=ulaw

allow=alaw

defaultip = 192.168.0.148

nat = yes

qualify = yes

context = localphones

   

 

 

extensions.conf:

 

 

exten => _X.,1,Dial(SIP/$@smartcall,60)

;exten => _X.,2,Congestion

;exten => _X.,3,Busy

exten => _X.,2,Hangup

 

 

exten => _X.,1,Dial(SIP/40341569039,60)

;exten => _X.,2,Congestion

;exten => _X.,3,Busy

exten => _X.,2,Hangup

 

 

 

Logs:

 

 

 

 

 

Incoming call (from outside the asterisk box) :

 

 

<--- SIP read from 193.16.148.244:5060 --->

INVITE sip:40341569039@89.33.6.124 SIP/2.0

Record-Route: <sip:193.16.148.244;ftag=f4a8705af1b5a0cfcb58f45fb01f6f32;lr>

Via: SIP/2.0/UDP 193.16.148.244;branch=z9hG4bKafcc.e595c43513ec0d792b25d00ca3cc5037.0

Via: SIP/2.0/UDP 193.16.148.244:5061;branch=z9hG4bK4b29a54e3c600206b059c3524d9723e4;rport=5061

Max-Forwards: 16

From: "40341569059" <sip:40341569059@193.16.148.244>;tag=f4a8705af1b5a0cfcb58f45fb01f6f32

To: <sip:40341569039@193.16.148.244>

Call-ID: ZTRkY2U1NDRiNTU4ZmZkMzkzYmMyYTI1ZWVlZDU0YjA.

CSeq: 200 INVITE

Contact: Anonymous <sip:193.16.148.244:5061>

Expires: 300

User-Agent: Sippy

cisco-GUID: 954648260-3819049436-2228224023-2760872502

h323-conf-id: 954648260-3819049436-2228224023-2760872502

Content-Length: 351

Content-Type: application/sdp

 

v=0

o=Sippy 146938380 0 IN IP4 193.16.148.244

s=Zoiper_user

t=0 0

m=audio 50732 RTP/AVP 3 110 98 8 0 101

c=IN IP4 193.16.148.244

a=rtpmap:3 GSM/8000

a=rtpmap:110 speex/8000

a=rtpmap:98 iLBC/8000

a=fmtp:98 mode=30

a=rtpmap:8 PCMA/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-15

a=sendrecv

a=direction:active

 

<----


>

--- (16 headers 16 lines) ---

Sending to 193.16.148.244 : 5060 (no NAT)

Using INVITE request as basis request - ZTRkY2U1NDRiNTU4ZmZkMzkzYmMyYTI1ZWVlZDU0YjA.

Found peer 'smartcall'

Found RTP audio format 3

Found RTP audio format 110

Found RTP audio format 98

Found RTP audio format 8

Found RTP audio format 0

Found RTP audio format 101

Peer audio RTP is at port 193.16.148.244:50732

Found description format GSM for ID 3

Found description format speex for ID 110

Found description format iLBC for ID 98

Found description format PCMA for ID 8

Found description format PCMU for ID 0

Found description format telephone-event for ID 101

Capabilities: us - 0xe (gsm|ulaw|alaw), peer - audio=0x60e (gsm|ulaw|alaw|speex|ilbc)/video=0x0 (nothing), combined - (gsm|alaw|ulaw)

Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)

Peer audio RTP is at port 193.16.148.244:50732

Looking for 40341569039 in smartcall-incoming (domain 89.33.6.124)

list_route: hop: <sip:193.16.148.244;ftag=f4a8705af1b5a0cfcb58f45fb01f6f32;lr>

 

<--- Transmitting (NAT) to 193.16.148.244:5060 --->

SIP/2.0 100 Trying

Via: SIP/2.0/UDP 193.16.148.244;branch=z9hG4bKafcc.e595c43513ec0d792b25d00ca3cc5037.0;received=1 93.16.148.244

Via: SIP/2.0/UDP 193.16.148.244:5061;branch=z9hG4bK4b29a54e3c600206b059c3524d9723e4;rport=5061

From: "40341569059" <sip:40341569059@193.16.148.244>;tag=f4a8705af1b5a0cfcb58f45fb01f6f32

To: <sip:40341569039@193.16.148.244>

Call-ID: ZTRkY2U1NDRiNTU4ZmZkMzkzYmMyYTI1ZWVlZDU0YjA.

CSeq: 200 INVITE

User-Agent: asterisk

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Contact: <sip:40341569039@89.33.6.124>

Content-Length: 0

 

 

<----


>

Audio is at 192.168.0.254 port 19718

Adding codec 0x2 (gsm) to SDP

Adding codec 0x4 (ulaw) to SDP

Adding codec 0x8 (alaw) to SDP

Adding non-codec 0x1 (telephone-event) to SDP

Reliably Transmitting (NAT) to 192.168.0.148:5060:

INVITE sip:40341569039@192.168.0.148 SIP/2.0

Via: SIP/2.0/UDP 192.168.0.254:5060;branch=z9hG4bK643a1fed;rport

From: "40341569059" <sip:40341569059@192.168.0.254>;tag=as0d1458a0

To: <sip:40341569039@192.168.0.148>

Contact: <sip:40341569059@192.168.0.254>

Call-ID: 4b5a809e58a5ad0d2fad1384528a1502@192.168.0.254

CSeq: 102 INVITE

User-Agent: asterisk

Max-Forwards: 70

Date: Mon, 25 Feb 2008 13:12:05 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Content-Type: application/sdp

Content-Length: 289

 

v=0

o=root 73314 73314 IN IP4 192.168.0.254

s=session

c=IN IP4 192.168.0.254

t=0 0

m=audio 19718 RTP/AVP 3 0 8 101

a=rtpmap:3 GSM/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv

 

---

Retransmitting #1 (NAT) to 192.168.0.148:5060:

INVITE sip:40341569039@192.168.0.148 SIP/2.0

Via: SIP/2.0/UDP 192.168.0.254:5060;branch=z9hG4bK643a1fed;rport

From: "40341569059" <sip:40341569059@192.168.0.254>;tag=as0d1458a0

To: <sip:40341569039@192.168.0.148>

Contact: <sip:40341569059@192.168.0.254>

Call-ID: 4b5a809e58a5ad0d2fad1384528a1502@192.168.0.254

CSeq: 102 INVITE

User-Agent: asterisk

Max-Forwards: 70

Date: Mon, 25 Feb 2008 13:12:05 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Content-Type: application/sdp

Content-Length: 289

 

v=0

o=root 73314 73314 IN IP4 192.168.0.254

s=session

c=IN IP4 192.168.0.254

t=0 0

m=audio 19718 RTP/AVP 3 0 8 101

a=rtpmap:3 GSM/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv

 

---

Retransmitting #2 (NAT) to 192.168.0.148:5060:

INVITE sip:40341569039@192.168.0.148 SIP/2.0

Via: SIP/2.0/UDP 192.168.0.254:5060;branch=z9hG4bK643a1fed;rport

From: "40341569059" <sip:40341569059@192.168.0.254>;tag=as0d1458a0

To: <sip:40341569039@192.168.0.148>

Contact: <sip:40341569059@192.168.0.254>

Call-ID: 4b5a809e58a5ad0d2fad1384528a1502@192.168.0.254

CSeq: 102 INVITE

User-Agent: asterisk

Max-Forwards: 70

Date: Mon, 25 Feb 2008 13:12:05 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Content-Type: application/sdp

Content-Length: 289

 

v=0

o=root 73314 73314 IN IP4 192.168.0.254

s=session

c=IN IP4 192.168.0.254

t=0 0

m=audio 19718 RTP/AVP 3 0 8 101

a=rtpmap:3 GSM/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv

 

---

Retransmitting #3 (NAT) to 192.168.0.148:5060:

INVITE sip:40341569039@192.168.0.148 SIP/2.0

Via: SIP/2.0/UDP 192.168.0.254:5060;branch=z9hG4bK643a1fed;rport

From: "40341569059" <sip:40341569059@192.168.0.254>;tag=as0d1458a0

To: <sip:40341569039@192.168.0.148>

Contact: <sip:40341569059@192.168.0.254>

Call-ID: 4b5a809e58a5ad0d2fad1384528a1502@192.168.0.254

CSeq: 102 INVITE

User-Agent: asterisk

Max-Forwards: 70

Date: Mon, 25 Feb 2008 13:12:05 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Content-Type: application/sdp

Content-Length: 289

 

v=0

o=root 73314 73314 IN IP4 192.168.0.254

s=session

c=IN IP4 192.168.0.254

t=0 0

m=audio 19718 RTP/AVP 3 0 8 101

a=rtpmap:3 GSM/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv

 

---

mail*CLI>

<--- SIP read from 192.168.0.148:5061 --->

 

 

 

<----


>

--- (0 headers 1 lines) ---

Retransmitting #4 (NAT) to 192.168.0.148:5060:

INVITE sip:40341569039@192.168.0.148 SIP/2.0

Via: SIP/2.0/UDP 192.168.0.254:5060;branch=z9hG4bK643a1fed;rport

From: "40341569059" <sip:40341569059@192.168.0.254>;tag=as0d1458a0

To: <sip:40341569039@192.168.0.148>

Contact: <sip:40341569059@192.168.0.254>

Call-ID: 4b5a809e58a5ad0d2fad1384528a1502@192.168.0.254

CSeq: 102 INVITE

User-Agent: asterisk

Max-Forwards: 70

Date: Mon, 25 Feb 2008 13:12:05 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Content-Type: application/sdp

Content-Length: 289

 

v=0

o=root 73314 73314 IN IP4 192.168.0.254

s=session

c=IN IP4 192.168.0.254

t=0 0

m=audio 19718 RTP/AVP 3 0 8 101

a=rtpmap:3 GSM/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv

 

---

NOTICE[73314]: chan_sip.c:2879 auto_congest: Auto-congesting SIP/40341569039-08758000

Scheduling destruction of SIP dialog '4b5a809e58a5ad0d2fad1384528a1502@192.168.0.254' in 32000 ms (Method: INVITE)

Scheduling destruction of SIP dialog 'ZTRkY2U1NDRiNTU4ZmZkMzkzYmMyYTI1ZWVlZDU0YjA.' in 32000 ms (Method: INVITE)

 

<--- Reliably Transmitting (NAT) to 193.16.148.244:5060 --->

SIP/2.0 603 Declined

Via: SIP/2.0/UDP 193.16.148.244;branch=z9hG4bKafcc.e595c43513ec0d792b25d00ca3cc5037.0;received=1 93.16.148.244

Via: SIP/2.0/UDP 193.16.148.244:5061;branch=z9hG4bK4b29a54e3c600206b059c3524d9723e4;rport=5061

From: "40341569059" <sip:40341569059@193.16.148.244>;tag=f4a8705af1b5a0cfcb58f45fb01f6f32

To: <sip:40341569039@193.16.148.244>;tag=as18799e0f

Call-ID: ZTRkY2U1NDRiNTU4ZmZkMzkzYmMyYTI1ZWVlZDU0YjA.

CSeq: 200 INVITE

User-Agent: asterisk

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Contact: <sip:40341569039@89.33.6.124>

Content-Length: 0

 

 

<----


>

mail*CLI>

<--- SIP read from 193.16.148.244:5060 --->

ACK sip:40341569039@89.33.6.124 SIP/2.0

Via: SIP/2.0/UDP 193.16.148.244;branch=z9hG4bKafcc.e595c43513ec0d792b25d00ca3cc5037.0

From: "40341569059" <sip:40341569059@193.16.148.244>;tag=f4a8705af1b5a0cfcb58f45fb01f6f32

Call-ID: ZTRkY2U1NDRiNTU4ZmZkMzkzYmMyYTI1ZWVlZDU0YjA.

To: <sip:40341569039@193.16.148.244>;tag=as18799e0f

CSeq: 200 ACK

User-Agent: Sip EXpress router (0.9.6 (i386/freebsd))

Content-Length: 0

 

 

<----


>

--- (8 headers 0 lines) ---

mail*CLI>

 

 

 

 

 

Outgoing call (from Spark to outside number):

 

 

 

 

 

Audio is at 192.168.0.254 port 12774

Adding codec 0x2 (gsm) to SDP

Adding codec 0x4 (ulaw) to SDP

Adding codec 0x8 (alaw) to SDP

Adding non-codec 0x1 (telephone-event) to SDP

Reliably Transmitting (NAT) to 192.168.0.148:5060:

INVITE sip:40341569039@192.168.0.148 SIP/2.0

Via: SIP/2.0/UDP 192.168.0.254:5060;branch=z9hG4bK778e15c6;rport

From: "40341569039" <sip:40341569039@192.168.0.254>;tag=as521f8f44

To: <sip:40341569039@192.168.0.148>

Contact: <sip:40341569039@192.168.0.254>

Call-ID: 4725fa8231d615141660e16101ae8d6c@192.168.0.254

CSeq: 102 INVITE

User-Agent: asterisk

Max-Forwards: 70

Date: Mon, 25 Feb 2008 13:17:08 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Content-Type: application/sdp

Content-Length: 289

 

v=0

o=root 73314 73314 IN IP4 192.168.0.254

s=session

c=IN IP4 192.168.0.254

t=0 0

m=audio 12774 RTP/AVP 3 0 8 101

a=rtpmap:3 GSM/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv

 

---

Retransmitting #1 (NAT) to 192.168.0.148:5060:

INVITE sip:40341569039@192.168.0.148 SIP/2.0

Via: SIP/2.0/UDP 192.168.0.254:5060;branch=z9hG4bK778e15c6;rport

From: "40341569039" <sip:40341569039@192.168.0.254>;tag=as521f8f44

To: <sip:40341569039@192.168.0.148>

Contact: <sip:40341569039@192.168.0.254>

Call-ID: 4725fa8231d615141660e16101ae8d6c@192.168.0.254

CSeq: 102 INVITE

User-Agent: asterisk

Max-Forwards: 70

Date: Mon, 25 Feb 2008 13:17:08 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Content-Type: application/sdp

Content-Length: 289

 

v=0

o=root 73314 73314 IN IP4 192.168.0.254

s=session

c=IN IP4 192.168.0.254

t=0 0

m=audio 12774 RTP/AVP 3 0 8 101

a=rtpmap:3 GSM/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv

 

---

Retransmitting #2 (NAT) to 192.168.0.148:5060:

INVITE sip:40341569039@192.168.0.148 SIP/2.0

Via: SIP/2.0/UDP 192.168.0.254:5060;branch=z9hG4bK778e15c6;rport

From: "40341569039" <sip:40341569039@192.168.0.254>;tag=as521f8f44

To: <sip:40341569039@192.168.0.148>

Contact: <sip:40341569039@192.168.0.254>

Call-ID: 4725fa8231d615141660e16101ae8d6c@192.168.0.254

CSeq: 102 INVITE

User-Agent: asterisk

Max-Forwards: 70

Date: Mon, 25 Feb 2008 13:17:08 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Content-Type: application/sdp

Content-Length: 289

 

v=0

o=root 73314 73314 IN IP4 192.168.0.254

s=session

c=IN IP4 192.168.0.254

t=0 0

m=audio 12774 RTP/AVP 3 0 8 101

a=rtpmap:3 GSM/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv

 

---

mail*CLI>

<--- SIP read from 192.168.0.148:5061 --->

 

 

 

<----


>

--- (0 headers 1 lines) ---

Retransmitting #3 (NAT) to 192.168.0.148:5060:

INVITE sip:40341569039@192.168.0.148 SIP/2.0

Via: SIP/2.0/UDP 192.168.0.254:5060;branch=z9hG4bK778e15c6;rport

From: "40341569039" <sip:40341569039@192.168.0.254>;tag=as521f8f44

To: <sip:40341569039@192.168.0.148>

Contact: <sip:40341569039@192.168.0.254>

Call-ID: 4725fa8231d615141660e16101ae8d6c@192.168.0.254

CSeq: 102 INVITE

User-Agent: asterisk

Max-Forwards: 70

Date: Mon, 25 Feb 2008 13:17:08 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Content-Type: application/sdp

Content-Length: 289

 

v=0

o=root 73314 73314 IN IP4 192.168.0.254

s=session

c=IN IP4 192.168.0.254

t=0 0

m=audio 12774 RTP/AVP 3 0 8 101

a=rtpmap:3 GSM/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv

 

---

Retransmitting #4 (NAT) to 192.168.0.148:5060:

INVITE sip:40341569039@192.168.0.148 SIP/2.0

Via: SIP/2.0/UDP 192.168.0.254:5060;branch=z9hG4bK778e15c6;rport

From: "40341569039" <sip:40341569039@192.168.0.254>;tag=as521f8f44

To: <sip:40341569039@192.168.0.148>

Contact: <sip:40341569039@192.168.0.254>

Call-ID: 4725fa8231d615141660e16101ae8d6c@192.168.0.254

CSeq: 102 INVITE

User-Agent: asterisk

Max-Forwards: 70

Date: Mon, 25 Feb 2008 13:17:08 GMT

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Supported: replaces

Content-Type: application/sdp

Content-Length: 289

 

v=0

o=root 73314 73314 IN IP4 192.168.0.254

s=session

c=IN IP4 192.168.0.254

t=0 0

m=audio 12774 RTP/AVP 3 0 8 101

a=rtpmap:3 GSM/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=silenceSupp:off - - - -

a=ptime:20

a=sendrecv

 

---

NOTICE[73314]: chan_sip.c:2879 auto_congest: Auto-congesting SIP/40341569039-08746000

Scheduling destruction of SIP dialog '4725fa8231d615141660e16101ae8d6c@192.168.0.254' in 32000 ms (Method: INVITE)

mail*CLI>

 

 

 

 

 

 

It seems that no matter what number I am dialling from within Spark, it gets translated by Asterisk-IM into my own extension number:

 

 

From: "40341569039" <sip:40341569039@192.168.0.254>;tag=as521f8f44

To: <sip:40341569039@192.168.0.148>

 

 

Here is another log while using X-Lite and the same 40341569039 extension:

 

 

 

 

 

<--- SIP read from 193.16.148.244:5060 --->

SIP/2.0 100 trying -- your call is important to us

Via: SIP/2.0/UDP 89.33.6.124:5060;branch=z9hG4bK603ded74;rport=5060

From: "40341569039" <sip:40341569039@netmaster.ro>;tag=as70426038

To: <sip:40341569059@sip.netmaster.ro>

Call-ID: 1cc5f0b447a76e27347573432ec45af0@netmaster.ro

CSeq: 102 INVITE

Server: Sip EXpress router (0.9.6 (i386/freebsd))

Content-Length: 0

 

 

 

 

 

Is my setup wrong somewhere, or is it a problem with Asterisk-IM?

 

 

 

 

 

Dan

 

 

 

 

 

PS: sorry for the large post

 

 

 

 

 

Outcomes