Can't register SIP phones on remote asterisk

I am new to asterisk. I have installed asterisk 13.22.0 on ubuntu. Actually it is AWS lightsail instance for testing. It is 4.4.0-1063-aws #72-Ubuntu. I am unable to register SIP phones in asterisk.

My sip.conf is

[7000]
qualify=yes
type=friend
host=dynamic
disallow=all
allow=gsm
allow=ulaw
allow=alaw
userame=7000
password:xxxxxxx
context=testing

[1010]
qualify=yes
type=friend
host=dynamic
disallow=all
allow=gsm
allow=ulaw
allow=alaw
userame=1010
password:xxxxxxx
context=testing

My extension.conf is:

[testing]
exten => 1000,1,NoOp(First LIne)
exten => 1000,n,NoOp(Second Line)
exten => 1000,n,Dial(SIP/7000)
exten => 1000,n,Hangup

exten => 2000,1,NoOp(First LIne)
exten => 2000,n,NoOp(Second Line)
exten => 2000,n,Dial(SIP/2810)
exten => 2000,n,Hangup

And My pjsip.conf is:

[1010]
type=endpoint
transport=transport-udp
context=lasttry
disallow=all
allow=ulaw
auth=1010
aors=1010
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
ice_support=yes

[1010]
type=auth
auth_type=userpass
password=xxxxxxxxxx
username=1010

[1010]
type=aor
max_contacts=2

[7000]
type=endpoint
transport=transport-udp
context=lasttry
disallow=all
allow=ulaw
auth=7000
aors=7000
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
ice_support=yes

[7000]
type=auth
auth_type=userpass
password=xxxxxxxx
username=7000

[7000]
type=aor
max_contacts=2

I also disabled firewall but no luck. Is there anything that I missed? Is there any file or context where I have to give my server ip?

There is nothing that would obviously block registration in your sip.conf, so you need to provide logs demonstrating how Asterisk rejected the registration. If you cannot do that, it probably means that the fault is upstream of Asterisk.

You cannot have both chan_sip and chan_pjsip enabled unless you use non-standard ports for one of them! It doesn’t make sense to have the same devices in both.

In most cases type=friend should be type=peer, but that doesn’t cause registration problems.

username is not the current name for that parameter and is often not needed. Misuse could cause a failure to authenticate.

I deleted username parameter but it didn’t work. And there is no log generated when I registered phones. I used 3CX phones. It shows on phone reading configuration data… Discovering network then connecting and finally it shows not connected.

If you have enabled the logging and you get nothing, it means the register request isn’t reaching Asterisk, and we will not be able to help.

First, check network connectivity from system to Asterisk System. Use telnet to check whether sip port is listening or not.

telnet <asterisk system ip> <sip port>

Thanks to all. I fixed my issue. It was really silly mistake. I was using private IP for registering, after using static public IP I was able to register my SIP phones.

1 Like

He’s using UDP, so there will be no TCP ports open for SIP.

Now I have another problem. When I called from one SIP phone to other SIP phone, after accept call it is ending within 5 seconds.
CLI shows

Called SIP/7000
– SIP/7000-0000001a is ringing
> 0x19dbdc0 – Strict RTP learning after remote address set to: 103.44.119.75:8000
– SIP/7000-0000001a answered SIP/1010-00000019
– Channel SIP/7000-0000001a joined ‘simple_bridge’ basic-bridge <1b9720da-0edf-41c2-8890-511d1f1a7d5b>
– Channel SIP/1010-00000019 joined ‘simple_bridge’ basic-bridge <1b9720da-0edf-41c2-8890-511d1f1a7d5b>
> Bridge 1b9720da-0edf-41c2-8890-511d1f1a7d5b: switching from simple_bridge technology to native_rtp
> Remotely bridged ‘SIP/1010-00000019’ and ‘SIP/7000-0000001a’ - media will flow directly between them
> 0x19dbdc0 – Strict RTP learning after remote address set to: 103.44.119.75:8000
[Aug 16 09:21:44] WARNING[1305]: chan_sip.c:4068 retrans_pkt: Retransmission timeout reached on transmission OGJmZDE3NzAyMTAyMjJjNTFhOWYxMzAwMjViOTJhMjU. for seqno 1 (Critical Response) – See Home - Asterisk Documentation
Packet timed out after 6720ms with no response
[Aug 16 09:21:44] WARNING[1305]: chan_sip.c:4092 retrans_pkt: Hanging up call OGJmZDE3NzAyMTAyMjJjNTFhOWYxMzAwMjViOTJhMjU. - no reply to our critical packet (see Home - Asterisk Documentation).
– Channel SIP/1010-00000019 left ‘native_rtp’ basic-bridge <1b9720da-0edf-41c2-8890-511d1f1a7d5b>
== Spawn extension (testing, 1000, 3) exited non-zero on ‘SIP/1010-00000019’
– Channel SIP/7000-0000001a left ‘native_rtp’ basic-bridge <1b9720da-0edf-41c2-8890-511d1f1a7d5b>
> 0x19dbdc0 – Strict RTP learning after remote address set to: 103.44.119.75:8000
> 0x7fac38108850 – Strict RTP learning after remote address set to: 103.44.119.75:40036

The re-invite was invalidly ignored. Some versions of some loss leader soft phones have the bug that they drop re-invites on the floor without even rejecting them. The only cures for that are directmedia=no, or a compliant phone.

The other possibility is that the phone has sent an invalid (typically behind NAT) address in its Contact header.

My CLI shows after making changes in sip.conf as you said directmedia=no:

> <--- SIP read from UDP:103.44.119.75:5060 --->
> REGISTER sip:13.126.130.235:5060 SIP/2.0
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-d26ab527b7037a1a-1---d8754z-;rport
> Max-Forwards: 70
> Contact: <sip:1010@103.44.119.75:5060;transport=UDP;rinstance=5ec7e5ff634400ff>
> To: "1010"<sip:1010@13.126.130.235:5060>
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=020ea304
> Call-ID: YjhmMjY3YjFjZmE2ZTUyYmRmZWEzZDg4ZDhmNWJhZmM.
> CSeq: 179 REGISTER
> Expires: 120
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE
> Supported: replaces
> User-Agent: 3CXPhone 6.0.26523.0
> Content-Length: 0
> 
> <------------->
> --- (13 headers 0 lines) ---
> Sending to 103.44.119.75:5060 (NAT)
> Sending to 103.44.119.75:5060 (NAT)
> Reliably Transmitting (NAT) to 103.44.119.75:5060:
> OPTIONS sip:1010@103.44.119.75:5060;transport=UDP;rinstance=5ec7e5ff634400ff SIP/2.0
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK2f619f9d;rport
> Max-Forwards: 70
> From: "asterisk" <sip:asterisk@172.26.5.241>;tag=as50f2e67d
> To: <sip:1010@103.44.119.75:5060;transport=UDP;rinstance=5ec7e5ff634400ff>
> Contact: <sip:asterisk@172.26.5.241:5060>
> Call-ID: 21165b2f6e698915405accec5d441685@172.26.5.241:5060
> CSeq: 102 OPTIONS
> User-Agent: Asterisk PBX 13.22.0
> Date: Thu, 16 Aug 2018 10:37:31 GMT
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Content-Length: 0
> 
> 
> ---
> 
> <--- Transmitting (NAT) to 103.44.119.75:5060 --->
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-d26ab527b7037a1a-1---d8754z-;received=103.44.119.75;rport=5060
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=020ea304
> To: "1010"<sip:1010@13.126.130.235:5060>;tag=as1845d879
> Call-ID: YjhmMjY3YjFjZmE2ZTUyYmRmZWEzZDg4ZDhmNWJhZmM.
> CSeq: 179 REGISTER
> Server: Asterisk PBX 13.22.0
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Expires: 120
> Contact: <sip:1010@103.44.119.75:5060;transport=UDP;rinstance=5ec7e5ff634400ff>;expires=120
> Date: Thu, 16 Aug 2018 10:37:31 GMT
> Content-Length: 0
> 
> 
> <------------>
> Scheduling destruction of SIP dialog 'YjhmMjY3YjFjZmE2ZTUyYmRmZWEzZDg4ZDhmNWJhZmM.' in 32000 ms (Method: REGISTER)
> 
> <--- SIP read from UDP:103.44.119.75:5060 --->
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK2f619f9d;rport=5060;received=13.126.130.235
> Contact: <sip:103.44.119.75:5060>
> To: <sip:1010@103.44.119.75:5060;transport=UDP;rinstance=5ec7e5ff634400ff>;tag=c8776629
> From: "asterisk"<sip:asterisk@172.26.5.241>;tag=as50f2e67d
> Call-ID: 21165b2f6e698915405accec5d441685@172.26.5.241:5060
> CSeq: 102 OPTIONS
> Accept: application/sdp
> Accept-Language: en
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE
> Supported: replaces
> Allow-Events: presence, message-summary, tunnel-info
> Content-Length: 0
> 
> <------------->
> --- (13 headers 0 lines) ---
> Really destroying SIP dialog '21165b2f6e698915405accec5d441685@172.26.5.241:5060' Method: OPTIONS
> 
> <--- SIP read from UDP:103.44.119.75:5060 --->
> 
> 
> <------------->
> 
> <--- SIP read from UDP:103.44.119.75:35417 --->
> REGISTER sip:13.126.130.235;transport=UDP SIP/2.0
> Via: SIP/2.0/UDP 103.44.119.75:35417;branch=z9hG4bK-524287-1---35bbe818db3ed0ea;rport
> Max-Forwards: 70
> Contact: <sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP>
> To: <sip:7000@13.126.130.235;transport=UDP>
> From: <sip:7000@13.126.130.235;transport=UDP>;tag=6e33a44a
> Call-ID: ms4D5NTtdGELRcPzGt4wWA..
> CSeq: 357 REGISTER
> Expires: 30
> Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
> User-Agent: Z 5.2.16 rv2.8.95
> Allow-Events: presence, kpml, talk
> Content-Length: 0
> 
> <------------->
> --- (13 headers 0 lines) ---
> Sending to 103.44.119.75:35417 (NAT)
> Sending to 103.44.119.75:35417 (NAT)
> Reliably Transmitting (NAT) to 103.44.119.75:35417:
> OPTIONS sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP SIP/2.0
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK1b2c9130;rport
> Max-Forwards: 70
> From: "asterisk" <sip:asterisk@172.26.5.241>;tag=as0ed0fa26
> To: <sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP>
> Contact: <sip:asterisk@172.26.5.241:5060>
> Call-ID: 3dd9ea6767fec4b5185aba495651946d@172.26.5.241:5060
> CSeq: 102 OPTIONS
> User-Agent: Asterisk PBX 13.22.0
> Date: Thu, 16 Aug 2018 10:37:38 GMT
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Content-Length: 0
> 
> 
> ---
> 
> <--- Transmitting (NAT) to 103.44.119.75:35417 --->
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 103.44.119.75:35417;branch=z9hG4bK-524287-1---35bbe818db3ed0ea;received=103.44.119.75;rport=35417
> From: <sip:7000@13.126.130.235;transport=UDP>;tag=6e33a44a
> To: <sip:7000@13.126.130.235;transport=UDP>;tag=as58f01a01
> Call-ID: ms4D5NTtdGELRcPzGt4wWA..
> CSeq: 357 REGISTER
> Server: Asterisk PBX 13.22.0
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Expires: 60
> Contact: <sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP>;expires=60
> Date: Thu, 16 Aug 2018 10:37:38 GMT
> Content-Length: 0
> 
> 
> <------------>
> Scheduling destruction of SIP dialog 'ms4D5NTtdGELRcPzGt4wWA..' in 32000 ms (Method: REGISTER)
> 
> <--- SIP read from UDP:103.44.119.75:35417 --->
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK1b2c9130;rport=5060;received=13.126.130.235
> Contact: <sip:103.44.119.75:35417>
> To: <sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP>;tag=dd198775
> From: "asterisk" <sip:asterisk@172.26.5.241>;tag=as0ed0fa26
> Call-ID: 3dd9ea6767fec4b5185aba495651946d@172.26.5.241:5060
> CSeq: 102 OPTIONS
> Accept: application/sdp, application/sdp
> Accept-Language: en
> Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
> Supported: replaces, norefersub, extended-refer, timer, outbound, path, X-cisco-serviceuri
> User-Agent: Z 5.2.16 rv2.8.95
> Allow-Events: presence, kpml, talk
> Content-Length: 0
> 
> <------------->
> --- (14 headers 0 lines) ---
> Really destroying SIP dialog '3dd9ea6767fec4b5185aba495651946d@172.26.5.241:5060' Method: OPTIONS
> 
> <--- SIP read from UDP:103.44.119.75:5060 --->
> INVITE sip:1000@13.126.130.235:5060 SIP/2.0
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-da79a9700f3bb461-1---d8754z-;rport
> Max-Forwards: 70
> Contact: <sip:1010@103.44.119.75:5060;transport=UDP>
> To: <sip:1000@13.126.130.235:5060>
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 1 INVITE
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE
> Content-Type: application/sdp
> Supported: replaces
> User-Agent: 3CXPhone 6.0.26523.0
> Content-Length: 407
> 
> v=0
> o=3cxVCE 169583265 232518075 IN IP4 103.44.119.75
> s=3cxVCE Audio Call
> c=IN IP4 103.44.119.75
> t=0 0
> m=audio 40030 RTP/AVP 0 8 3 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:3 GSM/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-15
> a=ptime:20
> a=sendrecv
> m=video 40028 RTP/AVP 34
> c=IN IP4 103.44.119.75
> a=rtpmap:34 H263/90000
> a=fmtp:34 QCIF=1;CIF=1;SQCIF=1;CIF4=1
> a=sendrecv
> <------------->
> --- (13 headers 18 lines) ---
> Sending to 103.44.119.75:5060 (NAT)
> Sending to 103.44.119.75:5060 (NAT)
> Using INVITE request as basis request - YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> Found peer '1010' for '1010' from 103.44.119.75:5060
>   == Using SIP RTP CoS mark 5
> Found RTP audio format 0
> Found RTP audio format 8
> Found RTP audio format 3
> Found RTP audio format 101
> Found audio description format PCMU for ID 0
> Found audio description format PCMA for ID 8
> Found audio description format GSM for ID 3
> Found audio description format telephone-event for ID 101
> Found RTP video format 34
> Found video description format H263 for ID 34
> Capabilities: us - (ulaw|alaw), peer - audio=(ulaw|gsm|alaw)/video=(h263)/text=(nothing), combined - (ulaw|alaw)
> Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
>        > 0x7fac3801ef20 -- Strict RTP learning after remote address set to: 103.44.119.75:40030
> Peer audio RTP is at port 103.44.119.75:40030
> Looking for 1000 in lasttry (domain 13.126.130.235)
> sip_route_dump: route/path hop: <sip:1010@103.44.119.75:5060;transport=UDP>
> 
> <--- Transmitting (NAT) to 103.44.119.75:5060 --->
> SIP/2.0 100 Trying
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-da79a9700f3bb461-1---d8754z-;received=103.44.119.75;rport=5060
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> To: <sip:1000@13.126.130.235:5060>
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 1 INVITE
> Server: Asterisk PBX 13.22.0
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Contact: <sip:1000@172.26.5.241:5060>
> Content-Length: 0
> 
> 
> <------------>
>     -- Executing [1000@lasttry:1] NoOp("SIP/1010-00000033", "First LIne") in new stack
>     -- Executing [1000@lasttry:2] NoOp("SIP/1010-00000033", "Second Line") in new stack
>     -- Executing [1000@lasttry:3] Dial("SIP/1010-00000033", "SIP/7000") in new stack
>   == Using SIP RTP CoS mark 5
> Audio is at 13228
> Adding codec ulaw to SDP
> Adding codec alaw to SDP
> Adding non-codec 0x1 (telephone-event) to SDP
> Reliably Transmitting (NAT) to 103.44.119.75:35417:
> INVITE sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP SIP/2.0
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK177f5a6c;rport
> Max-Forwards: 70
> From: "1010" <sip:1010@172.26.5.241>;tag=as01637e19
> To: <sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP>
> Contact: <sip:1010@172.26.5.241:5060>
> Call-ID: 4f6357ac236db63879213ab332564250@172.26.5.241:5060
> CSeq: 102 INVITE
> User-Agent: Asterisk PBX 13.22.0
> Date: Thu, 16 Aug 2018 10:37:45 GMT
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Content-Type: application/sdp
> Content-Length: 262
> 
> v=0
> o=root 595161832 595161832 IN IP4 172.26.5.241
> s=Asterisk PBX 13.22.0
> c=IN IP4 172.26.5.241
> t=0 0
> m=audio 13228 RTP/AVP 0 8 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=maxptime:150
> a=sendrecv
> 
> ---
>     -- Called SIP/7000
> 
> <--- SIP read from UDP:103.44.119.75:35417 --->
> SIP/2.0 100 Trying
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK177f5a6c;rport=5060;received=13.126.130.235
> To: <sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP>
> From: "1010" <sip:1010@172.26.5.241>;tag=as01637e19
> Call-ID: 4f6357ac236db63879213ab332564250@172.26.5.241:5060
> CSeq: 102 INVITE
> Content-Length: 0
> 
> <------------->
> --- (7 headers 0 lines) ---
> 
> <--- SIP read from UDP:103.44.119.75:35417 --->
> SIP/2.0 180 Ringing
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK177f5a6c;rport=5060;received=13.126.130.235
> Contact: <sip:7000@103.44.119.75:35417>
> To: <sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP>;tag=a7472331
> From: "1010" <sip:1010@172.26.5.241>;tag=as01637e19
> Call-ID: 4f6357ac236db63879213ab332564250@172.26.5.241:5060
> CSeq: 102 INVITE
> Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
> User-Agent: Z 5.2.16 rv2.8.95
> Allow-Events: presence, kpml, talk
> Content-Length: 0
> 
> <------------->
> --- (11 headers 0 lines) ---
> sip_route_dump: route/path hop: <sip:7000@103.44.119.75:35417>
>     -- SIP/7000-00000034 is ringing
> 
> <--- Transmitting (NAT) to 103.44.119.75:5060 --->
> SIP/2.0 180 Ringing
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-da79a9700f3bb461-1---d8754z-;received=103.44.119.75;rport=5060
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> To: <sip:1000@13.126.130.235:5060>;tag=as4ec0d955
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 1 INVITE
> Server: Asterisk PBX 13.22.0
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Contact: <sip:1000@172.26.5.241:5060>
> Content-Length: 0
> 
> 
> <------------>
> 
> <--- SIP read from UDP:103.44.119.75:35417 --->
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK177f5a6c;rport=5060;received=13.126.130.235
> Contact: <sip:7000@103.44.119.75:35417>
> To: <sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP>;tag=a7472331
> From: "1010" <sip:1010@172.26.5.241>;tag=as01637e19
> Call-ID: 4f6357ac236db63879213ab332564250@172.26.5.241:5060
> CSeq: 102 INVITE
> Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
> Content-Type: application/sdp
> User-Agent: Z 5.2.16 rv2.8.95
> Allow-Events: presence, kpml, talk
> Content-Length: 602
> 
> v=0
> o=Z 0 1 IN IP4 103.44.119.75
> s=Z
> c=IN IP4 103.44.119.75
> t=0 0
> m=audio 8000 RTP/AVP 0 106 9 3 111 8 97 110 112 102 101 98 100 99
> a=rtpmap:106 opus/48000/2
> a=fmtp:106 minptime=20; cbr=1; maxaveragebitrate=40000; useinbandfec=1
> a=rtpmap:111 speex/16000
> a=rtpmap:97 iLBC/8000
> a=fmtp:97 mode=20
> a=rtpmap:110 speex/8000
> a=rtpmap:112 speex/32000
> a=rtpmap:102 G726-32/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=rtpmap:98 telephone-event/48000
> a=fmtp:98 0-16
> a=rtpmap:100 telephone-event/16000
> a=fmtp:100 0-16
> a=rtpmap:99 telephone-event/32000
> a=fmtp:99 0-16
> a=sendrecv
> <------------->
> --- (12 headers 23 lines) ---
> Found RTP audio format 0
> Found RTP audio format 106
> Found RTP audio format 9
> Found RTP audio format 3
> Found RTP audio format 111
> Found RTP audio format 8
> Found RTP audio format 97
> Found RTP audio format 110
> Found RTP audio format 112
> Found RTP audio format 102
> Found RTP audio format 101
> Found RTP audio format 98
> Found RTP audio format 100
> Found RTP audio format 99
> Found audio description format opus for ID 106
> Found audio description format speex for ID 111
> Found audio description format iLBC for ID 97
> Found audio description format speex for ID 110
> Found audio description format speex for ID 112
> Found audio description format G726-32 for ID 102
> Found audio description format telephone-event for ID 101
> Found unknown media description format telephone-event for ID 98
> Found unknown media description format telephone-event for ID 100
> Found unknown media description format telephone-event for ID 99
> Capabilities: us - (ulaw|alaw), peer - audio=(ulaw|gsm|alaw|g722|ilbc|g726|opus|speex|speex16|speex32)/video=(nothing)/text=(nothing), combined - (ulaw|alaw)
> Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
>        > 0x7fac5400af80 -- Strict RTP learning after remote address set to: 103.44.119.75:8000
> Peer audio RTP is at port 103.44.119.75:8000
> sip_route_dump: route/path hop: <sip:7000@103.44.119.75:35417>
> Transmitting (NAT) to 103.44.119.75:35417:
> ACK sip:7000@103.44.119.75:35417 SIP/2.0
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK05553d4c;rport
> Max-Forwards: 70
> From: "1010" <sip:1010@172.26.5.241>;tag=as01637e19
> To: <sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP>;tag=a7472331
> Contact: <sip:1010@172.26.5.241:5060>
> Call-ID: 4f6357ac236db63879213ab332564250@172.26.5.241:5060
> CSeq: 102 ACK
> User-Agent: Asterisk PBX 13.22.0
> Content-Length: 0
> 
> 
> ---
>     -- SIP/7000-00000034 answered SIP/1010-00000033
> Audio is at 19216
> Adding codec ulaw to SDP
> Adding codec alaw to SDP
> Adding non-codec 0x1 (telephone-event) to SDP
> 
> <--- Reliably Transmitting (NAT) to 103.44.119.75:5060 --->
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-da79a9700f3bb461-1---d8754z-;received=103.44.119.75;rport=5060
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> To: <sip:1000@13.126.130.235:5060>;tag=as4ec0d955
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 1 INVITE
> Server: Asterisk PBX 13.22.0
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Contact: <sip:1000@172.26.5.241:5060>
> Content-Type: application/sdp
> Content-Length: 286
> 
> v=0
> o=root 1504670142 1504670142 IN IP4 172.26.5.241
> s=Asterisk PBX 13.22.0
> c=IN IP4 172.26.5.241
> t=0 0
> m=audio 19216 RTP/AVP 0 8 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=maxptime:150
> a=sendrecv
> m=video 0 RTP/AVP 34
> 
> <------------>
>     -- Channel SIP/7000-00000034 joined 'simple_bridge' basic-bridge <618e2d17-a2a8-43d3-9f92-93a4ed2bf723>
>     -- Channel SIP/1010-00000033 joined 'simple_bridge' basic-bridge <618e2d17-a2a8-43d3-9f92-93a4ed2bf723>
>        > Bridge 618e2d17-a2a8-43d3-9f92-93a4ed2bf723: switching from simple_bridge technology to native_rtp
>        > Locally RTP bridged 'SIP/1010-00000033' and 'SIP/7000-00000034' in stack
> Retransmitting #1 (NAT) to 103.44.119.75:5060:
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-da79a9700f3bb461-1---d8754z-;received=103.44.119.75;rport=5060
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> To: <sip:1000@13.126.130.235:5060>;tag=as4ec0d955
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 1 INVITE
> Server: Asterisk PBX 13.22.0
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Contact: <sip:1000@172.26.5.241:5060>
> Content-Type: application/sdp
> Content-Length: 286
> 
> v=0
> o=root 1504670142 1504670142 IN IP4 172.26.5.241
> s=Asterisk PBX 13.22.0
> c=IN IP4 172.26.5.241
> t=0 0
> m=audio 19216 RTP/AVP 0 8 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=maxptime:150
> a=sendrecv
> m=video 0 RTP/AVP 34
> 
> ---
> Retransmitting #2 (NAT) to 103.44.119.75:5060:
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-da79a9700f3bb461-1---d8754z-;received=103.44.119.75;rport=5060
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> To: <sip:1000@13.126.130.235:5060>;tag=as4ec0d955
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 1 INVITE
> Server: Asterisk PBX 13.22.0
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Contact: <sip:1000@172.26.5.241:5060>
> Content-Type: application/sdp
> Content-Length: 286
> 
> v=0
> o=root 1504670142 1504670142 IN IP4 172.26.5.241
> s=Asterisk PBX 13.22.0
> c=IN IP4 172.26.5.241
> t=0 0
> m=audio 19216 RTP/AVP 0 8 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=maxptime:150
> a=sendrecv
> m=video 0 RTP/AVP 34
> 
> ---
> Retransmitting #3 (NAT) to 103.44.119.75:5060:
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-da79a9700f3bb461-1---d8754z-;received=103.44.119.75;rport=5060
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> To: <sip:1000@13.126.130.235:5060>;tag=as4ec0d955
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 1 INVITE
> Server: Asterisk PBX 13.22.0
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Contact: <sip:1000@172.26.5.241:5060>
> Content-Type: application/sdp
> Content-Length: 286
> 
> v=0
> o=root 1504670142 1504670142 IN IP4 172.26.5.241
> s=Asterisk PBX 13.22.0
> c=IN IP4 172.26.5.241
> t=0 0
> m=audio 19216 RTP/AVP 0 8 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=maxptime:150
> a=sendrecv
> m=video 0 RTP/AVP 34
> 
> ---
> Retransmitting #4 (NAT) to 103.44.119.75:5060:
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-da79a9700f3bb461-1---d8754z-;received=103.44.119.75;rport=5060
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> To: <sip:1000@13.126.130.235:5060>;tag=as4ec0d955
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 1 INVITE
> Server: Asterisk PBX 13.22.0
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Contact: <sip:1000@172.26.5.241:5060>
> Content-Type: application/sdp
> Content-Length: 286
> 
> v=0
> o=root 1504670142 1504670142 IN IP4 172.26.5.241
> s=Asterisk PBX 13.22.0
> c=IN IP4 172.26.5.241
> t=0 0
> m=audio 19216 RTP/AVP 0 8 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=maxptime:150
> a=sendrecv
> m=video 0 RTP/AVP 34
> 
> ---
> Retransmitting #5 (NAT) to 103.44.119.75:5060:
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-da79a9700f3bb461-1---d8754z-;received=103.44.119.75;rport=5060
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> To: <sip:1000@13.126.130.235:5060>;tag=as4ec0d955
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 1 INVITE
> Server: Asterisk PBX 13.22.0
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Contact: <sip:1000@172.26.5.241:5060>
> Content-Type: application/sdp
> Content-Length: 286
> 
> v=0
> o=root 1504670142 1504670142 IN IP4 172.26.5.241
> s=Asterisk PBX 13.22.0
> c=IN IP4 172.26.5.241
> t=0 0
> m=audio 19216 RTP/AVP 0 8 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=maxptime:150
> a=sendrecv
> m=video 0 RTP/AVP 34
> 
> ---
> Retransmitting #6 (NAT) to 103.44.119.75:5060:
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 103.44.119.75:5060;branch=z9hG4bK-d8754z-da79a9700f3bb461-1---d8754z-;received=103.44.119.75;rport=5060
> From: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> To: <sip:1000@13.126.130.235:5060>;tag=as4ec0d955
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 1 INVITE
> Server: Asterisk PBX 13.22.0
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
> Supported: replaces, timer
> Contact: <sip:1000@172.26.5.241:5060>
> Content-Type: application/sdp
> Content-Length: 286
> 
> v=0
> o=root 1504670142 1504670142 IN IP4 172.26.5.241
> s=Asterisk PBX 13.22.0
> c=IN IP4 172.26.5.241
> t=0 0
> m=audio 19216 RTP/AVP 0 8 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=maxptime:150
> a=sendrecv
> m=video 0 RTP/AVP 34
> 
> ---
> [Aug 16 10:38:02] WARNING[1305]: chan_sip.c:4068 retrans_pkt: Retransmission timeout reached on transmission YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU. for seqno 1 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
> Packet timed out after 6976ms with no response
> [Aug 16 10:38:02] WARNING[1305]: chan_sip.c:4092 retrans_pkt: Hanging up call YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU. - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).
>     -- Channel SIP/1010-00000033 left 'native_rtp' basic-bridge <618e2d17-a2a8-43d3-9f92-93a4ed2bf723>
>   == Spawn extension (lasttry, 1000, 3) exited non-zero on 'SIP/1010-00000033'
> Scheduling destruction of SIP dialog 'YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.' in 6976 ms (Method: INVITE)
> Reliably Transmitting (NAT) to 103.44.119.75:5060:
> BYE sip:1010@103.44.119.75:5060;transport=UDP SIP/2.0
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK5a3572ae;rport
> Max-Forwards: 70
> From: <sip:1000@13.126.130.235:5060>;tag=as4ec0d955
> To: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 102 BYE
> User-Agent: Asterisk PBX 13.22.0
> X-Asterisk-HangupCause: No user responding
> X-Asterisk-HangupCauseCode: 18
> Content-Length: 0
> 
> 
> ---
>     -- Channel SIP/7000-00000034 left 'native_rtp' basic-bridge <618e2d17-a2a8-43d3-9f92-93a4ed2bf723>
> Scheduling destruction of SIP dialog '4f6357ac236db63879213ab332564250@172.26.5.241:5060' in 6400 ms (Method: INVITE)
> Reliably Transmitting (NAT) to 103.44.119.75:35417:
> BYE sip:7000@103.44.119.75:35417 SIP/2.0
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK66122094;rport
> Max-Forwards: 70
> From: "1010" <sip:1010@172.26.5.241>;tag=as01637e19
> To: <sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP>;tag=a7472331
> Call-ID: 4f6357ac236db63879213ab332564250@172.26.5.241:5060
> CSeq: 103 BYE
> User-Agent: Asterisk PBX 13.22.0
> X-Asterisk-HangupCause: No user responding
> X-Asterisk-HangupCauseCode: 18
> Content-Length: 0
> 
> 
> ---
> 
> <--- SIP read from UDP:103.44.119.75:35417 --->
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK66122094;rport=5060;received=13.126.130.235
> Contact: <sip:7000@103.44.119.75:35417>
> To: <sip:7000@103.44.119.75:35417;rinstance=4e47afd124f34ea0;transport=UDP>;tag=a7472331
> From: "1010" <sip:1010@172.26.5.241>;tag=as01637e19
> Call-ID: 4f6357ac236db63879213ab332564250@172.26.5.241:5060
> CSeq: 103 BYE
> User-Agent: Z 5.2.16 rv2.8.95
> Content-Length: 0
> 
> <------------->
> --- (9 headers 0 lines) ---
> Really destroying SIP dialog '4f6357ac236db63879213ab332564250@172.26.5.241:5060' Method: INVITE
> 
> <--- SIP read from UDP:103.44.119.75:5060 --->
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 172.26.5.241:5060;branch=z9hG4bK5a3572ae;rport=5060;received=13.126.130.235
> Contact: <sip:1010@103.44.119.75:5060;transport=UDP>
> To: "1010"<sip:1010@13.126.130.235:5060>;tag=f075701e
> From: <sip:1000@13.126.130.235:5060>;tag=as4ec0d955
> Call-ID: YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.
> CSeq: 102 BYE
> User-Agent: 3CXPhone 6.0.26523.0
> Content-Length: 0
> 
> <------------->
> --- (9 headers 0 lines) ---
> SIP Response message for INCOMING dialog BYE arrived
> Really destroying SIP dialog 'YThmMmU1MGQ5NDFhZGQzNzUwYjRlZTg0MjhhOGYzMjU.' Method: INVITE
> Really destroying SIP dialog 'YjhmMjY3YjFjZmE2ZTUyYmRmZWEzZDg4ZDhmNWJhZmM.' Method: REGISTER
> 
> <--- SIP read from UDP:103.44.119.75:5060 --->
> 
> 
> <------------->
> 
> <--- SIP read from UDP:103.44.119.75:35417 --->
> 
> 
> <------------->
> Really destroying SIP dialog 'ms4D5NTtdGELRcPzGt4wWA..' Method: REGISTER

You are not getting an ACK from the caller. That is typically a NAT issue. Is 72.26.5.241:5060 a valid address for your Asterisk box from the device initiating the call?

It is 172.26.5.241. Yes it is valid address for my asterisk. But as I run on Amazon Web service (AWS) Lightsail instace I have private IP and public IP. My private IP is 172.26.5.241 and public IP is 13.126.130.235 on which phones are registered because if I used private IP phones didn’t register.

If you have quoted your complete sip.conf, it is incomplete, as it does not provide any means for Asterisk to know its public address or which devices are on its private sub-network. See the sample configuration files for details of options to deal with this.

Thank you @david551. I really appreciate your help. I added externip and localnet properly. Its working fine now.

1 Like