[Freeswitch-users] Transfer and scoping confusion

admin admin at tedssupply.com
Tue Jun 11 16:06:43 MSD 2013


Thanks for the help Michael, but I am still missing a tiny thing somewhere.. 

Let me illustrate as briefly as possible by snipping where possible.  Local_Extension is as installed except for: 

<extension name="Local_Extension"> 
   . 
   . 
   <action application="export" data="new_vm_digits=123" 
   <action application="bind_meta_app" data="4 b s execute_extension::direct_to_vmail XML default"/> 
   . 
</extension> 

This matches in an added extension call_direct_to_vmail 

<extension name="call_direct_to_vmail"> 
   <condition field="destination_number" expression="^direct_to_vmail$"> 
      <action application="read" data="4 4 'tone-stream://%(10000,0,350,440)' digits 30000 #" /> 

      <action application="log" data="INFO Value of digits are [${digits}]" /> 
      <action application="log" data="INFO Value of new_vm_digits before assignment  [${new_vm_digits}]"/> 

      <action application="set" data="new_vm_digits=${digits}"/> 
      <action application="log" data="INFO Value of new_vm_digits after assignment  [${new_vm_digits}]"/> 

      <action application="transfer" data="-bleg vmail_now XML default"/> 

   </condition> 
</extension> 

This transfers to vmail_now: 

<extension name="vmail_now"> 
   <condition field="destination_number" expression="^vmail_now$"> 


     <action application="log" data="INFO Value of new_vm_digits in vmail_now  [${new_vm_digits}]"/> 


      <action application="bridge" data="loopback/app=voicemail:default ${domain_name} ${new_vm_digits}"/> 


   </condition> 
</extension> 

Logged entries show: 

Local_extension assigns new_vm_digits = 123 

   In direct_to_vmail the value of new_vm_digits = 123 BEFORE reassignment  
   In direct_to_vmail the value of new_vm_digits = 1005 after "set", just before "transfer" - number I entered 

      In vmail_now the value of new_vm_digits = 123 
      In vmail_now [WARNING] mod_voicemail.c:3310 Can't find user [123 at xxx.xxx.xxx.xxx] - as expected 

I am missing the scope of new_vm_digits, but where?   
Aren't variables global without the "%"?   
Doesn't the "export" in Local_Extension scope into all following legs?   
Docs say that "execute_extension" is in scope.   

The -bleg bothers me also... but thats another day! 




>>> Michael Collins <msc at freeswitch.org> 6/10/2013 1:42 PM >>>






On Mon, Jun 10, 2013 at 10:31 AM, admin <admin at tedssupply.com> wrote:



Thanks Cal, first time on any mailing list and with lack of sleep I got a bit long winded... 


I am assuming the subject will create the threading... 


I also snipped all previous for brevity. 


Let me know if this is not OK. 


Let's start simply: After two legs have been bridged, do you use "transfer" to unbridge the calls and then send one of them somewhere else (this is the greater portion of my question) ? 
 

You can use FS command line APIs uuid_transfer or uuid_dual_transfer to accomplish this. See the "API Commands" link on the Wiki navigation panel to see all the API commands in alphabetical order. Try those out and let us know if you have any questions.


-MC


--
Michael S Collins
Twitter: @mercutioviz
http://www.FreeSWITCH.org
http://www.ClueCon.com
http://www.OSTAG.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130611/09acbc53/attachment-0001.html 


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