Hello Daniel,
thank you for your reply.
I changed the line mentioned to t_uac_send("NOTIFY", "$(ct{s.substr,1,0}{s.striptail,1})", "$su", "192.168.1.156","Call-ID: $hdr(Call-ID)\r\nSubscription-State: terminated;reason=timeout\r\nEvent: $hdr(Event)\r\nContent-Type: application/url\r\nFrom: $fU\r\nTo: $hdr(From)", "http://server.conf/settings-%7Bmac%7D http://server.conf/settings-%7Bmac%7D");
the result is: 3) Call-ID is fine now ; Problem solved :-)
1) The Via IP is now changed to the IP and port of the server, but not to the IP of the phone.
2) The sending interface / IP is not correct: It now sends _only_ from the wrong IP !! As a result, it repeats sending the NOTIFY-message over and over again since the message does not get to the phone ... Please see the starting of the SIP-traffic below
U 192.168.1.152:57283 -> 224.0.1.75:5060 #53 SUBSCRIBE sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan SIP/2.0. Via: SIP/2.0/UDP 192.168.1.152:57283;rport. From: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>;tag=176419003. To: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>. Call-ID: 277773303@192.168.1.152 mailto:277773303@192.168.1.152. CSeq: 1 SUBSCRIBE. Event: ua-profile;profile-type="device";vendor="snom";model="snom760";version="8.9.3.80". Expires: 0. Accept: application/url. Contact: <sip:192.168.1.152:57283 sip:192.168.1.152:57283>. User-Agent: snom760/8.9.3.80. Content-Length: 0. .
# U 192.168.1.156:5060 -> 192.168.1.152:57283 #54 SIP/2.0 200 OK. Via: SIP/2.0/UDP 192.168.1.152:57283;rport=57283;received=192.168.1.152. From: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>;tag=176419003. To: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>;tag=fb721cde02dffb6bb099728401306798.1182. Call-ID: 277773303@192.168.1.152 mailto:277773303@192.168.1.152. CSeq: 1 SUBSCRIBE. Server: kamailio (5.2.5 (x86_64/linux)). Content-Length: 0. .
# U 172.23.56.1:5060 -> 192.168.1.152:57283 #55 NOTIFY sip:192.168.1.152:57283 sip:192.168.1.152:57283 SIP/2.0. Via: SIP/2.0/UDP 192.168.1.156:5060;branch=z9hG4bKee8f.0ea476a1000000000000000000000000.0. To: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>;tag=176419003. From: <MAC%3a0004137120D8>;tag=da567df9df3ac234e43969a051db4641-9700. CSeq: 10 NOTIFY. Call-ID: 277773303@192.168.1.152 mailto:277773303@192.168.1.152. Max-Forwards: 70. Content-Length: 33. User-Agent: kamailio (5.2.5 (x86_64/linux)). Subscription-State: terminated;reason=timeout. Event: ua-profile;profile-type="device";vendor="snom";model="snom760";version="8.9.3.80". Content-Type: application/url. . http://server.conf/settings-%7Bmac%7D http://server.conf/settings-%7Bmac%7D # U 172.23.56.1:5060 -> 192.168.1.152:57283 #56 NOTIFY sip:192.168.1.152:57283 sip:192.168.1.152:57283 SIP/2.0. Via: SIP/2.0/UDP 192.168.1.156:5060;branch=z9hG4bKee8f.0ea476a1000000000000000000000000.0. To: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>;tag=176419003. From: <MAC%3a0004137120D8>;tag=da567df9df3ac234e43969a051db4641-9700. CSeq: 10 NOTIFY. Call-ID: 277773303@192.168.1.152 mailto:277773303@192.168.1.152. Max-Forwards: 70. Content-Length: 33. User-Agent: kamailio (5.2.5 (x86_64/linux)). Subscription-State: terminated;reason=timeout. Event: ua-profile;profile-type="device";vendor="snom";model="snom760";version="8.9.3.80". Content-Type: application/url. . http://server.conf/settings-%7Bmac%7D http://server.conf/settings-%7Bmac%7D # U 172.23.56.1:5060 -> 192.168.1.152:57283 #57 NOTIFY sip:192.168.1.152:57283 sip:192.168.1.152:57283 SIP/2.0. Via: SIP/2.0/UDP 192.168.1.156:5060;branch=z9hG4bKee8f.0ea476a1000000000000000000000000.0. To: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>;tag=176419003. From: <MAC%3a0004137120D8>;tag=da567df9df3ac234e43969a051db4641-9700. CSeq: 10 NOTIFY. Call-ID: 277773303@192.168.1.152 mailto:277773303@192.168.1.152. Max-Forwards: 70. Content-Length: 33. User-Agent: kamailio (5.2.5 (x86_64/linux)). Subscription-State: terminated;reason=timeout. Event: ua-profile;profile-type="device";vendor="snom";model="snom760";version="8.9.3.80". Content-Type: application/url. . http://server.conf/settings-%7Bmac%7D http://server.conf/settings-%7Bmac%7D # U 192.168.1.152:57283 -> 224.0.1.75:5060 #58 SUBSCRIBE sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan SIP/2.0. Via: SIP/2.0/UDP 192.168.1.152:57283;rport. From: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>;tag=1472545741. To: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>. Call-ID: 1886698335@192.168.1.152 mailto:1886698335@192.168.1.152. CSeq: 1 SUBSCRIBE. Event: ua-profile;profile-type="device";vendor="snom";model="snom760";version="8.9.3.80". Expires: 0. Accept: application/url. Contact: <sip:192.168.1.152:57283 sip:192.168.1.152:57283>. User-Agent: snom760/8.9.3.80. Content-Length: 0. .
# U 192.168.1.156:5060 -> 192.168.1.152:57283 #59 SIP/2.0 200 OK. Via: SIP/2.0/UDP 192.168.1.152:57283;rport=57283;received=192.168.1.152. From: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>;tag=1472545741. To: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>;tag=fb721cde02dffb6bb099728401306798.1182. Call-ID: 1886698335@192.168.1.152 mailto:1886698335@192.168.1.152. CSeq: 1 SUBSCRIBE. Server: kamailio (5.2.5 (x86_64/linux)). Content-Length: 0. .
# U 172.23.56.1:5060 -> 192.168.1.152:57283 #60 NOTIFY sip:192.168.1.152:57283 sip:192.168.1.152:57283 SIP/2.0. Via: SIP/2.0/UDP 192.168.1.156:5060;branch=z9hG4bKa0df.967a0433000000000000000000000000.0. To: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>;tag=1472545741. From: <MAC%3a0004137120D8>;tag=da567df9df3ac234e43969a051db4641-d106. CSeq: 10 NOTIFY. Call-ID: 1886698335@192.168.1.152 mailto:1886698335@192.168.1.152. Max-Forwards: 70. Content-Length: 33. User-Agent: kamailio (5.2.5 (x86_64/linux)). Subscription-State: terminated;reason=timeout. Event: ua-profile;profile-type="device";vendor="snom";model="snom760";version="8.9.3.80". Content-Type: application/url. . http://server.conf/settings-%7Bmac%7D http://server.conf/settings-%7Bmac%7D # U 172.23.56.1:5060 -> 192.168.1.152:57283 #61 NOTIFY sip:192.168.1.152:57283 sip:192.168.1.152:57283 SIP/2.0. Via: SIP/2.0/UDP 192.168.1.156:5060;branch=z9hG4bKa0df.967a0433000000000000000000000000.0. To: <sip:MAC%3a0004137120D8@lan sip:MAC%3a0004137120D8@lan>;tag=1472545741. From: <MAC%3a0004137120D8>;tag=da567df9df3ac234e43969a051db4641-d106. CSeq: 10 NOTIFY. Call-ID: 1886698335@192.168.1.152 mailto:1886698335@192.168.1.152. Max-Forwards: 70. Content-Length: 33. User-Agent: kamailio (5.2.5 (x86_64/linux)). Subscription-State: terminated;reason=timeout. Event: ua-profile;profile-type="device";vendor="snom";model="snom760";version="8.9.3.80". Content-Type: application/url. . http://server.conf/settings-%7Bmac%7D http://server.conf/settings-%7Bmac%7D #
(If I change the IP-parameter to "172.23.56.1" the resulting sending IP is unchanged!)
Hello,
On 30.03.20 18:41, Jan-Hendrik Dörner wrote:
OK.
Actually that is the correct value, Via is the address of the entity sending out the request. It is used to route the replies, so Via in Notify has to be the address of the kamailio server so the reply to it is sent by the phone back to Kamailio.
Can you try with full specs for socket, like "upd:IP:port"?
Cheers, Daniel
so I changed it to
t_uac_send("NOTIFY", "$(ct{s.substr,1,0}{s.striptail,1})", "$su", "udp:192.168.1.156:5060","Call-ID: $hdr(Call-ID)\r\nSubscription-State: terminated;reason=timeout\r\nEvent: $hdr(Event)\r\nContent-Type: application/url\r\nFrom: $fU\r\nTo: $hdr(From)", "http://server.conf/settings-%7Bmac%7D");
unfortunately the SIP - Pakets are still send from the wrong IP.
U 192.168.1.152:57145 -> 224.0.1.75:5060 #1 SUBSCRIBE sip:MAC%3a0004137120D8@lan SIP/2.0. Via: SIP/2.0/UDP 192.168.1.152:57145;rport. From: sip:MAC%3a0004137120D8@lan;tag=1881587606. To: sip:MAC%3a0004137120D8@lan. Call-ID: 1699827764@192.168.1.152. CSeq: 1 SUBSCRIBE. Event: ua-profile;profile-type="device";vendor="snom";model="snom760";version="8.9.3.80". Expires: 0. Accept: application/url. Contact: sip:192.168.1.152:57145. User-Agent: snom760/8.9.3.80. Content-Length: 0. .
# U 192.168.1.156:5060 -> 192.168.1.152:57145 #2 SIP/2.0 200 OK. Via: SIP/2.0/UDP 192.168.1.152:57145;rport=57145;received=192.168.1.152. From: sip:MAC%3a0004137120D8@lan;tag=1881587606. To: sip:MAC%3a0004137120D8@lan;tag=fb721cde02dffb6bb099728401306798.3eb0. Call-ID: 1699827764@192.168.1.152. CSeq: 1 SUBSCRIBE. Server: kamailio (5.2.5 (x86_64/linux)). Content-Length: 0. .
# U 172.23.56.1:5060 -> 192.168.1.152:57145 #3 NOTIFY sip:192.168.1.152:57145 SIP/2.0. Via: SIP/2.0/UDP 192.168.1.156:5060;branch=z9hG4bKdb57.88b81c37000000000000000000000000.0. To: sip:MAC%3a0004137120D8@lan;tag=1881587606. From: <MAC%3a0004137120D8>;tag=da567df9df3ac234e43969a051db4641-6c90. CSeq: 10 NOTIFY. Call-ID: 1699827764@192.168.1.152. Max-Forwards: 70. Content-Length: 33. User-Agent: kamailio (5.2.5 (x86_64/linux)). Subscription-State: terminated;reason=timeout. Event: ua-profile;profile-type="device";vendor="snom";model="snom760";version="8.9.3.80". Content-Type: application/url. . http://server.conf/settings-%7Bmac%7D # U 172.23.56.1:5060 -> 192.168.1.152:57145 #4 NOTIFY sip:192.168.1.152:57145 SIP/2.0. Via: SIP/2.0/UDP 192.168.1.156:5060;branch=z9hG4bKdb57.88b81c37000000000000000000000000.0. To: sip:MAC%3a0004137120D8@lan;tag=1881587606. From: <MAC%3a0004137120D8>;tag=da567df9df3ac234e43969a051db4641-6c90. CSeq: 10 NOTIFY. Call-ID: 1699827764@192.168.1.152. Max-Forwards: 70. Content-Length: 33. User-Agent: kamailio (5.2.5 (x86_64/linux)). Subscription-State: terminated;reason=timeout. Event: ua-profile;profile-type="device";vendor="snom";model="snom760";version="8.9.3.80". Content-Type: application/url. . http://server.conf/settings-%7Bmac%7D #
….
But what did help in this particular case is to change the order of the listen Interfaces:
From:
listen=udp:172.23.56.1:5060 udp:172.23.56.1:5060 advertise 192.168.1.156:5060 listen=udp:192.168.1.156:5060 udp:192.168.1.156:5060 advertise 192.168.1.156:5060 listen=tcp:127.0.0.1:5060
mcast="eth0" listen=udp:224.0.1.75:5060 udp:224.0.1.75:5060
To:
listen=udp:192.168.1.156:5060 udp:192.168.1.156:5060 advertise 192.168.1.156:5060 listen=udp:172.23.56.1:5060 udp:172.23.56.1:5060 advertise 192.168.1.156:5060 listen=tcp:127.0.0.1:5060
mcast="eth0" listen=udp:224.0.1.75:5060 udp:224.0.1.75:5060
Although this workaround works here, it is difficult in cases when sending events to different networks. (for example check-sync events).
So here is my insight to the problem:
Because the first listening interface is advertising the 192.168.1 interface, this one is used. If I change the order to
listen=udp:192.168.1.156:5060 advertise 192.168.1.156:5060 listen=udp:172.23.56.1:5060 advertise 192.168.1.156:5060 listen=tcp:127.0.0.1:5060
I can use both sockets as expected.
Ergo: Always use the primary / actual interface before the ones which only advertised it!
Indeed, the search of sockets is done by local address as well as advertised address. I want to add a new attribute to listen directives to give them a name (unique id), to be easier to specify which one should be used -- in my todo list for quite some time, but I didn't get the time for it.
Cheers, Daniel
On 31.03.20 10:54, Jan-Hendrik Dörner wrote: