[Freeswitch-users] call_timeout and enterprise originate

Alexander Lake alex at thewinelake.com
Thu Jun 14 01:27:44 MSD 2012


So an example of a current script would be:

<include>
 <extension name="0095301">
  <condition field="destination_number" expression="^(301|441223900482)$">
   <action application="set" data="sb_routing=${sb_routing}&441223900482_301_pers_Alex"/>
   <action application="set" data="tenant_id=0095"/>
   <action application="set" data="b_ext=301"/>
   <action application="export" data="alert_info=http://hzhnov11.dmclub.net/generic/tones/Personal.wav"/>
   <action application="set" data="call_timeout=60"/>
   <action application="set" data="hangup_after_bridge=true"/>
   <action application="set" data="continue_on_fail=true"/>
   <action application="set" data="bridge_generate_comfort_noise=true"/>
   <action application="export" data="sip_h_tenant_id=0095"/>
   <action application="export" data="sip_h_company_name=Test Account"/>
   <action application="export" data="sip_h_extension=301"/>
   <action application="export" data="sip_h_extension_type=PersonalExtension"/>
   <action application="export" data="sip_h_extension_name=Alex"/>
   <action application="export" data="sip_h_prev_sb_routing=${sb_routing}"/>
   <action application="set" data="group_confirm_key=exec"/>
   <action application="export" data="whisper_msg=say:d m switchboard Call for Test Account personal"/>
   <action application="export" data="accept_msg=say:press 1 to accept"/>
   <action application="set" data="ringback=$${uk-ring}"/>
   <action application="set" data="transfer_ringback_=$${uk-ring}"/>
   <action application="set" data="ignore_early_media=true"/>
   <action application="set" data="group_confirm_file=lua confirmcall.lua"/>
   <action application="bridge" data="[tenant_id=0095,b_ext=301,accept_mode=Direct,sip_h_sb_routing=${sb_routing}&441223900482_301_pers_Alex,call_timeout=20]user/0095301wp@${domain_name},[tenant_id=0095,b_ext=301,accept_mode=Direct,call_timeout=20,origination_caller_id_number=00953010${ani}]sofia/internal/898000000000207775911500 at 1.2.3.4,"/>
   <action application="set" data="comment=pers_inhours_VM" />
   <action application="answer" />
   <action application="sleep" data="1000"/>
   <action application="voicemail" data="default ${domain_name} 0095301"/>
  </condition>
 </extension>
</include>

Note that I'm using , as a separator (having briefly used :_:)

As I understand it, we could replace this with:

<include>
 <extension name="0095301">
  <condition field="destination_number" expression="^(301|441223900482)$">
   <action application="set" data="tenant_id=0095"/>
   <action application="set" data="b_ext=301"/>
   <action application="set" data="call_timeout=60"/>
   <action application="set" data="hangup_after_bridge=true"/>
   <action application="set" data="continue_on_fail=true"/>
   <action application="set" data="bridge_generate_comfort_noise=true"/>
   <action application="set" data="ringback=$${uk-ring}"/>
   <action application="set" data="transfer_ringback_=$${uk-ring}"/>
   <action application="set" data="ignore_early_media=true"/>
   <action application="bridge" data="<sb_routing=${sb_routing}&441223900482_301_pers_Alex,tenant_id=0095,b_ext=301,alert_info=http://hzhnov11.dmclub.net/generic/tones/Personal.wav,call_timeout=60,hangup_after_bridge=true,continue_on_fail=true,bridge_generate_comfort_noise=true,sip_h_tenant_id=0095,sip_h_company_name=Test Account,sip_h_extension=301,sip_h_extension_type=PersonalExtension,sip_h_extension_name=Alex,sip_h_prev_sb_routing=${sb_routing},group_confirm_key=exec,whisper_msg=say:d m switchboard Call for Test Account personal,accept_msg=say:press 1 to accept,ringback=$${uk-ring},transfer_ringback_=$${uk-ring},ignore_early_media=true,group_confirm_file=lua confirmcall.lua>[tenant_id=0095,b_ext=301,accept_mode=Direct,sip_h_sb_routing=${sb_routing}&441223900482_301_pers_Alex,call_timeout=20]user/0095301wp@${domain_name}:_:[tenant_id=0095,b_ext=301,accept_mode=Direct,call_timeout=20,origination_caller_id_number=00953010${ani}]sofia/internal/898000000000207775911500 at 1.2.3.4,"/>
   <action application="set" data="comment=pers_inhours_VM" />
   <action application="answer" />
   <action application="sleep" data="1000"/>
   <action application="voicemail" data="default ${domain_name} 0095301"/>
  </condition>
 </extension>
</include>

I'm not sure which of the channel variables is only for B-leg and which are for both (and which are essentially detritus!), but I guess there's no harm in putting in a few surplus ones.

Will give this a try tomorrow morning....

Cheers!
Alex

On 13 Jun 2012, at 22:08, Avi Marcus wrote:

> [var1=myinfo] is per each bridge string. {var1=myinfo} applies to the
> entire thread, meaning if you have a :_: it won't carry over to that.
> <var1=myinfo> is a superglobal which is applied to ALL threads.
> 
> -Avi
> 
> 
> On Thu, Jun 14, 2012 at 12:04 AM, Alexander Lake <alex at thewinelake.com> wrote:
>> Ah. Is there a way to set common variables for the bridges?
>> 
>> On 13 Jun 2012, at 21:55, Avi Marcus wrote:
>> 
>>> Like you've been doing, mostly: setting them inside the bridge string.
>>> 
>>> -Avi
>>> 
>>> 
>>> On Wed, Jun 13, 2012 at 11:52 PM, Alexander Lake <alex at thewinelake.com> wrote:
>>>> export is deprecated? How is one supposed to do it instead?
>>>> Maybe I need to get some examples...
>>>> 
>>>> On 13 Jun 2012, at 18:34, Avi Marcus wrote:
>>>> 
>>>>> bridge seems to be fairly manual for assembling complicated bridge strings.
>>>>> 
>>>>> I think export works to all threads, but afaik, is deprecated.
>>>>> 
>>>>> I've used group_confirm on these threads, it's fine. Just make sure
>>>>> the group_confirm variable is in the right place...
>>>>> 
>>>>> -Avi
>>>>> 
>>>>> 
>>>>> On Wed, Jun 13, 2012 at 7:53 PM, Alex <alex at thewinelake.com> wrote:
>>>>>> Just 'cos it's a separate thread doesn't mean that it couldn't have been
>>>>>> initialised with channel variables from the spawning thread.
>>>>>> I presume that exports don't work either.
>>>>>> How about group_confirm?
>>>>>> This is looking awfully like writing our own everything!
>>>>>>> Hmm. re: enterprise originate remember that each is a separate thread,
>>>>>>> so {} vars in one thread won't work on the other. You need to do
>>>>>>> super-global<>  to make that happen.
>>>>>>> 
>>>>>>> I don't think we have a wiki page purely on building bridge strings yet...
>>>>>>> 
>>>>>>> -Avi Marcus
>>>>>>> 
>>>>>>> On Wed, Jun 13, 2012 at 4:30 PM, Alex<alex at thewinelake.com>  wrote:
>>>>>>>> Is there anything I should know about the combination of these two?
>>>>>>>> 
>>>>>>>> Alex
>>>>>>>> 
>>>>>>>> _________________________________________________________________________
>>>>>>>> Professional FreeSWITCH Consulting Services:
>>>>>>>> consulting at freeswitch.org
>>>>>>>> http://www.freeswitchsolutions.com
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Official FreeSWITCH Sites
>>>>>>>> http://www.freeswitch.org
>>>>>>>> http://wiki.freeswitch.org
>>>>>>>> http://www.cluecon.com
>>>>>>>> 
>>>>>>>> Join Us At ClueCon - Aug 7-9, 2012
>>>>>>>> 
>>>>>>>> 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
>>>>>>> _________________________________________________________________________
>>>>>>> Professional FreeSWITCH Consulting Services:
>>>>>>> consulting at freeswitch.org
>>>>>>> http://www.freeswitchsolutions.com
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> Official FreeSWITCH Sites
>>>>>>> http://www.freeswitch.org
>>>>>>> http://wiki.freeswitch.org
>>>>>>> http://www.cluecon.com
>>>>>>> 
>>>>>>> Join Us At ClueCon - Aug 7-9, 2012
>>>>>>> 
>>>>>>> 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
>>>>>>> 
>>>>>>> 
>>>>>>> -----
>>>>>>> No virus found in this message.
>>>>>>> Checked by AVG - www.avg.com
>>>>>>> Version: 2012.0.2177 / Virus Database: 2433/5065 - Release Date: 06/12/12
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> _________________________________________________________________________
>>>>>> Professional FreeSWITCH Consulting Services:
>>>>>> consulting at freeswitch.org
>>>>>> http://www.freeswitchsolutions.com
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Official FreeSWITCH Sites
>>>>>> http://www.freeswitch.org
>>>>>> http://wiki.freeswitch.org
>>>>>> http://www.cluecon.com
>>>>>> 
>>>>>> Join Us At ClueCon - Aug 7-9, 2012
>>>>>> 
>>>>>> 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
>>>>> 
>>>>> _________________________________________________________________________
>>>>> Professional FreeSWITCH Consulting Services:
>>>>> consulting at freeswitch.org
>>>>> http://www.freeswitchsolutions.com
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> Official FreeSWITCH Sites
>>>>> http://www.freeswitch.org
>>>>> http://wiki.freeswitch.org
>>>>> http://www.cluecon.com
>>>>> 
>>>>> Join Us At ClueCon - Aug 7-9, 2012
>>>>> 
>>>>> 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
>>>> 
>>>> 
>>>> _________________________________________________________________________
>>>> Professional FreeSWITCH Consulting Services:
>>>> consulting at freeswitch.org
>>>> http://www.freeswitchsolutions.com
>>>> 
>>>> 
>>>> 
>>>> 
>>>> Official FreeSWITCH Sites
>>>> http://www.freeswitch.org
>>>> http://wiki.freeswitch.org
>>>> http://www.cluecon.com
>>>> 
>>>> Join Us At ClueCon - Aug 7-9, 2012
>>>> 
>>>> 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
>>> 
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>> 
>>> 
>>> 
>>> 
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://wiki.freeswitch.org
>>> http://www.cluecon.com
>>> 
>>> Join Us At ClueCon - Aug 7-9, 2012
>>> 
>>> 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
>> 
>> 
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>> 
>> 
>> 
>> 
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>> 
>> Join Us At ClueCon - Aug 7-9, 2012
>> 
>> 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
> 
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> 
> 
> 
> 
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
> 
> Join Us At ClueCon - Aug 7-9, 2012
> 
> 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




Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list