is there any variable to set in directory user variables to execute an application on every channel
hi is there any variable to set in directory user variables so that an application is called on every created channel for that user (or on every channel answered)? <include> <user id="3003"> <params> ... </params> <variables> ... <variable name="execute_on_any_channel" value="my_app"/> </variables> </user> </include> thanx
There's nothing automatic, however you can do this with some dialplan magic. You'll need to handle calls from the user differently than calls to the user. For calls to the user you can add a condition to the Local_Extension. For calls from the user you can just add something near the top of the dialplan. Try something like this: <extension name="my app" continue="true"> <condition field="${sip_authorized}" expression="^true$"/> <condition field="${execute_on_any_channel}" expression="^(.+)$"> <action application="${execute_on_any_channel}" data="${any_data_you_think_you_should_put_here}"/> </condition> </extension> Note the two conditions. The first checks to see if the user is SIP authorized and the second checks to see if there's a value in the chan var named "execute_on_any_channel". If both conditions evaluate true then the dialplan tries to add an action to the task list. Just for kicks I added another pretend chan var for application data but that's totally up to you if you need any args for your app. In any case, the standard disclaimer<http://wiki.freeswitch.org/wiki/Reporting_Bugs#Standard_Disclaimer>applies, so test and tinker before you report back. :) -MC On Fri, Oct 12, 2012 at 1:43 AM, Babak Yakhchali <babak.freeswitch@gmail.com
wrote:
hi is there any variable to set in directory user variables so that an application is called on every created channel for that user (or on every channel answered)? <include> <user id="3003"> <params> ... </params> <variables> ... <variable name="execute_on_any_channel" value="my_app"/>
</variables> </user> </include> thanx
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
participants (2)
-
Babak Yakhchali
-
Michael Collins