**SOLVED** CSipSimple (on android) & NAT & Asterisk

Hello all,

i’ve been trying now for days no and I give up :cry:

This is my situation:
I have Asterisk 11 running on my qnap TS219.
I have a Cisco-301 LAN phone.
and a CSipSimple installed on a Samsung S2.

Problem description:
On the local LAN all is working well :smiley:
But (as you can expect) when login with my CSipSimple from outsite, not all is working well :confused:
-With the Cisco301 (local) I can call the CSipSimple (outsite), and the Cisco301 also rings wenn I call it with the CSipSimple. But I do not hear any sound.

I read a lot about NATting but I cannot seem to make it work.
These are the things I tried:
-portforwarding (5060,10000-20000) in my router (dd-wrt).
-in sip.conf (see below, [100]=CSipSimple, [300]=Cisco301)

Who can help me to find the configuration error?

Greetings Andre

[/opt/etc/asterisk] # cat sip.conf|egrep -v "^;|^$|^\s*;" [general] context=public ; Default context for incoming calls. Defaults to 'default' allowoverlap=no ; Disable overlap dialing support. (Default is yes) udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all) tcpenable=no ; Enable server for incoming TCP connections (default is no) tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces) transport=udp ; Set the default transports. The order determines the primary default transport. srvlookup=yes ; Enable DNS SRV lookups on outbound calls port=5060 bindaddr=0.0.0.0 disallow=all allow=ulaw externhost = my.public.fqdn.tld:5060 ;Public address of my nat box. externrefresh = 600 ;check hostip every 10min. localnet=192.168.3.0/255.255.255.0 ;RFC 1918 addresses nat = auto_force_rport ;Set the force_rport option if Asterisk detects NAT (default) [authentication] [basic-options](!) ; a template dtmfmode=rfc2833 context=from-office type=friend [natted-phone](!,basic-options) ; another template inheriting basic-options directmedia=no host=dynamic [public-phone](!,basic-options) ; another template inheriting basic-options directmedia=yes [my-codecs](!) ; a template for my preferred codecs disallow=all allow=ilbc allow=g729 allow=gsm allow=g723 allow=ulaw [ulaw-phone](!) ; and another one for ulaw-only disallow=all allow=ulaw [100] type=peer host=dynamic secret=100 qualify=yes directmedia=no nat=force_rport context=users mailbox=100@default [200] type=peer host=dynamic secret=200 context=users mailbox=200@default [300] type=peer host=dynamic secret=300 qualify=yes context=users mailbox=300@default

You appear to say it doesn’t work, but only describe the bits that do work. How does it not work? I’d expect at least a verbose 3 console log of the call, to get an idea if anything was going wrong at the SIP level.

How have you configured the router for the port range used for the phone? (10000-20000) is the range that the sample Asterisk configuration sets for the ports used on Asterisk. It has no effect on the ports used by the phone.

Is the phone behind NAT? If so, what arrangements do you have for it to traverse the NAT?

If the answer doesn’t become obvious, you will need to supply a SIP trace, e.g. from sip set debug on. Make sure you start at the very start of the call, and make sure you actually include the call. It is surprising how many people don’t when asked for this information!

Helle David55,

thank you for replying :smile:
With this line “With the Cisco301 (local) I can call the CSipSimple (outsite), and the Cisco301 also rings wenn I call it with the CSipSimple.”, I tried to explain what isn’t working.
With less words: I can call the phone visaversa but I do not hear anything.

One thing that attracts my attention is this ip address: 10.48.86.155.
Where is that comming from? I dont know this ip. It is also not in one of the config files.

This is the verbose listing of a call from the NATted CSipSimple phone calling the Cisco301. After a few seconds I hang up.

qnas*CLI> == Using SIP RTP CoS mark 5 -- Executing [300@users:1] Macro("SIP/100-00000022", "phone") in new stack -- Executing [s@macro-phone:1] Dial("SIP/100-00000022", "SIP/300,25") in new stack == Using SIP RTP CoS mark 5 -- Called SIP/300 -- SIP/300-00000023 is ringing qnas*CLI> ####RING No such command '####RING' (type 'core show help ####RING' for other possible commands) -- SIP/300-00000023 answered SIP/100-00000022 -- Locally bridging SIP/100-00000022 and SIP/300-00000023 qnas*CLI> #####PICKED UP No such command '#####PICKED UP' (type 'core show help #####PICKED UP' for other possible commands) == Spawn extension (macro-phone, s, 1) exited non-zero on 'SIP/100-00000022' in macro 'phone' == Spawn extension (users, 300, 1) exited non-zero on 'SIP/100-00000022' qnas*CLI> #####HANG UP No such command '#####HANG UP' (type 'core show help #####HANG UP' for other possible commands) qnas*CLI>

This is the verbose listing of a call from the NATted CSipSimple phone calling the Cisco301. In this case I did not pickup the phone, so the voicemail has to pick it up.

qnas*CLI> == Using SIP RTP CoS mark 5 -- Executing [300@users:1] Macro("SIP/100-00000018", "phone") in new stack -- Executing [s@macro-phone:1] Dial("SIP/100-00000018", "SIP/300,25") in new stack == Using SIP RTP CoS mark 5 -- Called SIP/300 -- SIP/300-00000019 is ringing -- Nobody picked up in 25000 ms -- Executing [s@macro-phone:2] Goto("SIP/100-00000018", "NOANSWER,1") in new stack -- Goto (macro-phone,NOANSWER,1) -- Executing [NOANSWER@macro-phone:1] VoiceMail("SIP/100-00000018", "300@default,u") in new stack -- <SIP/100-00000018> Playing 'vm-theperson.gsm' (language 'en') -- <SIP/100-00000018> Playing 'digits/3.gsm' (language 'en') -- <SIP/100-00000018> Playing 'digits/0.gsm' (language 'en') -- <SIP/100-00000018> Playing 'digits/0.gsm' (language 'en') -- <SIP/100-00000018> Playing 'vm-isunavail.gsm' (language 'en') -- <SIP/100-00000018> Playing 'vm-intro.gsm' (language 'en') -- <SIP/100-00000018> Playing 'beep.gsm' (language 'en') -- Recording the message -- x=0, open writing: /opt/var/spool/asterisk/voicemail/default/300/tmp/nx78QP format: wav49, 0x9d782c -- x=1, open writing: /opt/var/spool/asterisk/voicemail/default/300/tmp/nx78QP format: gsm, 0x8587bc -- x=2, open writing: /opt/var/spool/asterisk/voicemail/default/300/tmp/nx78QP format: wav, 0x9e8dd4 -- User hung up == Spawn extension (macro-phone, NOANSWER, 1) exited non-zero on 'SIP/100-00000018' in macro 'phone' == Spawn extension (users, 300, 1) exited non-zero on 'SIP/100-00000018' qnas*CLI>

This is the sip debugging information:

Where:
192.168.3.116=Cisco301
192.168.3.103=Asterisk=qnas
my.routers.public.ip=a public ip address
my.androids.public.ip=a public ip address

10.48.86.155~=~i dont know this ip? also not pingable! or telnet 5060


qnas*CLI> sip set debug on
SIP Debugging enabled

<--- SIP read from UDP:my.andriods.public.ip:47943 --->

<------------->
qnas*CLI> ###############################################start
No such command '###############################################start' (type 'core show help ###############################################start' for other possible commands)

<--- SIP read from UDP:my.andriods.public.ip:47943 --->
INVITE sip:300@my.routers.public.ip SIP/2.0
Via: SIP/2.0/UDP 10.48.86.155:5060;rport;branch=z9hG4bKPjbT.cxVVSfoiiUzWyTLpDVpUnKN5uzoWI
Max-Forwards: 70
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>
Contact: <sip:100@my.andriods.public.ip:47943;ob>
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19530 INVITE
Route: <sip:my.routers.public.ip:5060;transport=udp;lr>
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
User-Agent: CSipSimple_GT-I9100-15/r1916
Content-Type: application/sdp
Content-Length: 362

v=0
o=- 3562677416 3562677416 IN IP4 10.48.86.155
s=pjmedia
c=IN IP4 10.48.86.155
t=0 0
m=audio 4026 RTP/AVP 96 3 0 8 101
c=IN IP4 10.48.86.155
a=rtcp:4027 IN IP4 10.48.86.155
a=sendrecv
a=rtpmap:96 SILK/8000
a=fmtp:96 useinbandfec=0
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-15
<------------->
--- (16 headers 16 lines) ---
Sending to my.andriods.public.ip:47943 (NAT)
Using INVITE request as basis request - RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
Found peer '100' for '100' from my.andriods.public.ip:47943

<--- Reliably Transmitting (NAT) to my.andriods.public.ip:47943 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.48.86.155:5060;branch=z9hG4bKPjbT.cxVVSfoiiUzWyTLpDVpUnKN5uzoWI;received=my.andriods.public.ip;rport=47943
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>;tag=as07c462f0
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19530 INVITE
Server: Asterisk PBX 11.0.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="6024025a"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog 'RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t' in 17984 ms (Method: INVITE)

<--- SIP read from UDP:my.andriods.public.ip:47943 --->
INVITE sip:300@my.routers.public.ip SIP/2.0
Via: SIP/2.0/UDP 10.48.86.155:5060;rport;branch=z9hG4bKPjbT.cxVVSfoiiUzWyTLpDVpUnKN5uzoWI
Max-Forwards: 70
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>
Contact: <sip:100@my.andriods.public.ip:47943;ob>
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19530 INVITE
Route: <sip:my.routers.public.ip:5060;transport=udp;lr>
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
User-Agent: CSipSimple_GT-I9100-15/r1916
Content-Type: application/sdp
Content-Length: 362

v=0
o=- 3562677416 3562677416 IN IP4 10.48.86.155
s=pjmedia
c=IN IP4 10.48.86.155
t=0 0
m=audio 4026 RTP/AVP 96 3 0 8 101
c=IN IP4 10.48.86.155
a=rtcp:4027 IN IP4 10.48.86.155
a=sendrecv
a=rtpmap:96 SILK/8000
a=fmtp:96 useinbandfec=0
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-15
<------------->
--- (16 headers 16 lines) ---
Ignoring this INVITE request

<--- SIP read from UDP:my.andriods.public.ip:47943 --->
ACK sip:300@my.routers.public.ip SIP/2.0
Via: SIP/2.0/UDP 10.48.86.155:5060;rport;branch=z9hG4bKPjbT.cxVVSfoiiUzWyTLpDVpUnKN5uzoWI
Max-Forwards: 70
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>;tag=as07c462f0
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19530 ACK
Route: <sip:my.routers.public.ip:5060;transport=udp;lr>
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---

<--- SIP read from UDP:my.andriods.public.ip:47943 --->
INVITE sip:300@my.routers.public.ip SIP/2.0
Via: SIP/2.0/UDP 10.48.86.155:5060;rport;branch=z9hG4bKPj5YjGw0TRCNxjGp3hMYtzPjmJG6zW9mHY
Max-Forwards: 70
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>
Contact: <sip:100@my.andriods.public.ip:47943;ob>
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19531 INVITE
Route: <sip:my.routers.public.ip:5060;transport=udp;lr>
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
User-Agent: CSipSimple_GT-I9100-15/r1916
Authorization: Digest username="100", realm="asterisk", nonce="6024025a", uri="sip:300@my.routers.public.ip", response="ea24fc4d8b656af5528aadfbf0fed088", algorithm=MD5
Content-Type: application/sdp
Content-Length: 362

v=0
o=- 3562677416 3562677416 IN IP4 10.48.86.155
s=pjmedia
c=IN IP4 10.48.86.155
t=0 0
m=audio 4026 RTP/AVP 96 3 0 8 101
c=IN IP4 10.48.86.155
a=rtcp:4027 IN IP4 10.48.86.155
a=sendrecv
a=rtpmap:96 SILK/8000
a=fmtp:96 useinbandfec=0
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-15
<------------->
--- (17 headers 16 lines) ---
Sending to my.andriods.public.ip:47943 (NAT)
Using INVITE request as basis request - RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
Found peer '100' for '100' from my.andriods.public.ip:47943
  == Using SIP RTP CoS mark 5
Found RTP audio format 96
Found RTP audio format 3
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Found audio description format SILK for ID 96
Found audio description format GSM for ID 3
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw), peer - audio=(gsm|ulaw|alaw|silk8)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 10.48.86.155:4026
Looking for 300 in users (domain my.routers.public.ip)
list_route: hop: <sip:100@my.andriods.public.ip:47943;ob>

<--- Transmitting (NAT) to my.andriods.public.ip:47943 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.48.86.155:5060;branch=z9hG4bKPj5YjGw0TRCNxjGp3hMYtzPjmJG6zW9mHY;received=my.andriods.public.ip;rport=47943
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19531 INVITE
Server: Asterisk PBX 11.0.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:300@my.routers.public.ip:5060>
Content-Length: 0


<------------>
    -- Executing [300@users:1] Macro("SIP/100-00000020", "phone") in new stack
    -- Executing [s@macro-phone:1] Dial("SIP/100-00000020", "SIP/300,25") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 13632
Adding codec 100003 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 192.168.3.116:5060:
INVITE sip:300@192.168.3.116:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.103:5060;branch=z9hG4bK06081ffc
Max-Forwards: 70
From: <sip:100@192.168.3.103>;tag=as406fbe72
To: <sip:300@192.168.3.116:5060>
Contact: <sip:100@192.168.3.103:5060>
Call-ID: 30b862fd6325b6b856d32bd505b61147@192.168.3.103:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.0.1
Date: Fri, 23 Nov 2012 16:37:37 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 262

v=0
o=root 681203535 681203535 IN IP4 192.168.3.103
s=Asterisk PBX 11.0.1
c=IN IP4 192.168.3.103
t=0 0
m=audio 13632 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---
    -- Called SIP/300

<--- SIP read from UDP:192.168.3.116:5060 --->
SIP/2.0 100 Trying
To: <sip:300@192.168.3.116:5060>
From: <sip:100@192.168.3.103>;tag=as406fbe72
Call-ID: 30b862fd6325b6b856d32bd505b61147@192.168.3.103:5060
CSeq: 102 INVITE
Via: SIP/2.0/UDP 192.168.3.103:5060;branch=z9hG4bK06081ffc
Server: Cisco/SPA301-7.4.9c
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from UDP:192.168.3.116:5060 --->
SIP/2.0 180 Ringing
To: <sip:300@192.168.3.116:5060>;tag=8150a476a1047044i0
From: <sip:100@192.168.3.103>;tag=as406fbe72
Call-ID: 30b862fd6325b6b856d32bd505b61147@192.168.3.103:5060
CSeq: 102 INVITE
Via: SIP/2.0/UDP 192.168.3.103:5060;branch=z9hG4bK06081ffc
Contact: "300" <sip:300@192.168.3.116:5060>
Server: Cisco/SPA301-7.4.9c
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
list_route: hop: <sip:300@192.168.3.116:5060>
    -- SIP/300-00000021 is ringing

<--- Transmitting (NAT) to my.andriods.public.ip:47943 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.48.86.155:5060;branch=z9hG4bKPj5YjGw0TRCNxjGp3hMYtzPjmJG6zW9mHY;received=my.andriods.public.ip;rport=47943
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>;tag=as012a630d
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19531 INVITE
Server: Asterisk PBX 11.0.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:300@my.routers.public.ip:5060>
Content-Length: 0


<------------>
qnas*CLI> ########################RING
No such command '########################RING' (type 'core show help ########################RING' for other possible commands)

<--- SIP read from UDP:192.168.3.116:5060 --->
SIP/2.0 200 OK
To: <sip:300@192.168.3.116:5060>;tag=8150a476a1047044i0
From: <sip:100@192.168.3.103>;tag=as406fbe72
Call-ID: 30b862fd6325b6b856d32bd505b61147@192.168.3.103:5060
CSeq: 102 INVITE
Via: SIP/2.0/UDP 192.168.3.103:5060;branch=z9hG4bK06081ffc
Contact: "300" <sip:300@192.168.3.116:5060>
Server: Cisco/SPA301-7.4.9c
Content-Length: 210
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER, UPDATE
Supported: replaces
Content-Type: application/sdp

v=0
o=- 2066371 2066371 IN IP4 192.168.3.116
s=-
c=IN IP4 192.168.3.116
t=0 0
m=audio 16456 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:30
a=sendrecv
<------------->
--- (12 headers 11 lines) ---
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw), peer - audio=(ulaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.3.116:16456
list_route: hop: <sip:300@192.168.3.116:5060>
set_destination: Parsing <sip:300@192.168.3.116:5060> for address/port to send to
set_destination: set destination to 192.168.3.116:5060
Transmitting (no NAT) to 192.168.3.116:5060:
ACK sip:300@192.168.3.116:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.103:5060;branch=z9hG4bK4d820753
Max-Forwards: 70
From: <sip:100@192.168.3.103>;tag=as406fbe72
To: <sip:300@192.168.3.116:5060>;tag=8150a476a1047044i0
Contact: <sip:100@192.168.3.103:5060>
Call-ID: 30b862fd6325b6b856d32bd505b61147@192.168.3.103:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 11.0.1
Content-Length: 0


---
    -- SIP/300-00000021 answered SIP/100-00000020
Audio is at 10656
Adding codec 100003 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to my.andriods.public.ip:47943 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.48.86.155:5060;branch=z9hG4bKPj5YjGw0TRCNxjGp3hMYtzPjmJG6zW9mHY;received=my.andriods.public.ip;rport=47943
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>;tag=as012a630d
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19531 INVITE
Server: Asterisk PBX 11.0.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:300@my.routers.public.ip:5060>
Content-Type: application/sdp
Content-Length: 264

v=0
o=root 1169743721 1169743721 IN IP4 my.routers.public.ip
s=Asterisk PBX 11.0.1
c=IN IP4 my.routers.public.ip
t=0 0
m=audio 10656 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------>
    -- Locally bridging SIP/100-00000020 and SIP/300-00000021
Retransmitting #1 (NAT) to my.andriods.public.ip:47943:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.48.86.155:5060;branch=z9hG4bKPj5YjGw0TRCNxjGp3hMYtzPjmJG6zW9mHY;received=my.andriods.public.ip;rport=47943
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>;tag=as012a630d
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19531 INVITE
Server: Asterisk PBX 11.0.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:300@my.routers.public.ip:5060>
Content-Type: application/sdp
Content-Length: 264

v=0
o=root 1169743721 1169743721 IN IP4 my.routers.public.ip
s=Asterisk PBX 11.0.1
c=IN IP4 my.routers.public.ip
t=0 0
m=audio 10656 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---

<--- SIP read from UDP:my.andriods.public.ip:47943 --->
ACK sip:300@my.routers.public.ip:5060 SIP/2.0
Via: SIP/2.0/UDP 10.48.86.155:5060;rport;branch=z9hG4bKPjvoiQBtLXW9DCywl90b7E1hT135PZDpmo
Max-Forwards: 70
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>;tag=as012a630d
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19531 ACK
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from UDP:my.andriods.public.ip:47943 --->
ACK sip:300@my.routers.public.ip:5060 SIP/2.0
Via: SIP/2.0/UDP 10.48.86.155:5060;rport;branch=z9hG4bKPjvoiQBtLXW9DCywl90b7E1hT135PZDpmo
Max-Forwards: 70
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>;tag=as012a630d
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19531 ACK
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from UDP:my.andriods.public.ip:47943 --->

<------------->
Reliably Transmitting (no NAT) to 192.168.3.116:5060:
OPTIONS sip:300@192.168.3.116:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.103:5060;branch=z9hG4bK3748d181
Max-Forwards: 70
From: "asterisk" <sip:asterisk@192.168.3.103>;tag=as35e6c45a
To: <sip:300@192.168.3.116:5060>
Contact: <sip:asterisk@192.168.3.103:5060>
Call-ID: 59b27a08639e784b0e3e88d813d8c343@192.168.3.103:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 11.0.1
Date: Fri, 23 Nov 2012 16:38:04 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:192.168.3.116:5060 --->
SIP/2.0 200 OK
To: <sip:300@192.168.3.116:5060>;tag=81769b3a4a7276c3i0
From: "asterisk" <sip:asterisk@192.168.3.103>;tag=as35e6c45a
Call-ID: 59b27a08639e784b0e3e88d813d8c343@192.168.3.103:5060
CSeq: 102 OPTIONS
Via: SIP/2.0/UDP 192.168.3.103:5060;branch=z9hG4bK3748d181
Server: Cisco/SPA301-7.4.9c
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER, UPDATE
Supported: replaces

<------------->
--- (10 headers 0 lines) ---
Really destroying SIP dialog '59b27a08639e784b0e3e88d813d8c343@192.168.3.103:5060' Method: OPTIONS
Reliably Transmitting (NAT) to my.andriods.public.ip:47943:
OPTIONS sip:100@my.andriods.public.ip:47943;ob SIP/2.0
Via: SIP/2.0/UDP my.routers.public.ip:5060;branch=z9hG4bK029e6cef;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk@my.routers.public.ip>;tag=as2a7ee551
To: <sip:100@my.andriods.public.ip:47943;ob>
Contact: <sip:asterisk@my.routers.public.ip:5060>
Call-ID: 46ffd6e35f90c4523368cb1c68b34f5b@my.routers.public.ip:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 11.0.1
Date: Fri, 23 Nov 2012 16:38:05 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:my.andriods.public.ip:47943 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP my.routers.public.ip:5060;rport=5060;received=my.routers.public.ip;branch=z9hG4bK029e6cef
Call-ID: 46ffd6e35f90c4523368cb1c68b34f5b@my.routers.public.ip:5060
From: "asterisk" <sip:asterisk@my.routers.public.ip>;tag=as2a7ee551
To: <sip:100@my.andriods.public.ip;ob>;tag=z9hG4bK029e6cef
CSeq: 102 OPTIONS
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Accept: application/sdp, application/pidf+xml, application/xpidf+xml, application/simple-message-summary, message/sipfrag;version=2.0, application/im-iscomposing+xml, text/plain
Supported: replaces, 100rel, timer, norefersub
Allow-Events: presence, message-summary, refer
User-Agent: CSipSimple_GT-I9100-15/r1916
Content-Type: application/sdp
Content-Length: 306

v=0
o=- 3562677445 3562677445 IN IP4 10.48.86.155
s=pjmedia
t=0 0
m=audio 4000 RTP/AVP 96 3 0 8 101
c=IN IP4 10.48.86.155
a=sendrecv
a=rtpmap:96 SILK/8000
a=fmtp:96 useinbandfec=0
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-15
<------------->
--- (13 headers 14 lines) ---
Really destroying SIP dialog '46ffd6e35f90c4523368cb1c68b34f5b@my.routers.public.ip:5060' Method: OPTIONS
qnas*CLI> ###########################PICKED UP
No such command '###########################PICKED UP' (type 'core show help ###########################PICKED UP' for other possible commands)
qnas*CLI> 

<--- SIP read from UDP:my.andriods.public.ip:47943 --->
BYE sip:300@my.routers.public.ip:5060 SIP/2.0
Via: SIP/2.0/UDP 10.48.86.155:5060;rport;branch=z9hG4bKPj0jmIEtj91lWyG3y4QAI0l33PmoCcIDms
Max-Forwards: 70
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>;tag=as012a630d
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19532 BYE
User-Agent: CSipSimple_GT-I9100-15/r1916
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Sending to my.andriods.public.ip:47943 (NAT)
Scheduling destruction of SIP dialog 'RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t' in 17984 ms (Method: BYE)

<--- Transmitting (NAT) to my.andriods.public.ip:47943 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.48.86.155:5060;branch=z9hG4bKPj0jmIEtj91lWyG3y4QAI0l33PmoCcIDms;received=my.andriods.public.ip;rport=47943
From: <sip:100@my.routers.public.ip>;tag=MRPQ-.7-6bNoWfiylMKQKuvdxdAQYepS
To: <sip:300@my.routers.public.ip>;tag=as012a630d
Call-ID: RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t
CSeq: 19532 BYE
Server: Asterisk PBX 11.0.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '30b862fd6325b6b856d32bd505b61147@192.168.3.103:5060' in 6400 ms (Method: INVITE)
set_destination: Parsing <sip:300@192.168.3.116:5060> for address/port to send to
set_destination: set destination to 192.168.3.116:5060
Reliably Transmitting (no NAT) to 192.168.3.116:5060:
BYE sip:300@192.168.3.116:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.103:5060;branch=z9hG4bK55b0daa9
Max-Forwards: 70
From: <sip:100@192.168.3.103>;tag=as406fbe72
To: <sip:300@192.168.3.116:5060>;tag=8150a476a1047044i0
Call-ID: 30b862fd6325b6b856d32bd505b61147@192.168.3.103:5060
CSeq: 103 BYE
User-Agent: Asterisk PBX 11.0.1
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


---

<--- SIP read from UDP:192.168.3.116:5060 --->
SIP/2.0 200 OK
To: <sip:300@192.168.3.116:5060>;tag=8150a476a1047044i0
From: <sip:100@192.168.3.103>;tag=as406fbe72
Call-ID: 30b862fd6325b6b856d32bd505b61147@192.168.3.103:5060
CSeq: 103 BYE
Via: SIP/2.0/UDP 192.168.3.103:5060;branch=z9hG4bK55b0daa9
Server: Cisco/SPA301-7.4.9c
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Really destroying SIP dialog '30b862fd6325b6b856d32bd505b61147@192.168.3.103:5060' Method: INVITE
  == Spawn extension (macro-phone, s, 1) exited non-zero on 'SIP/100-00000020' in macro 'phone'
  == Spawn extension (users, 300, 1) exited non-zero on 'SIP/100-00000020'

<--- SIP read from UDP:my.andriods.public.ip:47943 --->

<------------->
Really destroying SIP dialog 'RN3QrX8Jgovfbr-hmrKh41I3nyFFZa2t' Method: BYE
qnas*CLI> ####################### HANG UP CSipSimple
No such command '####################### HANG UP CSipSimple' (type 'core show help ####################### HANG' for other possible commands)
qnas*CLI> 
Reliably Transmitting (no NAT) to 192.168.3.116:5060:
OPTIONS sip:300@192.168.3.116:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.103:5060;branch=z9hG4bK422a8031
Max-Forwards: 70
From: "asterisk" <sip:asterisk@192.168.3.103>;tag=as69194e8d
To: <sip:300@192.168.3.116:5060>
Contact: <sip:asterisk@192.168.3.103:5060>
Call-ID: 7186008b078aea363b0bec9705f5d364@192.168.3.103:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 11.0.1
Date: Fri, 23 Nov 2012 16:39:04 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:192.168.3.116:5060 --->
SIP/2.0 200 OK
To: <sip:300@192.168.3.116:5060>;tag=81769b3a4a7276c3i0
From: "asterisk" <sip:asterisk@192.168.3.103>;tag=as69194e8d
Call-ID: 7186008b078aea363b0bec9705f5d364@192.168.3.103:5060
CSeq: 102 OPTIONS
Via: SIP/2.0/UDP 192.168.3.103:5060;branch=z9hG4bK422a8031
Server: Cisco/SPA301-7.4.9c
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER, UPDATE
Supported: replaces

<------------->
--- (10 headers 0 lines) ---
Really destroying SIP dialog '7186008b078aea363b0bec9705f5d364@192.168.3.103:5060' Method: OPTIONS
Reliably Transmitting (NAT) to my.andriods.public.ip:47943:
OPTIONS sip:100@my.andriods.public.ip:47943;ob SIP/2.0
Via: SIP/2.0/UDP my.routers.public.ip:5060;branch=z9hG4bK40367692;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk@my.routers.public.ip>;tag=as6dc5c60c
To: <sip:100@my.andriods.public.ip:47943;ob>
Contact: <sip:asterisk@my.routers.public.ip:5060>
Call-ID: 62be38ae2fecaaf603f3df8e05f71ed5@my.routers.public.ip:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 11.0.1
Date: Fri, 23 Nov 2012 16:39:05 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:my.andriods.public.ip:47943 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP my.routers.public.ip:5060;rport=5060;received=my.routers.public.ip;branch=z9hG4bK40367692
Call-ID: 62be38ae2fecaaf603f3df8e05f71ed5@my.routers.public.ip:5060
From: "asterisk" <sip:asterisk@my.routers.public.ip>;tag=as6dc5c60c
To: <sip:100@my.andriods.public.ip;ob>;tag=z9hG4bK40367692
CSeq: 102 OPTIONS
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Accept: application/sdp, application/pidf+xml, application/xpidf+xml, application/simple-message-summary, message/sipfrag;version=2.0, application/im-iscomposing+xml, text/plain
Supported: replaces, 100rel, timer, norefersub
Allow-Events: presence, message-summary, refer
User-Agent: CSipSimple_GT-I9100-15/r1916
Content-Type: application/sdp
Content-Length: 306

v=0
o=- 3562677506 3562677506 IN IP4 10.48.86.155
s=pjmedia
t=0 0
m=audio 4000 RTP/AVP 96 3 0 8 101
c=IN IP4 10.48.86.155
a=sendrecv
a=rtpmap:96 SILK/8000
a=fmtp:96 useinbandfec=0
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-15
<------------->
--- (13 headers 14 lines) ---
Really destroying SIP dialog '62be38ae2fecaaf603f3df8e05f71ed5@my.routers.public.ip:5060' Method: OPTIONS

<--- SIP read from UDP:my.andriods.public.ip:47943 --->

<------------->
qnas*CLI> #################HANG UP Cisco
No such command '#################HANG UP Cisco' (type 'core show help #################HANG UP' for other possible commands)
qnas*CLI> sip set debug off
SIP Debugging Disabled
qnas*CLI>

I presume the Android is acting as a NAT router.

It is failing to send its public address in the SDP.

This may be a case that needs nat=yes, as it looks like you have a broken NAT implementation on the Android side. I’ve not used this in anger (it is heavily misused).I’m not sure about the nat=force_rport, and how that interacts.

Hello david55, all,

david55, thank you very much for looking into my problem…
I will give it a try with other nat= settings. The nat=yes is en depricated value (this is an Asterisk11), i didn’t try comedia. Maybe that works.

Will inform this forum.
Greetings Andre

qnas*CLI> sip reload Reloading SIP == Parsing '/opt/etc/asterisk/sip.conf': Found == Parsing '/opt/etc/asterisk/users.conf': Found == Using SIP CoS mark 4 [Nov 23 21:08:17] WARNING[7917]: sip/config_parser.c:812 sip_parse_nat_option: nat=yes is deprecated, use nat=force_rport,comedia instead == Parsing '/opt/etc/asterisk/sip_notify.conf': Found qnas*CLI>

All,

you won’t believe it… (i didn’t).
Setting nat=comedia works :smile:

I very big thank you to you david55. You gave the right push.

qnas*CLI> == Using SIP RTP CoS mark 5 -- Executing [300@users:1] Macro("SIP/100-00000000", "phone") in new stack -- Executing [s@macro-phone:1] Dial("SIP/100-00000000", "SIP/300,25") in new stack == Using SIP RTP CoS mark 5 -- Called SIP/300 -- SIP/300-00000001 is ringing -- SIP/300-00000001 answered SIP/100-00000000 -- Locally bridging SIP/100-00000000 and SIP/300-00000001Locally bridging == Spawn extension (macro-phone, s, 1) exited non-zero on 'SIP/100-00000000' in macro 'phone' == Spawn extension (users, 300, 1) exited non-zero on 'SIP/100-00000000' qnas*CLI>

I believe I am encountering a similar problem. My situation is:

I have registered two Android phones as a SIP clients on AsteriskWin32 PBX using CSipSimple v.1.01.00r2272. I can dial from one extension to the other, but there is no audio when a call is made.

I am able to hear the audio of the PBX echo test, but the audio that is replayed is very poor, warbled. The handset mic and speaker media graphs both register variations during the test. I have also tried different settings on CSipSimple, but with no improvement.

I was able to use the above configuration successfully with Ozeki Phone System.

The device / system details are:
Handset 1: Micromax A90, Andriod 4.0.3
Handset 2: Samsung Galaxy GT-S5360, Andriod 2.3.6
AsteriskWin32 PBX running on Windows XP, SP3, .NET4.0
CSipSimple: 1.01.00r2272

Please forgive my ignorance, I do not know much about altering the Asteriks source code. If the above explained fix is the solution, where do I find these files and what part of the code in the files (e.g. line number), do I edit?