[Spce-user] [EXTERNAL] Rewrite Rule Set number manipulation question

Marco Capetta mcapetta at sipwise.com
Mon Jul 15 03:50:15 EDT 2024


Hi Edo,

Rewriting Rules are the thing to use in cases like this one.
You can also use some online tools like https://regex101.com/ to tests your
regex.

I think in your case you need something like this:
match: ^99888([0-9]+)$
replace: \1

Cheers
Marco

On Wed, Jul 10, 2024 at 6:38 PM Edo <edo.ekunwe at gmail.com> wrote:

> Hi All,
>
> I am looking for examples on the scenario below
>
> *********************
>
> I am trying to configure the system to implement tech prefixes for
> different products. This is essentially a routing implementation.
>
>
> Scenario:
>
>
> I have 3 flavors of products that can be accessed using peer-specific
> prefixes, eg 99222 to product 1, 99555 to product 2 and 99888 to product 3
>
>
> A call comes in from Peer A with 99222e164 number, the incoming filter for
> the peer has a line item to accept this call, a fee is applied to this call
> then routed to another Peer B for termination. Before it is sent off to
> Peer B, the product prefix is stripped off then sent to the terminating
> Peer B (who does not know anything about the 99222 prefix but it may also
> request a prefix as well) e.g. change 99222e164 to 2114e164 before sending
> it to Peer B or just send e164 to Peer B — I will like to have the
> configuration example for both scenarios for sending to Peer B.
>
> ********************
>
> I know the Rewrite Rule Sets can help me do the number manipulations but
> the examples they have are just too overly permissive for me e.g.
> ^([0-9]+)$ masks for ALL numbers....
>
> I tried using ^(99888[0-9]+)$ to mask for that particular prefix but do
> not know how to strip the first 5 numbers before sending it out. The only
> example I have is how to ADD numbers before sending it out like Replacement
> pattern "XXXXX\1" adds XXXXX to the front of the number and sends out.. If
> I wanted to add the XXXXX to the end of the e164 I do not know how to do
> that or if I wanted to strip 99888 from the number then add XXXXX to the
> front, I don't know how to do that..
>
> I also tried ^(99888)([0-9]+)$ with a Replacement pattern of "\2" with no
> success, also tried replacement pattern of "99888\2" with no success as
> well.
>
> Any ideas?
>
> Thanks
>
> --
> -----
> Ekunwe
> Tel: 601.497.3932
> --
> Spce-user mailing list
> Spce-user at lists.sipwise.com
> http://lists.sipwise.com/mailman/listinfo/spce-user_lists.sipwise.com
>


-- 

Sipwise GmbH | an Alcatel-Lucent Company
Leonard-Bernstein-Straße 10 | 1220 Wien
Email: invoice at sipwise.com <gfuchs at sipwise.com>
Website: https://www.sipwise.com

Particulars according Austrian Companies Code paragraph 14
Geschäftsführer: DI Dr. Gernot Fuchs      Sitz: Wien             FG:
Landesgericht Wien              FN: 305595f
Die übermittelten Informationen sind ausschließlich dem Empfänger
vorbehalten und können vertrauliches oder privilegiertes Material
enthalten. Ein Gebrauch, Weiterleitung oder Verbreitung in jeglicher Form
seitens Dritter ist nicht gestattet. Sollten Sie diese Nachricht irrtümlich
erhalten haben, bitten wir Sie, sich mit dem Absender in Verbindung zu
setzen und die Nachricht einschließlich der Anlagen zu löschen. Jegliche
nicht autorisierte Nutzung dieser E-Mail ist illegal.
Hinweis zum Datenschutz: Sipwise GmbH ist der Schutz Ihrer Daten wichtig.
Auch durch die Kommunikation per E-Mail werden personenbezogene Daten
ausgetauscht. Erfahren Sie mehr unter: www.sipwise.com

Managing Director: DI Dr. Gernot Fuchs     HQ: Vienna       FG: Vienna
Regional Court        FN: 305595f
Confidentially notice. This e-mail transmission may contain legally
privileged and/or confidential information. Please do not read it if you
are not the intended recipient(s). Any use, reproduction or disclosure by
any other person is prohibited. If you have received this e-mail in error,
please notify the sender and destroy the original transmission and its
attachments without reading or saving it in any manner. Any unauthorized
use of this e-mail is illegal.
Note on data protection: Sipwise GmbH attaches great importance to the
protection of your data. Personal data is also exchanged through
communication by e-mail. Learn more at: www.sipwise.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20240715/ed7c3d10/attachment.htm>


More information about the Spce-user mailing list