[OpenSIPS-Users] 3.1 - access Path and Via values from REGISTER

Mark Allen mark at allenclan.co.uk
Mon Aug 3 10:18:30 EST 2020


> If you want to see it, loopback the message.

Thanks. How do I do that?

On Mon, 3 Aug 2020 at 11:02, Johan De Clercq <Johan at democon.be> wrote:

> I think that you are right.
> If you want to see it, loopback the message.
>
> Op ma 3 aug. 2020 om 11:16 schreef Mark Allen <mark at allenclan.co.uk>:
>
>> Would I be right in thinking that the reason I cannot immediately see the
>> "path" value added by the add_path_received() call is because of how the
>> lumps system works - i.e.
>>
>>   "lumps are stored in a list, and are only applied
>>    after the OpenSIPS script is fully executed and
>>    before the SIP message is relayed. Because of
>>    this, changes done on a SIP message are not
>>    immediately reflected on the SIP message upon
>>    further inspection ( eg. Adding a new header from
>>    the script and then checking for the header's
>>    existence )."
>>
>> From: https://www.opensips.org/Documentation/Development-Manual
>>
>> On Thu, 30 Jul 2020 at 16:24, Mark Allen <mark at allenclan.co.uk> wrote:
>>
>>> Seeking to find a workaround for the problem I'm having with WebRTC and
>>> AOR throttling (
>>> http://lists.opensips.org/pipermail/users/2020-July/043542.html) I want
>>> to access the values of the "Via" and "Path" headers that are being passed
>>> to the registrar.
>>>
>>> Using sngrep on the OpenSIPS server I can see the REGISTER includes Path
>>> and Via headers. If I try to access them with  $(hdr(Path)[0])  or
>>>  $(hdr(Via)[0])  I get nothing, but I can access the values of all the
>>> other headers without any problem - e.g.  $(hdr(Authorization)[0]). What am
>>> I missing or is there another way to get the info used in the Via
>>> and particularly in creating the Path header values???
>>>
>>>   add_path_received();
>>>   xlog("!!!!!!!!!!!! $(hdr(Path)[0]) !!!!!!!!!!");
>>>   $avp(attr) = $(hdr(Path)[0]);
>>>   mid_registrar_save("location","p0v");
>>>
>>> The code gives an "attr" value in the "location" table of "NULL"
>>>
>>> /var/log/syslog shows:
>>>
>>>   Jul 30 16:13:17  /usr/sbin/opensips[27423]: !!!!!!!!!!!! <null>
>>> !!!!!!!!!!
>>>
>> _______________________________________________
>> 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/20200803/ceda4eb5/attachment.html>


More information about the Users mailing list