Matching plus sign in dialplan Regexp
Hello folks, I am actually using a regexp such as ^(\d{7,15})$ to route call to one of my gateway. My SIP clients have all their number registered with number such as +33123456789 Is there a way to treat the "+" and transform It in "00" at the level of FreeSwitch (I can do that at the client level, but you'll understand that It is easier to do on the server side). Thanks. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Gregober ---> PGP ID --> 0x1BA3C2FD bsd @at@ todoo.biz ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
hello, You can match the "+" sign using: \+ then you can replace the + for 00, check this example: http://wiki.freeswitch.org/wiki/Dialplan_XML#Example_4:_Adding_a_prefix make sure you spend some time understanding regexes, it will help you a lot! -milena On Tue, Sep 21, 2010 at 9:01 AM, bsd <bsd@todoo.biz> wrote:
Hello folks,
I am actually using a regexp such as ^(\d{7,15})$ to route call to one of my gateway. My SIP clients have all their number registered with number such as +33123456789
Is there a way to treat the "+" and transform It in "00" at the level of FreeSwitch (I can do that at the client level, but you'll understand that It is easier to do on the server side).
Thanks.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Gregober ---> PGP ID --> 0x1BA3C2FD bsd @at@ todoo.biz ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Thanks Milena, But my question was not about regexp, which I do understand, but about substitution in the context of FreeSwitch, which is not part of regexp as far as I can tell. ;-) Le 21 sept. 2010 à 17:44, Milena a écrit :
hello,
You can match the "+" sign using: \+ then you can replace the + for 00, check this example: http://wiki.freeswitch.org/wiki/Dialplan_XML#Example_4:_Adding_a_prefix
make sure you spend some time understanding regexes, it will help you a lot!
-milena
On Tue, Sep 21, 2010 at 9:01 AM, bsd <bsd@todoo.biz> wrote: Hello folks,
I am actually using a regexp such as ^(\d{7,15})$ to route call to one of my gateway. My SIP clients have all their number registered with number such as +33123456789
Is there a way to treat the "+" and transform It in "00" at the level of FreeSwitch (I can do that at the client level, but you'll understand that It is easier to do on the server side).
Thanks.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Gregober ---> PGP ID --> 0x1BA3C2FD bsd @at@ todoo.biz ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Gregober ---> PGP ID --> 0x1BA3C2FD bsd @at@ todoo.biz ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
You need to tell us what you want to transform, because transforming a registration username is useless. So I suppose you want to transform their caller-id. That would be: <extension name="normalize-callerid" continue="true"> <condition field="caller_id_number" expression="^\ +(33123456789)$"> <action application="set" data="effective_caller_id_number=00$1"/> </condition> </extension> David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 21/09/2010 à 16:01, bsd a écrit :
Hello folks,
I am actually using a regexp such as ^(\d{7,15})$ to route call to one of my gateway. My SIP clients have all their number registered with number such as +33123456789
Is there a way to treat the "+" and transform It in "00" at the level of FreeSwitch (I can do that at the client level, but you'll understand that It is easier to do on the server side).
Thanks.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Gregober ---> PGP ID --> 0x1BA3C2FD bsd @at@ todoo.biz ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
What I want is to transform : ^(\+\d{7,15})$ into smthg like : ^(00\d{7,15})$ So that any "+" sign will be transformed into "00" Thanks. Le 22 sept. 2010 à 00:31, David Ponzone a écrit :
You need to tell us what you want to transform, because transforming a registration username is useless. So I suppose you want to transform their caller-id. That would be:
<extension name="normalize-callerid" continue="true"> <condition field="caller_id_number" expression="^\+(33123456789)$"> <action application="set" data="effective_caller_id_number=00$1"/> </condition> </extension>
David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34
Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com
Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur.
Le 21/09/2010 à 16:01, bsd a écrit :
Hello folks,
I am actually using a regexp such as ^(\d{7,15})$ to route call to one of my gateway. My SIP clients have all their number registered with number such as +33123456789
Is there a way to treat the "+" and transform It in "00" at the level of FreeSwitch (I can do that at the client level, but you'll understand that It is easier to do on the server side).
Thanks.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Gregober ---> PGP ID --> 0x1BA3C2FD bsd @at@ todoo.biz ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Gregober ---> PGP ID --> 0x1BA3C2FD bsd @at@ todoo.biz ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
bsd, You missed a part of my e-mail and also the point on what David is asking...
then you can replace the + for 00, check this example: http://wiki.freeswitch.org/wiki/Dialplan_XML#Example_4:_Adding_a_prefix
in that example it tells you how to change the number you're bridging to. in David's example, it will change the caller_id_number. if you need to change some other variable, then you need to change caller_id_number to whatever you want to change. -milena On Wed, Sep 22, 2010 at 5:33 AM, bsd <bsd@todoo.biz> wrote:
So that any "+" sign will be transformed into "00"
Then read the page Milena gave you. Substitutions are all about regexp. You can also do it by modifying the example I sent you. David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 22/09/2010 à 12:33, bsd a écrit :
What I want is to transform :
^(\+\d{7,15})$
into smthg like :
^(00\d{7,15})$
So that any "+" sign will be transformed into "00"
Thanks.
Le 22 sept. 2010 à 00:31, David Ponzone a écrit :
You need to tell us what you want to transform, because transforming a registration username is useless. So I suppose you want to transform their caller-id. That would be:
<extension name="normalize-callerid" continue="true"> <condition field="caller_id_number" expression="^\ +(33123456789)$"> <action application="set" data="effective_caller_id_number=00$1"/> </condition> </extension>
David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34
Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com
Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur.
Le 21/09/2010 à 16:01, bsd a écrit :
Hello folks,
I am actually using a regexp such as ^(\d{7,15})$ to route call to one of my gateway. My SIP clients have all their number registered with number such as +33123456789
Is there a way to treat the "+" and transform It in "00" at the level of FreeSwitch (I can do that at the client level, but you'll understand that It is easier to do on the server side).
Thanks.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Gregober ---> PGP ID --> 0x1BA3C2FD bsd @at@ todoo.biz ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Gregober ---> PGP ID --> 0x1BA3C2FD bsd @at@ todoo.biz ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (3)
-
bsd
-
David Ponzone
-
Milena