[asterisk-bugs] [JIRA] (ASTERISK-26491) pjsip: PJSIP is confused by erroneous Contact header. chan_sip handles it fine.
Daniel Heckl (JIRA)
noreply at issues.asterisk.org
Thu Nov 17 11:13:10 CST 2016
[ https://issues.asterisk.org/jira/browse/ASTERISK-26491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=233811#comment-233811 ]
Daniel Heckl commented on ASTERISK-26491:
-----------------------------------------
Rusty, I have figured out the problem. On our router runs an SIP ALG (what was not known to me so far), which changes the private IP to the public IP. This affects only pjsip, because chan_sip uses our public ip. That means, our provider sends an OK with one Contact Header for the old public IP and another one with the new public IP. The SIP ALG changes both IP addresses to the same private IP, which causes the chaos.
So our provider and also asterisk does their jobs fine.
I cannot disable the SIP ALG in our provider. If I set external_signaling_address and external_media_address to a private IP outside of our private subnet, the SIP ALG does not change IPs any more. This is my personal, not very pretty workaround.
Alexei, I think an implementation of x-uid could be interesting for some people. Nevertheless, I would prefer a domain support for external_media_address (external_signaling_address has it already), so users behind an dynamic public IP could migrate from chan_sip to pjsip...
> pjsip: PJSIP is confused by erroneous Contact header. chan_sip handles it fine.
> -------------------------------------------------------------------------------
>
> Key: ASTERISK-26491
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-26491
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: pjproject/pjsip
> Affects Versions: 13.11.2
> Reporter: Daniel Heckl
> Assignee: Unassigned
> Severity: Minor
> Attachments: log.txt, pjsip-debug-log2.txt
>
>
> Our Asterisk is behind an NAT and has an public ip. Sometimes our public ip address changes. Asterisk sends an REGISTER all 480 seconds.
> If our public ip address changes and Asterisk sends an re-REGISTER, our provider sends an OK. But asterisk does not realize it. Instead asterisk sends multiple times a new REGISTER and gets always an OK. After some time it logs "res_pjsip_outbound_registration.c:761 schedule_retry: No response received". Why!? Asterisk received multiple times an OK!
> After some wait time it retries again, gets an 403 Forbidden from our provider and permanently stops outbound registration.
> Chan_sip handle properly this situation.
> Attached a log from the communication between asterisk and tel.t-online.de.
> I think the problem is that the OK from the provider contains following lines:
> Contact: <sip:0123456789 at 192.168.0.10:45060>;expires=480
> Contact: <sip:0123456789 at 192.168.0.10:45060>;expires=10
> Asterisk see the 10 seconds expiring Contact and schedules a new registration. But in reality the first Contact is "the new" one, this one is expiring in 480 seconds.
> Asterisk re-REGISTER till the second Contact is expired.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list