# SIP peer problem

**URL:** <https://community.asterisk.org/t/sip-peer-problem/37960>\
**Category:** Asterisk Support\
**Created:** [January 17, 2012, 5:42pm UTC](https://community.asterisk.org/t/sip-peer-problem/37960 "2012-01-17T17:42:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [January 17, 2012, 5:42pm UTC](https://community.asterisk.org/t/sip-peer-problem/37960/1 "2012-01-17T17:42:20Z")

</div>

Hi  
I have a SIP trunk that i should register on server with my public ip address  
my asterisk registered successfully on sip server, but i can’t have outgoing call! and the SIP peer is unreachable!  
My sip.conf:

[general]  
register =\> my\_sip\_user:my\_sip\_passr@server\_ip ~400  
localnet= server\_ip/255.255.255.255  
nat=yes  
externip=my\_public\_ip

[mysipuser]  
type=peer  
dtmfmode=rfc2833  
host=server\_ip  
user=my\_sip\_user  
secret=my\_sip\_pass  
context=incoming  
disallow=all  
allow=ulaw  
qualify=yes  
deny=0.0.0.0/0  
permit=server\_ip/32  
insecure=invite,port

with this configuration, i can see my user status in “sip show registry” =\> Registered  
but in “sip show peers” my user status is UNREACHABLE  
incoming call are accepted successfully, but i can’t have outgoing call!

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [January 17, 2012, 7:40pm UTC](https://community.asterisk.org/t/sip-peer-problem/37960/2 "2012-01-17T19:40:28Z")

</div>

localnet should be something like 192.168.1.0/255.255.255.0. It should not be anything to do with the service provider.

Most people do not need nat=yes.

Most people do not need insecure=port.

You don’t seem to have disabled allowguest.

(Edit: Full address with /32 was OK.)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [January 18, 2012, 7:22am UTC](https://community.asterisk.org/t/sip-peer-problem/37960/3 "2012-01-18T07:22:21Z")

</div>

hi  
none of these configurations changes the status!  
I set allowguest=no but nothing happened  
I configure this sip account on my 3CX softphone, it works perfectly! But in my asterisk some thing is wrong but I don’t find it!

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [January 18, 2012, 8:05am UTC](https://community.asterisk.org/t/sip-peer-problem/37960/4 "2012-01-18T08:05:39Z")

</div>

allowguest=no improves security. It doesn’t fix NAT problems.

I think you need to provide a clear a diagram of your network and the output resulting when you use sip set debug on.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [January 18, 2012, 8:30am UTC](https://community.asterisk.org/t/sip-peer-problem/37960/5 "2012-01-18T08:30:24Z")

</div>

My linux connects to internet through a PPPoE connection that gets the public ip address!  
The provider provide me a publice ip address as my sip server but i think the real SIP server is behind a firewall!  
i enable debug on my peer and get these messages:  
SERVER\_PUBLIC\_IP=\> IP address of my provider (i think the ip of provider’s firewall)

Reliably Transmitting (NAT) to SERVER\_PUBLIC\_IP:5060:  
OPTIONS sip:SERVER\_PUBLIC\_IP SIP/2.0  
Via: SIP/2.0/UDP MY\_PUBLIC\_IP:5060;branch=z9hG4bK1c3509f8;rport  
Max-Forwards: 70  
From: “asterisk” sip:asterisk@MY\_PUBLIC\_IP;tag=as120d85fd  
To: sip:SERVER\_PUBLIC\_IP  
Contact: sip:asterisk@MY\_PUBLIC\_IP:5060  
Call-ID: 28d3467a5f858e3d5b8da3d44e56eedb@MY\_PUBLIC\_IP:5060  
CSeq: 102 OPTIONS  
User-Agent: Asterisk PBX 1.8.7.0  
Date: Wed, 18 Jan 2012 08:15:33 GMT  
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH  
Supported: replaces, timer  
Content-Length: 0

* * *

\<— SIP read from UDP:SERVER\_PUBLIC\_IP:5060 —\>  
hello  
\<-------------\>  
Retransmitting #1 (NAT) to SERVER\_PUBLIC\_IP:5060:  
OPTIONS sip:SERVER\_PUBLIC\_IP SIP/2.0  
Via: SIP/2.0/UDP MY\_PUBLIC\_IP:5060;branch=z9hG4bK1c3509f8;rport  
Max-Forwards: 70  
From: “asterisk” sip:asterisk@MY\_PUBLIC\_IP;tag=as120d85fd  
To: sip:SERVER\_PUBLIC\_IP  
Contact: sip:asterisk@MY\_PUBLIC\_IP:5060  
Call-ID: 28d3467a5f858e3d5b8da3d44e56eedb@MY\_PUBLIC\_IP:5060  
CSeq: 102 OPTIONS  
User-Agent: Asterisk PBX 1.8.7.0  
Date: Wed, 18 Jan 2012 08:15:33 GMT  
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH  
Supported: replaces, timer  
Content-Length: 0

* * *

Retransmitting #2 (NAT) to SERVER\_PUBLIC\_IP:5060:  
OPTIONS sip:SERVER\_PUBLIC\_IP SIP/2.0  
Via: SIP/2.0/UDP MY\_PUBLIC\_IP:5060;branch=z9hG4bK1c3509f8;rport  
Max-Forwards: 70  
From: “asterisk” sip:asterisk@MY\_PUBLIC\_IP;tag=as120d85fd  
To: sip:SERVER\_PUBLIC\_IP  
Contact: sip:asterisk@MY\_PUBLIC\_IP:5060  
Call-ID: 28d3467a5f858e3d5b8da3d44e56eedb@MY\_PUBLIC\_IP:5060  
CSeq: 102 OPTIONS  
User-Agent: Asterisk PBX 1.8.7.0  
Date: Wed, 18 Jan 2012 08:15:33 GMT  
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH  
Supported: replaces, timer  
Content-Length: 0

* * *

Retransmitting #3 (NAT) to SERVER\_PUBLIC\_IP:5060:  
OPTIONS sip:SERVER\_PUBLIC\_IP SIP/2.0  
Via: SIP/2.0/UDP MY\_PUBLIC\_IP:5060;branch=z9hG4bK1c3509f8;rport  
Max-Forwards: 70  
From: “asterisk” sip:asterisk@MY\_PUBLIC\_IP;tag=as120d85fd  
To: sip:SERVER\_PUBLIC\_IP  
Contact: sip:asterisk@MY\_PUBLIC\_IP:5060  
Call-ID: 28d3467a5f858e3d5b8da3d44e56eedb@MY\_PUBLIC\_IP:5060  
CSeq: 102 OPTIONS  
User-Agent: Asterisk PBX 1.8.7.0  
Date: Wed, 18 Jan 2012 08:15:33 GMT  
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH  
Supported: replaces, timer  
Content-Length: 0

* * *

Retransmitting #4 (NAT) to SERVER\_PUBLIC\_IP:5060:  
OPTIONS sip:SERVER\_PUBLIC\_IP SIP/2.0  
Via: SIP/2.0/UDP MY\_PUBLIC\_IP:5060;branch=z9hG4bK1c3509f8;rport  
Max-Forwards: 70  
From: “asterisk” sip:asterisk@MY\_PUBLIC\_IP;tag=as120d85fd  
To: sip:SERVER\_PUBLIC\_IP  
Contact: sip:asterisk@MY\_PUBLIC\_IP:5060  
Call-ID: 28d3467a5f858e3d5b8da3d44e56eedb@MY\_PUBLIC\_IP:5060  
CSeq: 102 OPTIONS  
User-Agent: Asterisk PBX 1.8.7.0  
Date: Wed, 18 Jan 2012 08:15:33 GMT  
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH  
Supported: replaces, timer  
Content-Length: 0

* * *

Really destroying SIP dialog ‘28d3467a5f858e3d5b8da3d44e56eedb@MY\_PUBLIC\_IP:5060’ Method: OPTIONS

\<— SIP read from UDP:SERVER\_PUBLIC\_IP:5060 —\>  
SIP/2.0 504 Server Time-out  
From: “asterisk” sip:asterisk@MY\_PUBLIC\_IP;tag=as19058109  
To: sip:SERVER\_PUBLIC\_IP;tag=dfdc08cf  
CSeq: 102 OPTIONS  
Call-ID: 474f05e175209a1a18ca8f64395ddd1f@MY\_PUBLIC\_IP:5060  
Via: SIP/2.0/UDP MY\_PUBLIC\_IP:5060;branch=z9hG4bK6fda0133;rport=5060  
Content-Length: 0

\<-------------\>  
— (7 headers 0 lines) —

\<— SIP read from UDP:SERVER\_PUBLIC\_IP:5060 —\>  
hello  
\<-------------\>

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [January 18, 2012, 12:02pm UTC](https://community.asterisk.org/t/sip-peer-problem/37960/6 "2012-01-18T12:02:28Z")

</div>

There are no REGISTER or INVITE transactions in that trace.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [January 18, 2012, 9:56pm UTC](https://community.asterisk.org/t/sip-peer-problem/37960/7 "2012-01-18T21:56:27Z")

</div>

My registration doesn’t have any problem! “show sip registry” shows that my account is “Registered”,I have problem with outgoing calls only! “show sip peers” shows peer "UNREACHABLE"  
I just get those messages in a loop!!

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [January 18, 2012, 10:15pm UTC](https://community.asterisk.org/t/sip-peer-problem/37960/8 "2012-01-18T22:15:42Z")

</div>

The OPTION packets are the result of the qualify option.

You need to have a trace of an INVITE dialogue, and possibly also a REGISTER one, to see which addresses are actually being passed.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [January 20, 2012, 10:31pm UTC](https://community.asterisk.org/t/sip-peer-problem/37960/9 "2012-01-20T22:31:05Z")

</div>

Hi  
I set qualify= no and enable debug on my peer! I find one other public ip address in logs!!  
MY\_SIP\_USER : my sip trunk user name  
PUBLIC\_IP1: my public ip address  
PUBLIC\_IP2: public ip address of provider  
PUBLIC\_IP3: the new ip address I find it i don’t know where is it!!  
These are logs of about 10 minutes:

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 504 Server Time-out  
From: “asterisk” sip:asterisk@PUBLIC\_IP1;tag=as53f9153d  
To: sip:PUBLIC\_IP2;tag=e6842f9e  
CSeq: 102 OPTIONS  
Call-ID: 6104ea252bf5f4bd08ca42cc2161a25f@PUBLIC\_IP1:5060  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK59c4c3fa;rport=5060  
Content-Length: 0

\<-------------\>  
— (7 headers 0 lines) —

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 504 Server Time-out  
From: “asterisk” sip:asterisk@PUBLIC\_IP1;tag=as1c5b4c2d  
To: sip:PUBLIC\_IP2;tag=de04b3d9  
CSeq: 102 OPTIONS  
Call-ID: 140f7be164e08cb05f642567681e7627@PUBLIC\_IP1:5060  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK77c92927;rport=5060  
Content-Length: 0

\<-------------\>  
— (7 headers 0 lines) —

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 504 Server Time-out  
From: “asterisk” sip:asterisk@PUBLIC\_IP1;tag=as22944c06  
To: sip:PUBLIC\_IP2;tag=c4080e17  
CSeq: 102 OPTIONS  
Call-ID: 651090f7788b27643994052f1f25a793@PUBLIC\_IP1:5060  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK6e59ed3e;rport=5060  
Content-Length: 0

\<-------------\>  
— (7 headers 0 lines) —  
[Jan 21 01:36:35] NOTICE[24659]: chan\_sip.c:12596 sip\_reregister: – Re-registration for MY\_SIP\_USER@PUBLIC\_IP2  
REGISTER 11 headers, 0 lines  
Reliably Transmitting (NAT) to PUBLIC\_IP2:5060:  
REGISTER sip:PUBLIC\_IP2 SIP/2.0  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK293bed5f;rport  
Max-Forwards: 70  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as4f868f66  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
CSeq: 106 REGISTER  
User-Agent: Asterisk PBX 1.8.7.0  
Authorization: Digest username=“MY\_SIP\_USER”, realm=“huawei”, algorithm=MD5, uri=“sip:sip:huawei.com”, nonce=“66144d55e6082c3b11654170c03875ff”, response="16a8f2dc9ee6329e87b7ba8a434521bf"  
Expires: 400  
Contact: sip:s@PUBLIC\_IP1:5060  
Content-Length: 0

* * *

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 401 Unauthorized  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as4f868f66  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=6e47ca75  
CSeq: 106 REGISTER  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK293bed5f;rport=5060  
WWW-Authenticate: Digest realm=“huawei”,nonce=“fa4ae14d4be36ce4694ccbe449ce85eb”,domain=“sip:huawei.com”,stale=false,algorithm=MD5  
Content-Length: 0

\<-------------\>  
— (8 headers 0 lines) —  
esponding to challenge, registration to domain/host name PUBLIC\_IP2  
REGISTER 11 headers, 0 lines  
Reliably Transmitting (NAT) to PUBLIC\_IP2:5060:  
REGISTER sip:PUBLIC\_IP2 SIP/2.0  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK49208ad2;rport  
Max-Forwards: 70  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as1f615d82  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
CSeq: 107 REGISTER  
User-Agent: Asterisk PBX 1.8.7.0  
Authorization: Digest username=“MY\_SIP\_USER”, realm=“huawei”, algorithm=MD5, uri=“sip:sip:huawei.com”, nonce=“fa4ae14d4be36ce4694ccbe449ce85eb”, response="87157993fc36756133d40d40dfc81bb1"  
Expires: 400  
Contact: sip:s@PUBLIC\_IP1:5060  
Content-Length: 0

* * *

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 200 OK  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as1f615d82  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=467a4d0a  
CSeq: 107 REGISTER  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK49208ad2;rport=5060  
Contact: sip:MY\_SIP\_USER@PUBLIC\_IP1:5060;user=phone;expires=400  
Content-Length: 0

\<-------------\>  
— (8 headers 0 lines) —  
Scheduling destruction of SIP dialog ‘1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3’ in 32000 ms (Method: REGISTER)  
[Jan 21 01:36:36] NOTICE[24659]: chan\_sip.c:20148 handle\_response\_register: Outbound Registration: Expiry for PUBLIC\_IP2 is 120 sec (Scheduling reregistration in 105 s)

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 504 Server Time-out  
From: “asterisk” sip:asterisk@PUBLIC\_IP1;tag=as3789832a  
To: sip:PUBLIC\_IP2;tag=b12c2ef4  
CSeq: 102 OPTIONS  
Call-ID: 6773c5120a8ed73602015a5d0092c5b3@PUBLIC\_IP1:5060  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK070a56b8;rport=5060  
Content-Length: 0

\<-------------\>  
— (7 headers 0 lines) —

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 504 Server Time-out  
From: “asterisk” sip:asterisk@PUBLIC\_IP1;tag=as4ca08ece  
To: sip:PUBLIC\_IP2;tag=9e46810d  
CSeq: 102 OPTIONS  
Call-ID: 4cfe47cb087ba67e303cd8e3238fe77e@PUBLIC\_IP1:5060  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK716cef3d;rport=5060  
Content-Length: 0

\<-------------\>  
— (7 headers 0 lines) —

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>  
Really destroying SIP dialog ‘1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3’ Method: REGISTER

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 504 Server Time-out  
From: “asterisk” sip:asterisk@PUBLIC\_IP1;tag=as7e126fe6  
To: sip:PUBLIC\_IP2;tag=cc860e1d  
CSeq: 102 OPTIONS  
Call-ID: 0fd982de392690130c0f15827b777ae3@PUBLIC\_IP1:5060  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK4ba64af6;rport=5060  
Content-Length: 0

\<-------------\>  
— (7 headers 0 lines) —

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>  
[Jan 21 01:38:21] NOTICE[24659]: chan\_sip.c:12596 sip\_reregister: – Re-registration for MY\_SIP\_USER@PUBLIC\_IP2  
REGISTER 11 headers, 0 lines  
Reliably Transmitting (NAT) to PUBLIC\_IP2:5060:  
REGISTER sip:PUBLIC\_IP2 SIP/2.0  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK51298ac5;rport  
Max-Forwards: 70  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as70b002d0  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
CSeq: 108 REGISTER  
User-Agent: Asterisk PBX 1.8.7.0  
Authorization: Digest username=“MY\_SIP\_USER”, realm=“huawei”, algorithm=MD5, uri=“sip:sip:huawei.com”, nonce=“fa4ae14d4be36ce4694ccbe449ce85eb”, response="87157993fc36756133d40d40dfc81bb1"  
Expires: 400  
Contact: sip:s@PUBLIC\_IP1:5060  
Content-Length: 0

* * *

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 401 Unauthorized  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as70b002d0  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=3a2f072c  
CSeq: 108 REGISTER  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK51298ac5;rport=5060  
WWW-Authenticate: Digest realm=“huawei”,nonce=“4c66637a2bcb61fc6f6c78ed550b8f1c”,domain=“sip:huawei.com”,stale=false,algorithm=MD5  
Content-Length: 0

\<-------------\>  
— (8 headers 0 lines) —  
esponding to challenge, registration to domain/host name PUBLIC\_IP2  
REGISTER 11 headers, 0 lines  
Reliably Transmitting (NAT) to PUBLIC\_IP2:5060:  
REGISTER sip:PUBLIC\_IP2 SIP/2.0  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK2c0820a4;rport  
Max-Forwards: 70  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as1374b4d4  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
CSeq: 109 REGISTER  
User-Agent: Asterisk PBX 1.8.7.0  
Authorization: Digest username=“MY\_SIP\_USER”, realm=“huawei”, algorithm=MD5, uri=“sip:sip:huawei.com”, nonce=“4c66637a2bcb61fc6f6c78ed550b8f1c”, response="667668a0eb94260d3638e34d0b978a8b"  
Expires: 400  
Contact: sip:s@PUBLIC\_IP1:5060  
Content-Length: 0

* * *

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 200 OK  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as1374b4d4  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=11ce9527  
CSeq: 109 REGISTER  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK2c0820a4;rport=5060  
Contact: sip:MY\_SIP\_USER@PUBLIC\_IP1:5060;user=phone;expires=400  
Content-Length: 0

\<-------------\>  
— (8 headers 0 lines) —  
Scheduling destruction of SIP dialog ‘1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3’ in 32000 ms (Method: REGISTER)  
[Jan 21 01:38:21] NOTICE[24659]: chan\_sip.c:20148 handle\_response\_register: Outbound Registration: Expiry for PUBLIC\_IP2 is 120 sec (Scheduling reregistration in 105 s)

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>  
Really destroying SIP dialog ‘1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3’ Method: REGISTER

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>  
[Jan 21 01:40:06] NOTICE[24659]: chan\_sip.c:12596 sip\_reregister: – Re-registration for MY\_SIP\_USER@PUBLIC\_IP2  
REGISTER 11 headers, 0 lines  
Reliably Transmitting (NAT) to PUBLIC\_IP2:5060:  
REGISTER sip:PUBLIC\_IP2 SIP/2.0  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK6acfb20b;rport  
Max-Forwards: 70  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as15f5003b  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
CSeq: 110 REGISTER  
User-Agent: Asterisk PBX 1.8.7.0  
Authorization: Digest username=“MY\_SIP\_USER”, realm=“huawei”, algorithm=MD5, uri=“sip:sip:huawei.com”, nonce=“4c66637a2bcb61fc6f6c78ed550b8f1c”, response="667668a0eb94260d3638e34d0b978a8b"  
Expires: 400  
Contact: sip:s@PUBLIC\_IP1:5060  
Content-Length: 0

* * *

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 401 Unauthorized  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as15f5003b  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=8ed83352  
CSeq: 110 REGISTER  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK6acfb20b;rport=5060  
WWW-Authenticate: Digest realm=“huawei”,nonce=“0aeeb88876091fc5d067e4a837ca91b3”,domain=“sip:huawei.com”,stale=false,algorithm=MD5  
Content-Length: 0

\<-------------\>  
— (8 headers 0 lines) —  
esponding to challenge, registration to domain/host name PUBLIC\_IP2  
REGISTER 11 headers, 0 lines  
Reliably Transmitting (NAT) to PUBLIC\_IP2:5060:  
REGISTER sip:PUBLIC\_IP2 SIP/2.0  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK4b2746aa;rport  
Max-Forwards: 70  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as6f1c30b6  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
CSeq: 111 REGISTER  
User-Agent: Asterisk PBX 1.8.7.0  
Authorization: Digest username=“MY\_SIP\_USER”, realm=“huawei”, algorithm=MD5, uri=“sip:sip:huawei.com”, nonce=“0aeeb88876091fc5d067e4a837ca91b3”, response="cffabf0c71baef40feccb5f1a40322f2"  
Expires: 400  
Contact: sip:s@PUBLIC\_IP1:5060  
Content-Length: 0

* * *

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 200 OK  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as6f1c30b6  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=57048d09  
CSeq: 111 REGISTER  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK4b2746aa;rport=5060  
Contact: sip:MY\_SIP\_USER@PUBLIC\_IP1:5060;user=phone;expires=400  
Content-Length: 0

\<-------------\>  
— (8 headers 0 lines) —  
Scheduling destruction of SIP dialog ‘1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3’ in 32000 ms (Method: REGISTER)  
[Jan 21 01:40:06] NOTICE[24659]: chan\_sip.c:20148 handle\_response\_register: Outbound Registration: Expiry for PUBLIC\_IP2 is 120 sec (Scheduling reregistration in 105 s)

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>  
Really destroying SIP dialog ‘1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3’ Method: REGISTER

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>  
[Jan 21 01:41:51] NOTICE[24659]: chan\_sip.c:12596 sip\_reregister: – Re-registration for MY\_SIP\_USER@PUBLIC\_IP2  
REGISTER 11 headers, 0 lines  
Reliably Transmitting (NAT) to PUBLIC\_IP2:5060:  
REGISTER sip:PUBLIC\_IP2 SIP/2.0  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK4d80432b;rport  
Max-Forwards: 70  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as4bf7bc09  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
CSeq: 112 REGISTER  
User-Agent: Asterisk PBX 1.8.7.0  
Authorization: Digest username=“MY\_SIP\_USER”, realm=“huawei”, algorithm=MD5, uri=“sip:sip:huawei.com”, nonce=“0aeeb88876091fc5d067e4a837ca91b3”, response="cffabf0c71baef40feccb5f1a40322f2"  
Expires: 400  
Contact: sip:s@PUBLIC\_IP1:5060  
Content-Length: 0

* * *

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 401 Unauthorized  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as4bf7bc09  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=2846a424  
CSeq: 112 REGISTER  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK4d80432b;rport=5060  
WWW-Authenticate: Digest realm=“huawei”,nonce=“7f36dccd1bb96ec168383b1f99c7e7e6”,domain=“sip:huawei.com”,stale=false,algorithm=MD5  
Content-Length: 0

\<-------------\>  
— (8 headers 0 lines) —  
esponding to challenge, registration to domain/host name PUBLIC\_IP2  
REGISTER 11 headers, 0 lines  
Reliably Transmitting (NAT) to PUBLIC\_IP2:5060:  
REGISTER sip:PUBLIC\_IP2 SIP/2.0  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK4a06a2d1;rport  
Max-Forwards: 70  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as5cb26694  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
CSeq: 113 REGISTER  
User-Agent: Asterisk PBX 1.8.7.0  
Authorization: Digest username=“MY\_SIP\_USER”, realm=“huawei”, algorithm=MD5, uri=“sip:sip:huawei.com”, nonce=“7f36dccd1bb96ec168383b1f99c7e7e6”, response="d92b507ceff746c70de7633e64abf8ac"  
Expires: 400  
Contact: sip:s@PUBLIC\_IP1:5060  
Content-Length: 0

* * *

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 200 OK  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as5cb26694  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=4fdcd622  
CSeq: 113 REGISTER  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK4a06a2d1;rport=5060  
Contact: sip:MY\_SIP\_USER@PUBLIC\_IP1:5060;user=phone;expires=400  
Content-Length: 0

\<-------------\>  
— (8 headers 0 lines) —  
Scheduling destruction of SIP dialog ‘1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3’ in 32000 ms (Method: REGISTER)  
[Jan 21 01:41:51] NOTICE[24659]: chan\_sip.c:20148 handle\_response\_register: Outbound Registration: Expiry for PUBLIC\_IP2 is 120 sec (Scheduling reregistration in 105 s)

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>  
Really destroying SIP dialog ‘1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3’ Method: REGISTER

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>  
[Jan 21 01:43:36] NOTICE[24659]: chan\_sip.c:12596 sip\_reregister: – Re-registration for MY\_SIP\_USER@PUBLIC\_IP2  
REGISTER 11 headers, 0 lines  
Reliably Transmitting (NAT) to PUBLIC\_IP2:5060:  
REGISTER sip:PUBLIC\_IP2 SIP/2.0  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK3c211459;rport  
Max-Forwards: 70  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as5697de04  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
CSeq: 114 REGISTER  
User-Agent: Asterisk PBX 1.8.7.0  
Authorization: Digest username=“MY\_SIP\_USER”, realm=“huawei”, algorithm=MD5, uri=“sip:sip:huawei.com”, nonce=“7f36dccd1bb96ec168383b1f99c7e7e6”, response="d92b507ceff746c70de7633e64abf8ac"  
Expires: 400  
Contact: sip:s@PUBLIC\_IP1:5060  
Content-Length: 0

* * *

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 401 Unauthorized  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as5697de04  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=9e5f93e6  
CSeq: 114 REGISTER  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK3c211459;rport=5060  
WWW-Authenticate: Digest realm=“huawei”,nonce=“6a6eb619468f3ac5172b44f373b4208a”,domain=“sip:huawei.com”,stale=false,algorithm=MD5  
Content-Length: 0

\<-------------\>  
— (8 headers 0 lines) —  
esponding to challenge, registration to domain/host name PUBLIC\_IP2  
REGISTER 11 headers, 0 lines  
Reliably Transmitting (NAT) to PUBLIC\_IP2:5060:  
REGISTER sip:PUBLIC\_IP2 SIP/2.0  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK7153ad3b;rport  
Max-Forwards: 70  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as11bb64a5  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
CSeq: 115 REGISTER  
User-Agent: Asterisk PBX 1.8.7.0  
Authorization: Digest username=“MY\_SIP\_USER”, realm=“huawei”, algorithm=MD5, uri=“sip:sip:huawei.com”, nonce=“6a6eb619468f3ac5172b44f373b4208a”, response="2fb32a1a5aff97cfadde074e9e8fa7a2"  
Expires: 400  
Contact: sip:s@PUBLIC\_IP1:5060  
Content-Length: 0

* * *

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
SIP/2.0 200 OK  
From: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=as11bb64a5  
To: sip:MY\_SIP\_USER@PUBLIC\_IP2;tag=12fbbe61  
CSeq: 115 REGISTER  
Call-ID: 1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3  
Via: SIP/2.0/UDP PUBLIC\_IP1:5060;branch=z9hG4bK7153ad3b;rport=5060  
Contact: sip:MY\_SIP\_USER@PUBLIC\_IP1:5060;user=phone;expires=400  
Content-Length: 0

\<-------------\>  
— (8 headers 0 lines) —  
Scheduling destruction of SIP dialog ‘1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3’ in 32000 ms (Method: REGISTER)  
[Jan 21 01:43:36] NOTICE[24659]: chan\_sip.c:20148 handle\_response\_register: Outbound Registration: Expiry for PUBLIC\_IP2 is 120 sec (Scheduling reregistration in 105 s)

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>  
Really destroying SIP dialog ‘1226b604535448df1baa1a0a0cf7f938@PUBLIC\_IP3’ Method: REGISTER

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

\<— SIP read from UDP:PUBLIC\_IP2:5060 —\>  
hello  
\<-------------\>

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [January 20, 2012, 10:45pm UTC](https://community.asterisk.org/t/sip-peer-problem/37960/10 "2012-01-20T22:45:39Z")

</div>

I think you may have the type of ISP that doesn’t want you to run servers, at least not on a cheap account, and deliberately makes changes to the dynamic address.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [January 21, 2012, 4:15pm UTC](https://community.asterisk.org/t/sip-peer-problem/37960/11 "2012-01-21T16:15:18Z")

</div>

I asked my provider about your idea, but they said that we don’t have this policy! And they didn’t know about the PUBLIC\_IP3!  
Also I have a question is there any way to separate asterisk server from soft-phone?! Why 3CX soft-phone works perfectly but asterisk no?!  
Is there any difference between packets that soft-phones sends to provider and asterisk packets?!  
Is there any solution that for example asterisk acts like a soft phone?
