variable not being replaced in dialplan
Good morning, i have the following entry in my dialplan to dialout using a gateway: <extension name="gw_outbound_call"> <condition field="destination_number" expression="[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=10000"/> <action application="bridge" data="sofia/gateway/gw/$1"/> </condition> </extension> the dialplan runs well and when FS has to bridge the call it opens a channel to "sofia/gateway/gw/$1", it does not replace the $1 by the actual number being dialed, i have the same in other parts of the dialplan and it works good, i can not find what i m doing wrong here, i would appreciate any hint about this issue. thanks!
Is there a reason you're not just doing <action application="bridge" data="sofia/gateway/gw/${destination_number}"/>
Hi thanks, i also tried as in the default configurations: <extension name="gw_outbound_call"> <condition field="destination_number" expression="^[\d]{7}?$"> <action application="export" data="dialed_extension=$1"/> <action application="set" data="effective_caller_id_number=1000"/> <action application="bridge" data="sofia/gateway/gw/${dialed_extension}"/> </condition> </extension> but still it replaces the ${dialed_extension} by $1 ... i have not tried what you suggest, i will try it but still cant find a reason why the above does not work ... thanks! ----------------------------------------
Date: Fri, 22 Jun 2012 17:15:32 +0100 From: alex@thewinelake.com To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] variable not being replaced in dialplan
Is there a reason you're not just doing
<action application="bridge" data="sofia/gateway/gw/${destination_number}"/>
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
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
Alex, thanks for your suggestion, that worked like a charm, i still have lots to learn, thanks very much!!! ----------------------------------------
From: jpablolorenzetti@hotmail.com To: freeswitch-users@lists.freeswitch.org Subject: RE: [Freeswitch-users] variable not being replaced in dialplan Date: Fri, 22 Jun 2012 17:09:19 +0000
Hi thanks, i also tried as in the default configurations:
<extension name="gw_outbound_call"> <condition field="destination_number" expression="^[\d]{7}?$"> <action application="export" data="dialed_extension=$1"/> <action application="set" data="effective_caller_id_number=1000"/> <action application="bridge" data="sofia/gateway/gw/${dialed_extension}"/> </condition> </extension>
but still it replaces the ${dialed_extension} by $1 ... i have not tried what you suggest, i will try it but still cant find a reason why the above does not work ... thanks!
----------------------------------------
Date: Fri, 22 Jun 2012 17:15:32 +0100 From: alex@thewinelake.com To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] variable not being replaced in dialplan
Is there a reason you're not just doing
<action application="bridge" data="sofia/gateway/gw/${destination_number}"/>
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
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
On Fri, Jun 22, 2012 at 03:57:59PM +0000, Juan Pablo L. wrote:
Good morning, i have the following entry in my dialplan to dialout using a gateway:
<extension name="gw_outbound_call"> <condition field="destination_number" expression="[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=10000"/> <action application="bridge" data="sofia/gateway/gw/$1"/> </condition> </extension>
the dialplan runs well and when FS has to bridge the call it opens a channel to "sofia/gateway/gw/$1", it does not replace the $1 by the actual number being dialed, i have the same in other parts of the dialplan and it works good, i can not find what i m doing wrong here, i would appreciate any hint about this issue.
You are not setting $1. <condition field="destination_number" expression="[\d]{7,}?$"> should be: <condition field="destination_number" expression="([\d]{7,}?)$"> take note of the parentheses () which set the $1 variable. Regards,
thank you very much, that worked too, i m learning and still a lot ahead but thanks for your support. ----------------------------------------
Date: Fri, 22 Jun 2012 17:54:50 +0100 From: paul@cupis.co.uk To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] variable not being replaced in dialplan
On Fri, Jun 22, 2012 at 03:57:59PM +0000, Juan Pablo L. wrote:
Good morning, i have the following entry in my dialplan to dialout using a gateway:
<extension name="gw_outbound_call"> <condition field="destination_number" expression="[\d]{7,}?$"> <action application="set" data="effective_caller_id_number=10000"/> <action application="bridge" data="sofia/gateway/gw/$1"/> </condition> </extension>
the dialplan runs well and when FS has to bridge the call it opens a channel to "sofia/gateway/gw/$1", it does not replace the $1 by the actual number being dialed, i have the same in other parts of the dialplan and it works good, i can not find what i m doing wrong here, i would appreciate any hint about this issue.
You are not setting $1.
<condition field="destination_number" expression="[\d]{7,}?$">
should be:
<condition field="destination_number" expression="([\d]{7,}?)$">
take note of the parentheses () which set the $1 variable.
Regards,
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
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)
-
Alex
-
Juan Pablo L.
-
Paul Cupis