[Freeswitch-users] Bridge Issue, What's the difference between bridge() and session.execute('bridge') in javascript

Sanfy D sanfyduan at gmail.com
Sat May 4 15:22:43 UTC 2019


hi all,
I write a javascript to bridge two endpoints. The senes is like the
following,

A(web+sip.js+wrtc) <--->Freeswitch(sofia+javascript) <---> Twilio sip
trunking <---> B(pstn phone).

I tried two methods in Freeswitch javascript to call from A to B:
  1. create new sessionB then bridge A to B:
       (1) sessionA.answer() and ring back to A,
       (2) create new session to B via sip bridge, then break sessionA
ringback and park sessionB,
       (3) bridge(sessionA, sessionB)

   2. bridge A to B directly without create sessionB:
       (1) sessionA.answer(),
       (2)
sessionA.execute('bridge','sofia/gateway/32d1440c-d13c-44b3-94da-1589daf6e81b/'+sessionA.getVariable('callee_id_number'));

The second one works well. But in the first one, A always loses some audio
from B.

I use tcpdump on my Freeswitch server to check the connection and find that
some UDP packets from Freeswitch to A are lost, but the packets from Twillo
to Freeswitch are not lose.

It seems that some UDP packets are lost while the Freeswitch relays the udp
packets to A.

So, what the difference is between the two methods?  And how can I fix this
problem? I need to use the first method to make the call.

Thank!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20190504/5629af67/attachment-0001.html>


More information about the FreeSWITCH-users mailing list