[Freeswitch-users] Caller id number in dialplan

Ivan C Myrvold ivan at myrvold.org
Sat Aug 16 12:51:38 PDT 2008


Thanks for all your help! With your last suggestion, and an addition  
of  break="on-true" for the second condition,
I got the intended result, which in a sort of pseudo-code was this:

if destination_number = ... {
	if caller_id_number=100
		bridge to 140
	else if caller_id_number=140
		bridge to 100
}

Sure, a pretty stupid example, but I learned a lot with it, and I can  
now use this syntax in the dialplan.

Here is the final xml which works:

   <extension name="Outbound_ip24">
     <condition field="destination_number" expression="^(.+)$"   
break="on-false"/>
	<condition field="caller_id_number" expression="^(100)$"  break="on- 
true">
		<action application="bridge" data="sofia/$${domain}/ 
140%imyrvold.dyndns.org"/>
	</condition>
	<condition field="caller_id_number" expression="^(140)$">
		<action application="bridge" data="sofia/$${domain}/ 
100%imyrvold.dyndns.org"/>
	</condition>
   </extension>


Ivan

On 16. aug.. 2008, at 18:59, Ivan C Myrvold wrote:

> OK, no nested conditions. But I am still unsure about the syntax. In  
> the wiki page I could not find any example of "stacked" condition.
> I tried with the below syntax, but still no success.
>
>   <extension name="Outbound_ip24">
>     <condition field="destination_number" expression="^(.+)$"   
> break="on-false">
> 		<condition field="caller_id_number" expression="^(100)$">
> 			<action application="bridge" data="sofia/$${domain}/ 
> 140%imyrvold.dyndns.org"/>
> 		</condition>
> 		<condition field="caller_id_number" expression="^(140)$">
> 			<action application="bridge" data="sofia/$${domain}/ 
> 100%imyrvold.dyndns.org"/>
> 		</condition>
>     </condition>
>   </extension>
>
> Ivan
>
> On 16. aug.. 2008, at 17:38, Anthony Minessale wrote:
>
>> you cannot nest conditions.
>>
>> you can only stack them with the break attr set.  see wiki page.
>> http://wiki.freeswitch.org/wiki/Dialplan_XML#Condition
>>
>> in the expression both "caller_id_number" and "${caller_id_number}"  
>> will work if you do not nest conditions.
>> you do not say "${variable_caller_id_number}"
>>
>>
>>
>>
>> On Fri, Aug 15, 2008 at 3:58 PM, Ivan C Myrvold <ivan at myrvold.org>  
>> wrote:
>> I am testing out conditions in my dialplan, but am unable to get a
>> match on caller_id_number, and I wonder why.
>>
>> I have to numbers registered from my PAP2, with User ID 100, and 200.
>>
>> If I have this in my dialplan, I thought I should get a match if I
>> call any number from any of these two users:
>>
>>   <extension name="Outbound_ip24">
>>     <condition field="destination_number" expression="^(.+)$">
>>                <condition field="caller_id_number"  
>> expression="^(100)$">
>>                        <action application="bridge" data="sofia/$$ 
>> {domain}/
>> 140%imyrvold.dyndns.org"/>
>>                </condition>
>>                <condition field="caller_id_number"  
>> expression="^(140)$">
>>                        <action application="bridge" data="sofia/$$ 
>> {domain}/
>> 100%imyrvold.dyndns.org"/>
>>                </condition>
>>     </condition>
>>   </extension>
>>
>> But FreeSWITCH can not find a route to either of 100 nor 140.
>>
>> If I remove the inner conditions, and dial any number, my 140
>> telephone will ring:
>>
>>   <extension name="Outbound_ip24">
>>     <condition field="destination_number" expression="^(.+)$">
>>                        <action application="bridge" data="sofia/$$ 
>> {domain}/
>> 140%imyrvold.dyndns.org"/>
>>     </condition>
>>   </extension>
>>
>> Why don't I get a match on caller_id_number?
>>
>> Ivan
>>
>> _______________________________________________
>> 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
>>
>>
>>
>> -- 
>> Anthony Minessale II
>>
>> FreeSWITCH http://www.freeswitch.org/
>> ClueCon http://www.cluecon.com/
>>
>> AIM: anthm
>> MSN:anthony_minessale at hotmail.com
>> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
>> IRC: irc.freenode.net #freeswitch
>>
>> FreeSWITCH Developer Conference
>> sip:888 at conference.freeswitch.org
>> iax:guest at conference.freeswitch.org/888
>> googletalk:conf+888 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
>
> _______________________________________________
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080816/d40b5263/attachment-0002.html 


More information about the FreeSWITCH-users mailing list