[SR-Users] Substitution of Contact Header
Alex Balashov
abalashov at evaristesys.com
Tue Apr 7 13:12:59 CEST 2020
Again, the question has to be asked: why do you want to rewrite the Contact header? And is there a better way to accomplish what you are trying to accomplish?
Contact is constructed by the endpoints, not the proxy. Touching it is almost never a good idea.
Where Contact is statefully rewritten by the topology hiding modules, touching it is also not a good idea.
It’s just not a good idea.
—
Sent from mobile, with due apologies for brevity and errors.
> On Apr 7, 2020, at 2:29 AM, Mack Hendricks <mack at dopensource.com> wrote:
>
>
> 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;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?
>
> <PastedGraphic-1.png>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200407/d66f2678/attachment.html>
More information about the sr-users
mailing list