Search code examples
freeswitch

Transferring Calls between FreeSWITCH and Session Manager


Transferring Calls between FreeSWITCH and Session Manager

We have a Avaya Session Manager and a FreeSWITCH as a feature Server connected with it.

  • Call from the Avaya CM World routed to the FreeSWITCH via Avaya Session Manager.
  • In FreeSWITCH we do some processing (replace the Caller ID) and
  • send it back to the Session Manager

FreeSWITCH handles the Call the as follows

Call come from SM 1.2.3.4

  • a dialplan calls a lua script ** dnis may be 19131913
  • this lua script does the processing (db lookup, and so on ...)
  • finally it calls session:transfer("tosm" .. dnis, "XML", "AS5850"); to transfer the call
  • a dialplan matching tosm19131913 does a bridge back to SM 1.2.3.4
<extension name="AVAYA SM">
   <condition field="destination_number" expression="^tosm(\d*)$">
      <action application="bridge" data="sofia/AS5850/0*$1@1.2.3.4"/>
   </condition>
</extension>

This works relatively fine but the problem is that FS still holds the call with two channels as long as the call exists. This consumes two channels on the Session Manager wich is expensive.

It is possible on FreeSWITCH commandline to drop the channels so that the call leaves the FS completely. The command to do this is uuid_simplify.

I've tried to execute that command from lua script with

  my_fs_api = freeswitch.API()
  my_exec_result = my_fs_api:executeString("sofia status")
  my_exec_result = my_fs_api:executeString("uuid_simplify " .. my_ssession_uuid)
  freeswitch.consoleLog("notice","\n\n[1c]   result " .. my_exec_result .. "\n\n")

but it does not work.

I've tried to remove session:tranfer from session transfer and use deflect on the dialplan. This also dosn't work.

Any ideas?


Solution

  • you're simply using the wrong tool. If you only need to modify the SIP headers, such as caller ID, you can easily go with Kamailio and configure it for stateless processing, so that it doesn't need to know about ongoing sessions.

    I could help with some consulting in January (currently fully booked for the rest of the year)