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

Joel Serrano joel at textplus.com
Wed Oct 3 23:46:43 CEST 2018


I actually had this exact problem, and because I knew when I was first hop
and when not, I ended up adding if conditions to solve the problem. I would
love to know the answer to this too and the correct reason as to why it
happens and how to correct it.





On Wed, Oct 3, 2018 at 11:34 PM Sergiu Pojoga <pojogas at gmail.com> wrote:

> 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.
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20181003/dd26d09c/attachment.html>


More information about the sr-users mailing list