[SR-Users] is_first_hop() fails to detect 'myself' when using advertise

Sergiu Pojoga pojogas at gmail.com
Wed Oct 3 23:33:16 CEST 2018


Hi ppl,

If I add a FQDN advertise address to the listen statement, *is_first_hop()
<https://kamailio.org/docs/modules/4.3.x/modules/siputils.html#siputils.f.is_first_hop>*
seems to return FALSE no matter how I play with the listen and alias
settings.

listen=udp:1.1.1.1:5060 advertise sip.mydomain.net:5060
alias="sip.mydomain.net:5060"

This statement doesn't get executed in the *onreply_route*

*onreply_route[MANAGE_REPLY] {*

*if(is_first_hop())*

*set_contact_alias();  # contact alias doesn't get set?*

*}*

*is_first_hop()*
*"The function returns true if the proxy is first hop after the original
sender. For incoming SIP replies, it means that top Record-Route URI is
'myself' and source address is not matching it"*

*This is the reply.*
2018/10/03 17:03:38.276846 2.2.2.2:62033 -> 1.1.1.1:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP sip.mydomain.net:5060
;branch=z9hG4bK49b3.bfbe15.0;received=1.1.1.1
Via: SIP/2.0/UDP 10.10.10.10:5060;rport=5060;branch=z9hG4bK1af96136
*Record-Route*: <sip:sip.mydomain.net;lr=on;did=4cc.734>
Contact: <sip:888 at 10.17.0.35:62033>

Suggestions?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20181003/47670199/attachment.html>


More information about the sr-users mailing list