[Freeswitch-users] Transfer and scoping confusion

admin admin at tedssupply.com
Mon Jun 10 19:15:28 MSD 2013


Hi Guys, 

I am climbing the learning curve, but I am at a standstill on this.  I have searched both books and online for this, and have experimented with limited success. 

I have setup the standard FS box, a little behind at v.1.2.5.3 and I have managed to fumble my way though TDM connections, dialplan extensions, and even have HylaFax functioning.  I am now "stretching" myself by adding some requested user features.  The first is answering a call and sending directly to voicemail instead of the default rerun through the default local extension. 

>From the 40,000 ft view, the incoming, internal (Local_Extension) call, a-leg, has been answered and bridged to an internal phone, b-leg.  After some communication with the caller, the person on the b-leg elects to send the caller directly to voicemail.  I have successfully implemented a "bind_meta_app" to "execute_extension" to a new extension I called direct_to_vmail.  Here I "read" the four digit phone number entered.  At this point all is well, at least according to the logs. 

At this point I need to "unbridge" the b-leg and bridge the a-leg to voicemail.  Can't find an unbridge, break looks wrong in this... Transfer appears to be what I need, as it says it "transfers the call into the new context" and seems to infer that an "unbridge" will occur.  OK so far? 

Now, if I transfer, it needs to go to a specific extension that understands the request, so transfer direcly out to another extension by extension name.  Logs confirm this does happen. 

Here is my question about variable scoping.  When I "read" the four digit phone number entered I first assumed it created a channel variable, and the log seems to indicate this and seems to follow the transfer used in the features.xml in "is_transfer".  This example uses the "read" variable to transfer back into the dialplan.  I need to transfer into a particular extension and use this channel variable to know the voicemail requested. 

I test the channel variable prior to the transfer statement and after entry into the called extension.  Initial tests show assignment before transfer, no assignment after which tends to indicate to me a scoping problem.   

I have tried import and export statements with no success. 

I defined the channel variable back in the Local_Extension extension before the "execute_extension" to see if it was a variable being declared local later in the call stack... No luck as assignment appears to take place, but not later in the call chain. 

I know this is long and "wordy", I just think this is a problem with understanding the basics of FS and I don't want to get bogged-down with specific XML statements until I know I understand the basics. 

Any Ideas?  What am I missing? 

Thanks 

James 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130610/731c1ac8/attachment-0001.html 


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