[Freeswitch-users] transfering a call to another SIP server

Michael Collins msc at freeswitch.org
Tue Apr 17 22:45:19 MSD 2012


On Tue, Apr 17, 2012 at 2:37 AM, azza miled <azza.miled at gmail.com> wrote:

> thank you, but to be clearer, I want that my lua IVR script transfer the
> call to OpenSIPS. So, if I get what you said, I have to bridge to an
> external server (in the xml dialplan) and then,I just have to transfer the
> call to the IP address of my Opensips server in my lua script. am I wrong??
>

Just be careful when using the word "transfer." It can mean two related but
very different things. There a transfer like transferring a phone call from
one phone to another. There's also a dialplan transfer application that
sends the call flow to another part of the dialplan. I suspect you'll be
doing a little of both. :)

In your Lua script I suggest that the end of the program be transferring
(i.e. dialplan transfer) to an extension in the dialplan that would then
execute the bridge over to your OpenSIPS server. Read this part of the wiki
carefully, especially the note about autohangup:

http://wiki.freeswitch.org/wiki/Lua#session:transfer

The line could be something like this:

session:transfer(target_number,"XML","to_opensips")

The dialplan extension to which you transfer the call can then just do the
bridge. You could even create an entirely new dialplan context. E.g., you
could create a file /usr/local/freeswitch/conf/dialplan/to_opensips.xml
with something like this:

<include>
  <context name="to_opensips">
    <extension name="bridge to opensips">
      <condition field="destination_number" expression="(.*)">
        <action application="bridge" data="sofia/internal/$1@
${opensips_ip_address}"/>
      </condition>
    </extension>
  </context>
</include>

I put my usual disclaimer here: This is off the top of my head. I did not
try this code. If you try it and it doesn't work then tinker and see if you
can figure it out. :)

-MC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120417/b6a954a6/attachment.html 


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