[SR-Users] question about replace_body_all

Wilkins, Steve swwilkins at mitre.org
Sat Dec 1 18:27:39 CET 2018


I am attempting to change the Message Body of an SIP message using replace_body_all;  I want to replace all attributes that start with  rtcp.
Here is my code =>

replace_body_all("rtcp:{1}[0-9]{5,}", newstring), and I call msg_apply_changes() after this call. Note that I verified that the regex is working using search.

The problem is that nothing gets changed. However, what I do get is a new string at the bottom of the Message Body with my newstring concatenated three times, which happens to be the number of times that rtcp occurs in the Message Body.

Note, I am doing this so that I can add the IP address to the rtcp attribute because this is required by a Provider.

Any ideas?

Thank you,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20181201/d693d4d7/attachment.html>

More information about the sr-users mailing list