[SR-Users] Text Operations on a Message
Alex Balashov
abalashov at evaristesys.com
Fri Aug 15 13:36:00 CEST 2014
Hello AliReza,
On 08/15/2014 12:13 AM, AliReza Khoshgoftar Monfared wrote:
> Now a general question ( or request for a word of advice :) ): if you
> have ultimate flexibility and want to send an integer from one proxy to
> another. What functions ( modules ) are the best to append and recover
> it? ( i don't care where it is appended, body or header, etc )
If you just want to send such values around in standard SIP requests,
i.e. insert them to an INVITE, I would say that the most canonical and
widespread way to do this is via custom SIP headers, e.g.
On the sender:
append_hf("X-Alireza-Rate: 172\r\n");
On the receiver:
if(is_present_hf("X-Alireza-Rate")) {
xlog("L_INFO", "Extracted rate is $hdr(X-Alireza-Rate)\n");
# Don't pass this header further upstream.
remove_hf("X-Alireza-Rate");
}
--
Alex Balashov - Principal
Evariste Systems LLC
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
Please be kind to the English language:
http://www.entrepreneur.com/article/232906
More information about the sr-users
mailing list