[Freeswitch-users] Routing with $1 variable

Peter P GMX Prometheus001 at gmx.net
Sun Oct 5 12:15:04 PDT 2008


That was the point, I missed the parantheses.

Thanks.


Anthony Minessale schrieb:
> did you wrap what you want to capture in parens ()
>
>
> On Fri, Oct 3, 2008 at 6:30 PM, Michael Collins
> <mcollins at fcnetwork.com <mailto:mcollins at fcnetwork.com>> wrote:
>
>     Regex 101: use parentheses to capture info in $1:
>
>     ^(234)$
>     $1 will = '231'
>
>     -MC
>
>     > -----Original Message-----
>     > From: freeswitch-users-bounces at lists.freeswitch.org
>     <mailto:freeswitch-users-bounces at lists.freeswitch.org>
>     [mailto:freeswitch- <mailto:freeswitch->
>     > users-bounces at lists.freeswitch.org
>     <mailto:users-bounces at lists.freeswitch.org>] On Behalf Of Peter P GMX
>     > Sent: Friday, October 03, 2008 4:14 PM
>     > To: freeswitch-users at lists.freeswitch.org
>     <mailto:freeswitch-users at lists.freeswitch.org>
>     > Subject: [Freeswitch-users] Routing with $1 variable
>     >
>     > Today I had a strange behaviour:
>     > I am routing calls to an Asterisk PBX. It has a very sophisticated
>     > dynamic least cost router built in - so I use it to terminate mobile
>     and
>     > international calls.
>     >
>     > For a first test I created a dialplan which checks for ^231$ in the
>     > dialled number and then routes the call to $1/asterisk.pbx.
>     > It didn't work. Grepping the SIP traffic I could see that Freeswitch
>     > makes an invite $1 at asterisk.pbx. Yes it's $1 in the SIP message.
>     >
>     > Second I checked for the mobile number using ^(01[6-7]\d{4,13})$ in
>     the
>     > dialled number and then route the call to $1/asterisk.pbx.
>     > This works.
>     >
>     > I am confused as in the second case $1 is translated to the dialled
>     > number and in the frist case not.
>     >
>     > Anybody has a clue?
>     >
>     > Best regards
>     > Peter
>     >
>     >
>     > _______________________________________________
>     > 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
>
>     _______________________________________________
>     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
>
>
>
>
> -- 
> Anthony Minessale II
>
> FreeSWITCH http://www.freeswitch.org/
> ClueCon http://www.cluecon.com/
>
> AIM: anthm
> MSN:anthony_minessale at hotmail.com
> <mailto:MSN%3Aanthony_minessale at hotmail.com>
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
> <mailto:PAYPAL%3Aanthony.minessale at gmail.com>
> IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org
> <mailto:sip%3A888 at conference.freeswitch.org>
> iax:guest at conference.freeswitch.org/888
> <http://iax:guest@conference.freeswitch.org/888>
> googletalk:conf+888 at conference.freeswitch.org
> <mailto:googletalk%3Aconf%2B888 at conference.freeswitch.org>
> pstn:213-799-1400
> ------------------------------------------------------------------------
>
> _______________________________________________
> Freeswitch-users mailing list
> 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
>   




More information about the FreeSWITCH-users mailing list