[OpenSIPS-Users] Access to parameters from generic headers

xaled xaled at web.de
Wed Apr 8 09:32:24 EST 2020


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




More information about the Users mailing list