Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Calling more than 1 variable in condition


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
ahmedmunir007 at gmail...
Guest





PostPosted: Thu Nov 05, 2009 1:30 am    Post subject: [Freeswitch-users] Calling more than 1 variable in condition Reply with quote

Hi,

In my dial plan I've created a variable named SIP_CALL, PSTN_CALL. If SIP_CALL = true, it dials out to sip call, when PSTN_CALL=true, it dials out to landline call, as I provide sample below;

<condition field="${SIP_CALL}" expression="^true$">
     <action application="log" data="INFO SIP CALL"/>
     <action application="bridge" data="sofia/${domain}/$1"/>
</condition>

<condition field="${PSTN_CALL}" expression="^true$">
     <action application="log" data="INFO PSTN CALL"/>
     <action application="bridge" data="sofia/gateway/$1"/>
</condition>

The problem I'm facing is how can I apply condition when I've to call more than 1 variables? Like if there are no records in SIP numbering plan table and PSTN numbering plan table so it get the digits and  dial out the to carrier (how to apply AND operation in condition?) i.e.

<condition field="${SIP_CALL} and ${PSTN_CALL}" expression="^false$">
     <action application="log" data="INFO GET DTMF"/>
     <action application="getdigits" data="values for getdigits"/>
      <action application="bridge" data="sofia/gateway/$1"/>
</condition>

Kindly advise for this issue.

--
Regards,

Ahmed Munir
Back to top
msc at freeswitch.org
Guest





PostPosted: Thu Nov 05, 2009 1:56 pm    Post subject: [Freeswitch-users] Calling more than 1 variable in condition Reply with quote

On Wed, Nov 4, 2009 at 10:22 PM, Ahmed Munir <ahmedmunir007@gmail.com (ahmedmunir007@gmail.com)> wrote:
Quote:
Hi,

In my dial plan I've created a variable named SIP_CALL, PSTN_CALL. If SIP_CALL = true, it dials out to sip call, when PSTN_CALL=true, it dials out to landline call, as I provide sample below;

<condition field="${SIP_CALL}" expression="^true$">
     <action application="log" data="INFO SIP CALL"/>
     <action application="bridge" data="sofia/${domain}/$1"/>
</condition>

<condition field="${PSTN_CALL}" expression="^true$">
     <action application="log" data="INFO PSTN CALL"/>
     <action application="bridge" data="sofia/gateway/$1"/>
</condition>

The problem I'm facing is how can I apply condition when I've to call more than 1 variables? Like if there are no records in SIP numbering plan table and PSTN numbering plan table so it get the digits and  dial out the to carrier (how to apply AND operation in condition?) i.e.

<condition field="${SIP_CALL} and ${PSTN_CALL}" expression="^false$">
     <action application="log" data="INFO GET DTMF"/>
     <action application="getdigits" data="values for getdigits"/>
      <action application="bridge" data="sofia/gateway/$1"/>
</condition>
AND operations are very simple - just stack the conditions:
<condition field="${Field1}" expression="expr1"/>
<condition field="${Fiedl2}" expression="expr2">
  <-- actions here -->
</condition>

note that you must close the first condition's tag! BTW, this is covered in the dialplan section of the wiki. Smile
-MC
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services