[Freeswitch-users] bridging 2 SIP destinations from PBX behind NAT

Michal Zubáč michal.zubac at comgate.cz
Thu Jan 5 15:20:03 MSK 2012


Hi.

I encountered problem with bridging two SIP calls.

My FreeSwitch is behind NAT, I'm not sure if endpoint switches are, but 
I think it doesn't matter now.
Situation looks like this:
   SIP1 <--> NAT <--> PBX <--> NAT <--> SIP2
SIP1 is caller switch, SIP2 is destination switch so call is initiated 
like this:
   SIP1->PBX->SIP2

I tested both endpoints separately using ISDN endpoint and they worked.
Like this
   ISDN1->PBX->SIP2
&
   SIP1->PBX->ISDN2

But when I connected SIP1 & SIP2 together, call is estabilished, but no 
audio was going through our firewall. Both audio streams from SIP1 and 
SIP2 were filtered out by our firewall, because Freeswitch (PBX) wasn't 
sending any initial packets to SIP endpoints, so no NAT holes were created.

It look strange to me. I expected FreeSwitch to at least send some 
"empty" RTP packets to SIP endpoints as soon as call estabilishment is 
confirmed on SIP channel. But Freeswitch doesn't do it and only sends 
ringing indication.

I had problems in scenario, where SIP2 endpoint doesn't ring and 
immediately answers the call. Call was estabilished, but audio was stuck 
in our firewall, because Freeswitch haven't initiated any RTP 
communication yet and was probably waiting for something.

I managed to solve this problem by adding <action application="set" 
data="instant_ringback=true"/> between my <action 
application="ring_ready" /> and <action application="bridge" /> commands 
in dialplan.

Now it works, but I'm feeling kind of uncertain with this solution, 
because I don't really understand why. What was Freeswitch waiting for, 
before I added instant_ringback? Why can't FreeSwitch prepare NAT holes 
(as described before) as soon as SDP are interchanged?

Thanks for clarification.

Regards

-- 
Michal Zubac
ComGate Interactive s.r.o.

Prague Marina Office Center
Jankovcova 1596/14a
17000 Praha 7, Czech Republic




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