[OpenSIPS-Users] Route_to_gw not pushing gw_id to the first index of avp
Patrick Wakano
pwakano at gmail.com
Wed Jul 1 17:41:27 CEST 2015
Hello Aron,
After calling is_from_gw("-1","i") I don't need to use the index, because
it is the only value hold by the avp, but later in my script, if I call
route_to_gw() and use $avp(dr_gw_id), it still has the value previously
pushed by is_from_gw(). Then to get the gw id pushed by route_to_gw() I
have either to use the avp index (e.g. $avp(dr_gw_id)[1]) or I
set $avp(dr_gw_id) to null before calling route_to_gw() (which is what I am
doing now).
On Wed, Jul 1, 2015 at 9:50 AM, Podrigal, Aron <aronp at guaranteedplus.com>
wrote:
> I guess pushing to the last index of the avp is what's expected.
>
> But how did you retrieve the gw_id from is_from_gw, did you use an
> explicit index?
> On Jul 1, 2015 8:16 AM, "Patrick Wakano" <pwakano at gmail.com> wrote:
>
>> Hello Opensips list,
>>
>> When using the route_to_gw() function, I noticed that the gw_id that is
>> pushed back to the avp wasn't matching the address actually selected by the
>> drouting engine.
>> After some investigation I noticed that earlier in my script I was
>> calling the is_from_gw() function with the 'i' flag which also pushes the
>> gw_id to the avp and this was the value I was seeing in my avp after
>> calling the route_to_gw().
>> By debuging with the avp_print() function I could see that the
>> route_to_gw() does not pushes the gw_id to first index of the avp, but to
>> the end of it. Any reason for that or is it a bug?
>>
>> Regards,
>>
>> Patrick
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150701/ef498f8d/attachment.htm>
More information about the Users
mailing list