[asterisk-dev] SIP NOTIFY failure, Asterisk 1.8.10-rc3

Karsten Wemheuer kwem at gmx.de
Thu Mar 1 07:06:25 CST 2012


Hi,

maybe I found a bug or I am doing something wrong. I use the following
scenario: SIP-Phones are registered at OpenSIPS which is installed on
the same machine than asterisk. SIP messages are sent from asterisk via
opensips to the phones. Asterisk is on UDP 25060, opensips uses udp
5060. All is working fine. 

When I trigger asterisk to sent out a SIP NOTIFY e.g. to resync a Snom
phone configuration, the following is happening (shortened to the
relevant parts):

Asterisk => Proxy
U 192.168.10.72:25060 -> 192.168.10.72:5060
NOTIFY sip:klaus at 192.168.10.72 SIP/2.0.
Via: SIP/2.0/UDP 192.168.10.72:0;branch=z9hG4bK13b70a26.
Max-Forwards: 70.
From: "asterisk" <sip:asterisk at 192.168.10.72>;tag=as581fd4d3.
To: <sip:klaus at 192.168.10.72>.
Contact: <sip:asterisk at 192.168.10.72:0>.
Call-ID: 04f1e1991a6a7fdf4e990b8a23a62537 at 192.168.10.72.
CSeq: 102 NOTIFY.
...

Proxy => Phone
U 192.168.10.72:5060 -> 192.168.10.222:2048
NOTIFY sip:klaus at 192.168.10.222:2048;line=gt3dnts7 SIP/2.0.
Via: SIP/2.0/UDP 192.168.10.72;branch=z9hG4bKda25.ad250867.0.
Via: SIP/2.0/UDP 192.168.10.72:0;branch=z9hG4bK13b70a26.
Max-Forwards: 69.
From: "asterisk" <sip:asterisk at 192.168.10.72>;tag=as581fd4d3.
To: <sip:klaus at 192.168.10.72>.
Contact: <sip:asterisk at 192.168.10.72:0>.
Call-ID: 04f1e1991a6a7fdf4e990b8a23a62537 at 192.168.10.72.
CSeq: 102 NOTIFY.
...

Phone => Proxy
U 192.168.10.222:2048 -> 192.168.10.72:5060
SIP/2.0 200 Ok.
Via: SIP/2.0/UDP 192.168.10.72;branch=z9hG4bKda25.ad250867.0.
Via: SIP/2.0/UDP 192.168.10.72:0;branch=z9hG4bK13b70a26.
From: "asterisk" <sip:asterisk at 192.168.10.72>;tag=as581fd4d3.
To: <sip:klaus at 192.168.10.72>.
Call-ID: 04f1e1991a6a7fdf4e990b8a23a62537 at 192.168.10.72.
CSeq: 102 NOTIFY.

=> Proxy did not sent the 200 OK to asterisk due to port setting ":0" in
Via-Header of the initial NOTIFY, I think. Asterisk repeats the notify
and times out the request after several repetitions.

I tracked down this in the code and found out, that the statement
        ast_sockaddr_stringify_remote(&p->ourip)
returns the weird port number of the headers (both, Via and Contact
header). 

I think, "ourip" is not initialized correctly. It should lead to the
string (in out case) 192.168.10.72:25060 and not 192.168.10.72:0.

Is it a bug or do I something wrong? Should I open a issue on jira?

Thanks,
Karsten




More information about the asterisk-dev mailing list