[OpenSIPS-Users] reason headers

Vlad Paiu vladpaiu at opensips.org
Wed Jan 4 12:15:38 CET 2012


Hello,

What you are doing is pretty unsafe.
Search and Replace do not work at header level, but will match any 
string within the SIP msg, such as a 'reason' URI parameter, or whatever 
else, so you might end up in overwriting something else.
The textops module has functions that operate at SIP header level.

Check is_present_hf [1], remove_hf [2] and append_hf [3]. So basically 
what you want to do is, if the header is present, get it's body, remove 
it, and add a new header, called differently, but with the same body as 
the previous one.

[1] http://www.opensips.org/html/docs/modules/devel/textops.html#id293261
[2] http://www.opensips.org/html/docs/modules/devel/textops.html#id293514
[3] http://www.opensips.org/html/docs/modules/devel/textops.html#id292953

Regards,

Vlad Paiu
OpenSIPS Developer


On 01/04/2012 11:21 AM, Jan D. wrote:
> Also a rewrite of a Reason header in route[0] is not possible:
>
> route[0]
> ...
> if(search("Reason"))
> {
>    replace("Reason", "ReasonIsRewrited");
> }
> ...
> Is this a special header?
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/reason-headers-tp7137781p7149721.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users



More information about the Users mailing list