[SR-Users] Substdef syntax change?

Daniel-Constantin Mierla miconda at gmail.com
Tue Sep 20 09:23:52 CEST 2022


Hello,

the syntax is flexible it terms of the delimiter character, being
borrowed from the sed tool. Practically you can replace / with any other
character to make it easier to write your substitution expression.

The ! is used for DBURL because there are / in the content (like:
mysql://...) which should be escaped (like: mysql:\/\/:...) if / would
be used as delimiter.

So, you can use whatever delimiter you want and should be fine, like:
"/regexp/subst/flags", "!regexp!subst!flags" or "ZregexpZsubstZflags".

Cheers,
Daniel

On 19.09.22 12:11, Fredrik Dahlgren wrote:
> Hi,
>
> I'm looking at a kamailio config where all substdef have the syntax
> "!regexp!subst!flags", "!DB_URL!db.example.com
> <http://db.example.com>!g" but i can't find this syntax in the
> documentation. It's currently running on a fairly modern 5.x version
> and as far as i know it has never been on 4.x or older.
>
> Does anyone know where this syntax is from and if it's
> possible/recommended to simply replace it with "/regexp/subst"?
>
> *Fredrik* *Dahlgren* | Senior SIP/VoIP Engineer
> fredrik.dahlgren at freespee.com |  LinkedIn
> <https://www.linkedin.com/company/freespee/> |  Twitter
> <https://twitter.com/freespee>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the sender!
> Edit mailing list options or unsubscribe:
>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Online
  Oct 10-13, 2022 (Europe Timezone)
  * https://www.asipto.com/sw/kamailio-advanced-training-online/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220920/cca81891/attachment.htm>


More information about the sr-users mailing list