[Freeswitch-users] setting transfer context

Babak Yakhchali babak.freeswitch at gmail.com
Mon Aug 19 09:49:14 MSD 2013


hi
when a call is attended transferred, for example, to a number like 222,
first bleg is hold and caller initiates a new channel with destination 222
which hits default context. if this new call is transferred to another
context like public using transfer application with a different destination
number like 333 after attended transfer completes the bleg is dropped.
because it goes in routing state with destination number 333 in default
dialplan. to solve this problem I'm using an extension in all contexts
after unloop extension:

<extension name="transfer_adjustment">
  <condition field="${transfer_adjusted}" expression="^$"/>
      <condition field="${sip_refer_to}" expression="^<sip:(.+)@.*$">
<action application="log" data="DEBUG original tranfer was:$1"/>
<action application="set" data="transfer_adjusted=true"/>
<action application="transfer" data="$1 ${dialplan} ${context}"/>
      </condition>
</extension>

I check if transfer_adjusted is not set and the channel is
transferred,first and second conditions, then I transfer it to the original
number which caller called to transfer the call to correct destination. Is
this the right way? or I'm missing something
thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130819/14cf44c2/attachment.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list