Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[Freeswitch-users] Call custom 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: Wed Oct 21, 2009 5:44 am    Post subject: [Freeswitch-users] Call custom variable in condition Reply with quote

Hi,

I've declared a variable named AUTHENTICATION_STATUS in dialplan, and I want to use it in condition, as I'm listing down the configuration below;

<context name="SIP_incoming">
   <extension name="call-sip-extensions">
      <condition field="destination_number" expression="^(\d+)$">
          <action application="set" data="AUTHENTICATION_STATUS=0"/>
           <action application="transfer" data="${AUTHENTICATION_STATUS} XML Authen_Status"/>
      </condition>
   </extension>
</context>

<context name="Authen_Status">
     <extension name="exten-auth-status">
       <condition field="AUTHENTICATION_STATUS" expression="^0$">
          <action application="answer"/>
          <action application="playback" data="play.wav"/>
      </condition>
    </extension>
  </context>




 But unfortunately it is not working. Kindly advise me how to do implement it(Note: I don't want to call script). And one more thing to ask how can I transfer the values within the same context?
--
Regards,

Ahmed Munir
Back to top
mustafa.pk at gmail.com
Guest





PostPosted: Wed Oct 21, 2009 6:02 am    Post subject: [Freeswitch-users] Call custom variable in condition Reply with quote

Ahmed,

you can't use variables set by "set" application within a condition,
though it doesn't make sense. wondering if there is any logic behind
this or it's just a simple missing feature. anyone?

-m

Ahmed Munir wrote:
Quote:
Hi,

I've declared a variable named AUTHENTICATION_STATUS in dialplan, and
I want to use it in condition, as I'm listing down the configuration
below;

<context name="SIP_incoming">
<extension name="call-sip-extensions">
<condition field="destination_number" expression="^(\d+)$">
<action application="set" data="AUTHENTICATION_STATUS=0"/>
<action application="transfer"
data="${AUTHENTICATION_STATUS} XML Authen_Status"/>
</condition>
</extension>
</context>

<context name="Authen_Status">
<extension name="exten-auth-status">
<condition field="AUTHENTICATION_STATUS" expression="^0$">
<action application="answer"/>
<action application="playback" data="play.wav"/>
</condition>
</extension>
</context>




But unfortunately it is not working. Kindly advise me how to do
implement it(Note: I don't want to call script). And one more thing to
ask how can I transfer the values within the same context?

--
Regards,

Ahmed Munir


------------------------------------------------------------------------

_______________________________________________
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



_______________________________________________
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
Back to top
tculjaga at gmail.com
Guest





PostPosted: Wed Oct 21, 2009 6:22 am    Post subject: [Freeswitch-users] Call custom variable in condition Reply with quote

consider this:



<context name="SIP_incoming">
   <extension name="call-sip-extensions">
      <condition field="destination_number" expression="^(\d+)$">
          <action application="set" data="AUTHENTICATION_STATUS=0"/>
           <action application="transfer" data="${AUTHENTICATION_STATUS} XML Authen_Status"/>
      </condition>
   </extension>
</context>



<context name="Authen_Status">
     <extension name="exten-auth-status">
       <condition field="${AUTHENTICATION_STATUS}" expression="^0$">
          <action application="answer"/>
          <action application="playback" data="play.wav"/>
      </condition>
    </extension>
  </context>





here is one of my dialplan. I'm using execute_extension but it is quite the same...



   <extension name="ServiceLookup">
      <condition field="destination_number" expression="(^300030)(.*)">
         <action application="lookup_service_destination" data="in ${caller_id_number:6:16}, in ${caller_id_number:0:6}, in $2, in $
1, in ${network_addr}:5060, out red_contact, out authResult"/>
         <action application="log" data="INFO ######################## ServiceLookup ########################\n"/>
         <action application="log" data="INFO ######################## contact = '${red_contact}' ##############\n"/>
         <action application="log" data="INFO ######################## CallerNum = '${caller_id_number:6:16}' ##########\n"/>
         <action application="log" data="INFO ######################## RADIUS auth = '${authResult}' ##########\n"/>

         <action application="execute_extension" data="doRedirect XML public"/>
        </condition>
   </extension>


   <extension name="doRedirect">
      <condition field="destination_number" expression="^doRedirect$"/>
      <condition field="${authResult}" expression="^0$|^60$">
         <action application="log" data="INFO ######################## RADIUS auth OK!!!' ##########\n"/>
         <action application="redirect" data="${red_contact}"/>
         <anti-action application="log" data="INFO ######################## RADIUS auth NOK!! ##########\n"/>
         <anti-action application="respond" data="403 Forbidden"/>
      </condition>

   </extension>




On Wed, Oct 21, 2009 at 12:37 PM, Ahmed Munir <ahmedmunir007@gmail.com (ahmedmunir007@gmail.com)> wrote:
Quote:
Hi,

I've declared a variable named AUTHENTICATION_STATUS in dialplan, and I want to use it in condition, as I'm listing down the configuration below;

<context name="SIP_incoming">
   <extension name="call-sip-extensions">
      <condition field="destination_number" expression="^(\d+)$">
          <action application="set" data="AUTHENTICATION_STATUS=0"/>
           <action application="transfer" data="${AUTHENTICATION_STATUS} XML Authen_Status"/>
      </condition>
   </extension>
</context>

<context name="Authen_Status">
     <extension name="exten-auth-status">
       <condition field="AUTHENTICATION_STATUS" expression="^0$">
          <action application="answer"/>
          <action application="playback" data="play.wav"/>
      </condition>
    </extension>
  </context>




 But unfortunately it is not working. Kindly advise me how to do implement it(Note: I don't want to call script). And one more thing to ask how can I transfer the values within the same context?
--
Regards,

Ahmed Munir



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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

Back to top
anthony.minessale at g...
Guest





PostPosted: Wed Oct 21, 2009 11:49 am    Post subject: [Freeswitch-users] Call custom variable in condition Reply with quote

It not only makes sense it's well documented on the wiki page.
The set line is not happening right when it's encountered, the set line is copied into the channel and executed later after the whole dialplan is parsed.  The dialplan is a pre-processor not a runtime engine.

Here is a new feature in pre-1.0.5 (svn trunk)

Some applications like set can now be executed within the dialplan but you should use it sparingly.
<action application="set" data="testing=true" inline="true"/>

The inline=true makes it execute inside the dialplan and it's never copied into your resulting extension because it's executed immediately.



On Wed, Oct 21, 2009 at 6:13 AM, Tihomir Culjaga <tculjaga@gmail.com (tculjaga@gmail.com)> wrote:
Quote:
consider this:



<context name="SIP_incoming">
   <extension name="call-sip-extensions">
      <condition field="destination_number" expression="^(\d+)$">
          <action application="set" data="AUTHENTICATION_STATUS=0"/>
           <action application="transfer" data="${AUTHENTICATION_STATUS} XML Authen_Status"/>
      </condition>
   </extension>
</context>



<context name="Authen_Status">
     <extension name="exten-auth-status">
       <condition field="${AUTHENTICATION_STATUS}" expression="^0$">
          <action application="answer"/>
          <action application="playback" data="play.wav"/>
      </condition>
    </extension>
  </context>






here is one of my dialplan. I'm using execute_extension but it is quite the same...



   <extension name="ServiceLookup">
      <condition field="destination_number" expression="(^300030)(.*)">
         <action application="lookup_service_destination" data="in ${caller_id_number:6:16}, in ${caller_id_number:0:6}, in $2, in $
1, in ${network_addr}:5060, out red_contact, out authResult"/>
         <action application="log" data="INFO ######################## ServiceLookup ########################\n"/>
         <action application="log" data="INFO ######################## contact = '${red_contact}' ##############\n"/>
         <action application="log" data="INFO ######################## CallerNum = '${caller_id_number:6:16}' ##########\n"/>
         <action application="log" data="INFO ######################## RADIUS auth = '${authResult}' ##########\n"/>

         <action application="execute_extension" data="doRedirect XML public"/>
        </condition>
   </extension>


   <extension name="doRedirect">
      <condition field="destination_number" expression="^doRedirect$"/>
      <condition field="${authResult}" expression="^0$|^60$">
         <action application="log" data="INFO ######################## RADIUS auth OK!!!' ##########\n"/>
         <action application="redirect" data="${red_contact}"/>
         <anti-action application="log" data="INFO ######################## RADIUS auth NOK!! ##########\n"/>
         <anti-action application="respond" data="403 Forbidden"/>
      </condition>

   </extension>





On Wed, Oct 21, 2009 at 12:37 PM, Ahmed Munir <ahmedmunir007@gmail.com (ahmedmunir007@gmail.com)> wrote:


Quote:

Hi,

I've declared a variable named AUTHENTICATION_STATUS in dialplan, and I want to use it in condition, as I'm listing down the configuration below;

<context name="SIP_incoming">
   <extension name="call-sip-extensions">
      <condition field="destination_number" expression="^(\d+)$">
          <action application="set" data="AUTHENTICATION_STATUS=0"/>
           <action application="transfer" data="${AUTHENTICATION_STATUS} XML Authen_Status"/>
      </condition>
   </extension>
</context>

<context name="Authen_Status">
     <extension name="exten-auth-status">
       <condition field="AUTHENTICATION_STATUS" expression="^0$">
          <action application="answer"/>
          <action application="playback" data="play.wav"/>
      </condition>
    </extension>
  </context>




 But unfortunately it is not working. Kindly advise me how to do implement it(Note: I don't want to call script). And one more thing to ask how can I transfer the values within the same context?
--
Regards,

Ahmed Munir





_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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





_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
msc at freeswitch.org
Guest





PostPosted: Wed Oct 21, 2009 12:14 pm    Post subject: [Freeswitch-users] Call custom variable in condition Reply with quote

On Wed, Oct 21, 2009 at 9:39 AM, Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
It not only makes sense it's well documented on the wiki page.
The set line is not happening right when it's encountered, the set line is copied into the channel and executed later after the whole dialplan is parsed.  The dialplan is a pre-processor not a runtime engine.

Here is a new feature in pre-1.0.5 (svn trunk)

Some applications like set can now be executed within the dialplan but you should use it sparingly.
<action application="set" data="testing=true" inline="true"/>

I'm getting ready to document this feature. For the sake of edification, why is it best to use this sparingly, other than wide-spread use making dialplans all cluttered?
-MC
 

Quote:

The inline=true makes it execute inside the dialplan and it's never copied into your resulting extension because it's executed immediately.


Back to top
anthony.minessale at g...
Guest





PostPosted: Wed Oct 21, 2009 12:25 pm    Post subject: [Freeswitch-users] Call custom variable in condition Reply with quote

you should not abuse it is all i mean, we have measures to limit what apps you can use in this manner but usually requiring a more complicated dialplan is a hint you are doing something wrong Wink

On Wed, Oct 21, 2009 at 12:02 PM, Michael Collins <msc@freeswitch.org (msc@freeswitch.org)> wrote:
Quote:


On Wed, Oct 21, 2009 at 9:39 AM, Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
It not only makes sense it's well documented on the wiki page.
The set line is not happening right when it's encountered, the set line is copied into the channel and executed later after the whole dialplan is parsed.  The dialplan is a pre-processor not a runtime engine.

Here is a new feature in pre-1.0.5 (svn trunk)

Some applications like set can now be executed within the dialplan but you should use it sparingly.
<action application="set" data="testing=true" inline="true"/>


I'm getting ready to document this feature. For the sake of edification, why is it best to use this sparingly, other than wide-spread use making dialplans all cluttered?
-MC
 

Quote:

The inline=true makes it execute inside the dialplan and it's never copied into your resulting extension because it's executed immediately.






_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
leon at scarlet-intern...
Guest





PostPosted: Thu Oct 22, 2009 3:39 am    Post subject: [Freeswitch-users] Call custom variable in condition Reply with quote

Hi Michael,

The feature is already documented here:

http://wiki.freeswitch.org/wiki/Dialplan_XML#Clarification
http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions


Perhaps the reason *why* it's the way it is can be expanded a bit ?


regards,


Leon



On Oct 21, 2009, at 7:02 PM, Michael Collins wrote:
Quote:


On Wed, Oct 21, 2009 at 9:39 AM, Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
It not only makes sense it's well documented on the wiki page.
The set line is not happening right when it's encountered, the set line is copied into the channel and executed later after the whole dialplan is parsed. The dialplan is a pre-processor not a runtime engine.

Here is a new feature in pre-1.0.5 (svn trunk)

Some applications like set can now be executed within the dialplan but you should use it sparingly.
<action application="set" data="testing=true" inline="true"/>

I'm getting ready to document this feature. For the sake of edification, why is it best to use this sparingly, other than wide-spread use making dialplans all cluttered?
-MC


Quote:

The inline=true makes it execute inside the dialplan and it's never copied into your resulting extension because it's executed immediately.




_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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
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