[SR-Users] Finding Destination IP:Port for 200 OK

SamyGo govoiper at gmail.com
Mon Aug 26 07:26:33 CEST 2013


Yes indeed it is everything that I wanted to get. Thanks alot for the quick
route.


On Sun, Aug 25, 2013 at 10:13 PM, Vitaliy Aleksandrov <
vitalik.voip at gmail.com> wrote:

>  AFAIK there is no any single pv that provides a destination for both sip
> message types (request/reply).
> As you can see from my example $sel(next_hop.host) contains dst only for
> sip requests. To know where kamailio is going to send
> a reply you can check the second VIA header parameters like received or
> host if received is not present.
>
> BTW after calling such a route $var(next_hop) or any other you want to use
> has what you need in a "single pv".
>
>  Thanks Vitaliy,
> That seems working, I am testing with it..it's great.
> Can I ask if there is any psuedo variable for this thing !
>
>  Best Regards,
> Sammy
>
>
>
> On Sat, Aug 24, 2013 at 3:10 PM, Vitaliy Aleksandrov <
> vitalik.voip at gmail.com> wrote:
>
>>  How about next config snippet:
>>
>> *route[GET_NEXT_HOP]**
>> **{**
>> **    $var(next_hop) = $null;**
>> **    **
>> **    if (is_request()) {**
>> **        $var(next_hop) = $sel(next_hop.host);**
>> **    } else if (is_reply()) {**
>> **         if ($sel(via[2].received) != $null)**
>> **            $var(next_hop) = $sel(via[2].received);**
>> **        else**
>> **            $var(next_hop) = $sel(via[2].host);**
>> **    }**
>> **}*
>>
>> If you need to know what next hop kamailio will use to forward current
>> sip message (request/reply) you can just call route(GET_NEXT_HOP) which
>> puts what you need into $var(next_hop).
>>
>>   Dear list,
>>
>>  Its just a little thing to ask but I somehow can't seem to figure out
>> which psuedo variable to use to find out where a particular 200 OK is
>> destined to go.
>>
>>  the scenario is I've multiple media servers in dispatcher and calls are
>> distributed. I need to capture a 200OK that is destined to go to a
>> particular ip!
>>
>>  I've tried using the dst_ip, $dd, $du but none of them are giving any
>> results for the 200 OK. I just need to know where do kamailio is going to
>> send this 200 since it is already a part of an on-going INVITE/call.
>>
>>  Thanks,
>> Sammy
>>
>>
>>
>>
>>  _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users at lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users at lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130825/ea71e46d/attachment-0001.html>


More information about the sr-users mailing list