[OpenSIPS-Users] openSIPS- Dialplan Manipulation Help

Ben Newlin Ben.Newlin at genesys.com
Wed Dec 4 09:36:11 EST 2019

That will certainly work and is very simple. If you really want to do it using the dialplan module, then you are looking to do “String Translation” as described in detail in Section of the module documentation [1]. In your case, something like:

  *   match_op = 1
  *   match_exp = “^0[0-9]{8}$"
  *   match_flags = 0
  *   subst_exp = “^(0[0-9]{8})$”
  *   repl_exp = "972\1"

[1] - https://opensips.org/html/docs/modules/3.0.x/dialplan.html#idp4838848

Ben Newlin

From: Users <users-bounces at lists.opensips.org> on behalf of Callum Guy <callum.guy at x-on.co.uk>
Reply-To: OpenSIPS users mailling list <users at lists.opensips.org>
Date: Wednesday, December 4, 2019 at 3:24 AM
To: VOIP Security <voip.security at protonmail.com>, OpenSIPS users mailling list <users at lists.opensips.org>
Subject: Re: [OpenSIPS-Users] openSIPS- Dialplan Manipulation Help

Why not just glue together the strings?

$var(a) = "972" + $rU;

Seems pretty effective to me :)

On Tue, 3 Dec 2019 at 22:02, VOIP Security via Users <users at lists.opensips.org<mailto:users at lists.opensips.org>> wrote:

I am struggling with openSIPS regex rules to append some prefix before regex. I have this regex rule setup for Israel numbers -

Matching Regular Expression -  ^0[0-9]{8}$

So this rule is catching all the 9 digits DID from my Israeli carrier but now I want to add 972 in front of any DID, for example DID - 021458547
After dp_translate I want to manipulate that DID and add 972 so new DID gonna be - 972021458547

Please help me setting up this dial plan rule. I will appreciate that.

Thanks and regards

Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>

[Image removed by sender.]

0333 332 0000  |  www.x-on.co.uk<http://www.x-on.co.uk>  |   [Image removed by sender.] <https://www.linkedin.com/company/x-on>   [Image removed by sender.] <https://www.facebook.com/XonTel>   [Image removed by sender.] <https://twitter.com/xonuk>

X-on is a trading name of Storacall Technology Ltd a limited company registered in England and Wales.
Registered Office : Avaland House, 110 London Road, Apsley, Hemel Hempstead, Herts, HP3 9SD. Company Registration No. 2578478.
The information in this e-mail is confidential and for use by the addressee(s) only. If you are not the intended recipient, please notify X-on immediately on +44(0)333 332 0000 and delete the
message from your computer. If you are not a named addressee you must not use, disclose, disseminate, distribute, copy, print or reply to this email. Views or opinions expressed by an individual
within this email may not necessarily reflect the views of X-on or its associated companies. Although X-on routinely screens for viruses, addressees should scan this email and any attachments
for viruses. X-on makes no representation or warranty as to the absence of viruses in this email or any attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20191204/e0cc7888/attachment-0001.html>

More information about the Users mailing list