<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Chris,<div><br></div><div>Thanks for the quick reply!</div><div><br></div><div>The FreeSWITCH box is in the DMZ of a Cisco Linksys WAG160N. Best I can tell, the DMZ is doing its job and allowing all ports through, inbound and outbound, TCP &amp; UDP.</div><div><br></div><div>The external SIP phones are a Cisco SPA504G and Bria on the iPhone. These are behind behind a Cisco ASA5505, which has policy inspection for SIP switched on, i.e. ALG.&nbsp;I have also tested with Bria going over 3G (so it's not behind the Cisco ASA) and had the same problem.</div><div><br></div><div>The other scenario we have is some Yealink T20P SIP phones on the same LAN segment as the FreeSWITCH box. These can make A-leg only calls into FreeSWITCH (like calling voicemail)&nbsp;and also calls to other internal SIP phones&nbsp;fine. However when they make an outbound call the problem happens again. In this case the b-leg of the calls are sent to an external SIP provider and get cut after 30 seconds. Incidentally, we also use the same SIP provider from an Asterisk box in our data centre and that doesn't have a problem, so I believe the SIP provider is fine.</div><div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br>Kind regards,<br><br>Matthew Ralston<br>Web Developer &amp; IT Consultant<br><br><a href="mailto:matt@mralston.co.uk">matt@mralston.co.uk</a><br>www.mralston.com<br></span>
</div>
<br><div><div>On 22 Jun 2011, at 14:21, Chris Chen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Matthew, this is typical behavior for the setup of SIP behind NAT.<div>&nbsp; &nbsp;</div><div>&nbsp; &nbsp; 1) Please provide the exact setup of remote SIP phones, what's the router model, does it have SIP ALG enabled, what kind&nbsp; of SIP phones&nbsp;</div>
<div>&nbsp; &nbsp; 2)</div><div><br><br><div class="gmail_quote">On Wed, Jun 22, 2011 at 8:38 AM, Matthew Ralston <span dir="ltr">&lt;<a href="mailto:freeswitch@mralston.com">freeswitch@mralston.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I'm having a problem at the moment with calls being successfully set up, with two-way audio, being terminated by FreeSWITCH after 30 seconds.<br>
<br>
Internal calls (i.e. between SIP phones on the same LAN segment as the FreeSWITCH box) work flawlessly.<br>
<br>
The problem arises when at least one of the handsets is located elsewhere on the Internet. This behaviour is exhibited under the following circumstances:<br>
<br>
- A-leg only call, e.g. to voicemail when the handset is at another location on the Internet<br>
- A-leg-B-leg call if one or both of the handsets are at another location on the Internet<br>
- Inbound calls from our external SIP provider<br>
- Outbound calls to our external SIP provider<br>
<br>
So it is obvious that the problem is related to the SIP going via the Internet, but I'm having trouble understanding why.<br>
<br>
Whilst debugging this problem I have placed the FreeSWITCH box is in the DMZ on our router, so there should not be any ports blocked. The FreeSWITCH box itself is not running a software firewall.<br>
<br>
The calls themselves are absolutely fine for the first 30 seconds - each party can hear the other talking fine.<br>
<br>
The fact that the call is consistently dropped after 30 seconds (give or take a second or two for PDD) suggests that some timeout is being triggered.<br>
<br>
When FreeSWITCH terminates the call, the following is logged to the console:<br>
<br>
2011-06-22 13:33:50.514941 [DEBUG] sofia.c:4787 Channel <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> entering state [terminating][0]<br>
2011-06-22 13:33:50.514941 [DEBUG] switch_channel.c:2641 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) Callstate Change ACTIVE -&gt; HANGUP<br>
2011-06-22 13:33:50.514941 [NOTICE] sofia.c:5508 Hangup <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> [CS_EXECUTE] [NORMAL_UNSPECIFIED]<br>
2011-06-22 13:33:50.514941 [DEBUG] switch_channel.c:2657 Send signal <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> [KILL]<br>
2011-06-22 13:33:50.514941 [DEBUG] switch_core_session.c:1118 Send signal <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> [BREAK]<br>
2011-06-22 13:33:50.534966 [DEBUG] switch_ivr_play_say.c:1649 done playing file<br>
2011-06-22 13:33:50.625988 [DEBUG] switch_ivr_play_say.c:244 Handle play-file:[voicemail/vm-press.wav] (en:en)<br>
2011-06-22 13:33:50.727027 [DEBUG] switch_core_session.c:2063 <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> skip receive message [APPLICATION_EXEC_COMPLETE] (channel is hungup already)<br>
2011-06-22 13:33:50.727027 [DEBUG] switch_core_state_machine.c:371 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) State EXECUTE going to sleep<br>
2011-06-22 13:33:50.727027 [DEBUG] switch_core_state_machine.c:325 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) Running State Change CS_HANGUP<br>
2011-06-22 13:33:50.727027 [DEBUG] switch_core_state_machine.c:565 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) State HANGUP<br>
2011-06-22 13:33:50.727027 [DEBUG] mod_sofia.c:458 Channel <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> hanging up, cause: NORMAL_UNSPECIFIED<br>
2011-06-22 13:33:50.727027 [DEBUG] switch_core_state_machine.c:46 <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> Standard HANGUP, cause: NORMAL_UNSPECIFIED<br>
2011-06-22 13:33:50.727027 [DEBUG] switch_core_state_machine.c:565 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) State HANGUP going to sleep<br>
2011-06-22 13:33:50.727027 [DEBUG] switch_core_state_machine.c:356 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) State Change CS_HANGUP -&gt; CS_REPORTING<br>
2011-06-22 13:33:50.727027 [DEBUG] switch_core_session.c:1118 Send signal <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> [BREAK]<br>
2011-06-22 13:33:50.727027 [DEBUG] switch_core_state_machine.c:325 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) Running State Change CS_REPORTING<br>
2011-06-22 13:33:50.727027 [DEBUG] switch_core_state_machine.c:625 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) State REPORTING<br>
2011-06-22 13:33:50.740064 [DEBUG] switch_core_state_machine.c:53 <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> Standard REPORTING, cause: NORMAL_UNSPECIFIED<br>
2011-06-22 13:33:50.740064 [DEBUG] switch_core_state_machine.c:625 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) State REPORTING going to sleep<br>
2011-06-22 13:33:50.740064 [DEBUG] switch_core_state_machine.c:350 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) State Change CS_REPORTING -&gt; CS_DESTROY<br>
2011-06-22 13:33:50.740064 [DEBUG] switch_core_session.c:1118 Send signal <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> [BREAK]<br>
2011-06-22 13:33:50.740064 [DEBUG] switch_core_session.c:1290 Session 5 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) Locked, Waiting on external entities<br>
2011-06-22 13:33:50.740064 [NOTICE] switch_core_session.c:1308 Session 5 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) Ended<br>
2011-06-22 13:33:50.740064 [NOTICE] switch_core_session.c:1310 Close Channel <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> [CS_DESTROY]<br>
2011-06-22 13:33:50.740064 [DEBUG] switch_core_state_machine.c:454 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) Callstate Change HANGUP -&gt; DOWN<br>
2011-06-22 13:33:50.740064 [DEBUG] switch_core_state_machine.c:457 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) Running State Change CS_DESTROY<br>
2011-06-22 13:33:50.740064 [DEBUG] switch_core_state_machine.c:467 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) State DESTROY<br>
2011-06-22 13:33:50.740064 [DEBUG] mod_sofia.c:363 <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> SOFIA DESTROY<br>
2011-06-22 13:33:50.780056 [DEBUG] switch_nat.c:570 unmapped public port 31484 protocol UDP to localport 31484<br>
2011-06-22 13:33:50.840070 [DEBUG] switch_nat.c:570 unmapped public port 31485 protocol UDP to localport 31485<br>
2011-06-22 13:33:50.840070 [DEBUG] switch_core_state_machine.c:60 <a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a> Standard DESTROY<br>
2011-06-22 13:33:50.840070 [DEBUG] switch_core_state_machine.c:467 (<a href="mailto:sofia/internal/1006@public.ip.removed">sofia/internal/1006@public.ip.removed</a>) State DESTROY going to sleep<br>
<br>
The above example was from an externally situated SIP phone ringing voicemail (4000) on FreeSWITCH.<br>
<br>
I have experimented changing various timers and timeouts in the config of FreeSWITCH (one at a time, being careful to put them back afterwards!) but been unable to resolve the issue.<br>
<br>
Incidentally, we have no long term intention of running off-site SIP phones with the PBX and I'm hoping not to have to leave it in the DMZ either, it's just like that for debugging. What is a real issue is the calls to our external SIP provider (i.e. outbound calls) being dropped.<br>

<br>
Any suggestions would be greatly appreciated.<br>
<br>
Thanks,<br>
<br>
Matthew Ralston<br>
Web Developer &amp; IT Consultant<br>
<br>
<a href="mailto:matt@mralston.co.uk">matt@mralston.co.uk</a><br>
<a href="http://www.mralston.com/" target="_blank">www.mralston.com</a><br>
<br>
<br>
_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br></div>
_______________________________________________<br>Join us at ClueCon 2011, Aug 9-11, Chicago<br><a href="http://www.cluecon.com">http://www.cluecon.com</a> 877-7-4ACLUE<br><br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>http://www.freeswitch.org<br></blockquote></div><br></div></body></html>