[Freeswitch-users] GotoIf

Brian West brian at freeswitch.org
Fri Oct 3 01:53:03 PDT 2008


Actually try this:

<extension name="ext1">
   <condition field="${caller_id_number}" expression="^32484120169$">
     <action application="transfer" data="1000 XML default"/>
   </condition>
</extension>

<extension name="ext2">
   <condition field="${caller_id_number}" expression="^4732803429$">
     <action application="transfer" data="terje XML default"/>
   </condition>
</extension>

<extension name="ext3">
   <condition field="${caller_id_number}" expression="^32476378561$">
     <action application="transfer" data="henk_gsm_disa XML default"/>
   </condition>
</extension>


Your condition field= shouldn't have a ^ or a $ in it like yours does.

/b



On Oct 3, 2008, at 3:23 AM, henkoegema wrote:

>
>
> henkoegema wrote:
>>
>> How do I do this in FS ? :
>> exten => s,n,GotoIf($[${CALLERID(num)}=32484120169]?default,1000,1)
>> exten => s,n,GotoIf($[${CALLERID(num)}=4732803429]?default,terje,1)
>> exten => s,n,GotoIf($[${CALLERID(num)}=32476378561]?henk_gsm_disa,s, 
>> 1)
>>
>>
>> The Asterisk to Freeswitch Rosetta stone says:
>> GotoIf	Conditions in dialplan (<condition field="blah"  
>> expression="foo">
>> but I can't figure out the right syntax.
>>
>> Henk
>>
>
>
> I've made some progress in the mean time.
> I made a test extension 2020:
>
> <extension name="2020">
>      <condition field="destination_number" expression="^2020$"/>
>      <condition field="^${caller_id_number}$"  expression="2000">
> :clap:
>        <action application="bridge" data="sofia/internal/9999@$$ 
> {domain}"/>
>      </condition>
>      <condition field="^${caller_id_number}$"  expression="2002">
>        <action application="bridge" data="sofia/internal/9999@$$ 
> {domain}"/>
>      </condition>
>    </extension>
>
> When I call 2020  from 2000, I'l get the MOH.
>
>
> When I swap 2000 and 2002 I will NOT get MOH :
> <extension name="2020">
>      <condition field="destination_number" expression="^2020$"/>
>      <condition field="^${caller_id_number}$"  expression="2002">
>        <action application="bridge" data="sofia/internal/9999@$$ 
> {domain}"/>
>      </condition>
>      <condition field="^${caller_id_number}$"  expression="2000">
> :confused:
>        <action application="bridge" data="sofia/internal/9999@$$ 
> {domain}"/>
>      </condition>
>    </extension>
>
>
> Henk
>
>
> -- 
> View this message in context: http://www.nabble.com/GotoIf-tp19793170p19793801.html
> Sent from the Freeswitch-users mailing list archive at Nabble.com.
>
>
> _______________________________________________
> 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