[Freeswitch-users] dialplan - expression matching and variable - 2nd try

Weigel, Stefan Stefan.Weigel at allianz-warranty.com
Fri Jan 21 16:45:27 MSK 2011


Hi David,

got it! I forgot about the multiple ‘()’ leading to $1, $2 .. $n. I was always using $1, so in some cases it was empty. Dooh..


Thanks!


Best regards

Stefan

Stefan Weigel
Advanced IT-Professional
Tel.: +49 89 2000 48 975
Fax: +49 89 2000 48 566
eMail: Stefan.Weigel at allianz-warranty.com<mailto:Stefan.Weigel at allianz-warranty.com>
Allianz Automotive Services GmbH
Einsteinring 28
85609 Aschheim
Germany

http://www.allianz-warranty.com
Geschäftsführung: Andreas Rösing, Horst Ziegler
Amtsgericht München, HRB 175682
Für Umsatzsteuerzwecke: Ust-ID-Nr.: DE 262 617 720

Von: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] Im Auftrag von David Ponzone
Gesendet: Freitag, 21. Januar 2011 11:57
An: FreeSWITCH Users Help
Betreff: Re: [Freeswitch-users] dialplan - expression matching and variable - 2nd try

Stefan,

I am not sure to understand the difference between your 2 trials.
In both cases, you say $1 is empty, so I am not sure what is working in test 2.
Also, you should tell us what number you call to test (500 or 600).

Finally, if you right a regexp, every () group you define will be used to populate $1, $2, etc...
So in:
^(500)$|^(600)$
$1 will contain 500 if you call 500 and then $2 will be empty
$1 will be empty and $2 will contain 600 if it matches

You should write:
^(500|600)$

David Ponzone  Direction Technique
email: david.ponzone at ipeva.fr<mailto:david.ponzone at 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<BLOCKED::http://www.ipeva.fr/>  -   www.ipeva-studio.com<BLOCKED::http://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/01/2011 à 11:13, Weigel, Stefan a écrit :


Hi all,

sorry for the first message, I hit the wrong keys an Outlook sent the message…once again:


why is the following not working:


  <condition field="destination_number" expression="^(500)$|^(600)$">
    <action application="set" data="dialed_number=$1"/> <-- $1 is empty

when using the above expression, $1 is empty.

If I do it like this


  <condition field="destination_number" expression="^(5\d\d)$|^(6\d\d)$">
    <action application="set" data="dialed_number=$1"/> <-- $1 is empty

It’s working. I don’t understand why.


Thanks in advance and best regards,

Stefan
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110121/faa5aa92/attachment-0001.html 


More information about the FreeSWITCH-users mailing list