[SR-Users] Substitution of Contact Header

Mack Hendricks mack at dopensource.com
Mon Apr 6 14:54:00 CEST 2020


Hey All,

I always have issues with substituting out header values.  I’ve tried subst and subst_hf.   

Here is the value that I want to change out:

Contact: <sip:52.41.52.34:5060;line=sr-h06Cy7RYRFkYacM0a7epa7sVa7sVRcNCW7IbaGZ9RGlC>

 And this is what I want it to be

Contact: <sip:1313717555 at jump.dsiprouter.net <sip:1313717555 at jump.dsiprouter.net>;line=sr-h06Cy7RYRFkYacM0a7epa7sVa7sVRcNCW7IbaGZ9RGlC>

I’m using this 

subst('/^Contact: <sip:(.*);(.*)>$/Contact: <sip:1313717555 at jump.dsiprouter.net;\2>\r/ig’);

And it doesn’t work, but putting into a online regular expression tester it looks good as shown below.  Any ideas? 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200406/d246ca1a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.png
Type: image/png
Size: 141949 bytes
Desc: not available
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200406/d246ca1a/attachment.png>


More information about the sr-users mailing list