[OpenSIPS-Users] Access to parameters from generic headers

xaled xaled at web.de
Wed Apr 8 12:10:25 EST 2020


Hi Bogdan, 

works perfectly, dunno why I did not find it earlier.

Thanks!

-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org] 
Sent: Wednesday, April 08, 2020 12:20 PM
To: OpenSIPS users mailling list <users at lists.opensips.org>; xaled <xaled at web.de>
Subject: Re: [OpenSIPS-Users] Access to parameters from generic headers

Hi,

Try to use the param transformation 
https://opensips.org/Documentation/Script-Tran-3-0#toc60

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit, Amsterdam, May 2020
   https://www.opensips.org/events/Summit-2020Amsterdam/

On 4/8/20 12:32 PM, xaled wrote:
> Hi,
>
> I'm having problems with accessing values of header parameters.  I tried to use regex to extract cause value from Reason header, but it does not work properly. I'm not an regex expert so the regex could wrong. It would be good to have a generic mechanism for this type of values extraction from header parameters.
>
> Reason: Q.850;cause=1;text="Unallocated (unassigned) number", SIP;cause=500;text="Server internal error"
>
> $var(cause_reg) = "/(.*)cause=(.*);(.*)/\2/i";
> $var(cause) = $(hdr(Reason){re.subst,$var(cause_reg)});
>
> I added a feature request some time ago for this issue:
> https://github.com/OpenSIPS/opensips/issues/1289
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users





More information about the Users mailing list