[Freeswitch-users] variable not being replaced in dialplan

Paul Cupis paul at cupis.co.uk
Fri Jun 22 20:54:50 MSD 2012


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,




Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list