<div dir="ltr"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail-post-text">

<p>I've installed <strong>freeswitch into a local environment</strong> and I perform SIP calls well using the server local IP.</p>

<p>This server has connected to ADSL network with a <strong>static public IP</strong> but when I try to call using the public IP instead of the local IP the server receive the call not work... </p>

<p>The clients can register well (or I think so). Others process like apache work well.</p>

<p>I NAT forwarding in the firewall the next ports: 5060, 5080, 7443.</p>

<p><strong>$ netstat -putan</strong></p>

<pre><code>Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 <a href="http://192.168.230.143:2855">192.168.230.143:2855</a>    0.0.0.0:*               LISTEN      15894/freeswitch
tcp        0      0 <a href="http://192.168.230.143:2856">192.168.230.143:2856</a>    0.0.0.0:*               LISTEN      15894/freeswitch
tcp        0      0 <a href="http://192.168.230.143:5066">192.168.230.143:5066</a>    0.0.0.0:*               LISTEN      15894/freeswitch
tcp        0      0 <a href="http://0.0.0.0:80">0.0.0.0:80</a>              0.0.0.0:*               LISTEN      1166/nginx -g daemo
tcp        0      0 <a href="http://192.168.230.143:7443">192.168.230.143:7443</a>    0.0.0.0:*               LISTEN      15894/freeswitch
tcp        0      0 <a href="http://0.0.0.0:22">0.0.0.0:22</a>              0.0.0.0:*               LISTEN      1079/sshd       
tcp        0      0 <a href="http://192.168.230.143:5080">192.168.230.143:5080</a>    0.0.0.0:*               LISTEN      15894/freeswitch
tcp        0      0 <a href="http://0.0.0.0:443">0.0.0.0:443</a>             0.0.0.0:*               LISTEN      1166/nginx -g daemo
tcp        0      0 <a href="http://192.168.230.143:5060">192.168.230.143:5060</a>    0.0.0.0:*               LISTEN      15894/freeswitch
tcp        0      0 <a href="http://192.168.230.143:22">192.168.230.143:22</a>      <a href="http://192.168.230.167:60298">192.168.230.167:60298</a>   ESTABLISHED 14816/sshd: ubuntu 
tcp        0      0 <a href="http://192.168.230.143:22">192.168.230.143:22</a>      <a href="http://192.168.230.167:60296">192.168.230.167:60296</a>   ESTABLISHED 14744/sshd: ubuntu 
tcp6       0      0 :::80                   :::*                    LISTEN      1166/nginx -g daemo
tcp6       0      0 :::8021                 :::*                    LISTEN      15894/freeswitch
tcp6       0      0 :::22                   :::*                    LISTEN      1079/sshd       
tcp6       0      0 ::1:5080                :::*                    LISTEN      15894/freeswitch
tcp6       0      0 :::443                  :::*                    LISTEN      1166/nginx -g daemo
tcp6       0      0 ::1:5060                :::*                    LISTEN      15894/freeswitch
udp        0      0 <a href="http://192.168.230.143:5060">192.168.230.143:5060</a>    0.0.0.0:*                           15894/freeswitch
udp        0      0 <a href="http://192.168.230.143:5080">192.168.230.143:5080</a>    0.0.0.0:*                           15894/freeswitch
udp        0      0 <a href="http://0.0.0.0:68">0.0.0.0:68</a>              0.0.0.0:*                           1019/dhclient   
udp6       0      0 ::1:5060                :::*                                15894/freeswitch
udp6       0      0 ::1:5080                :::*                                15894/freeswitch
</code></pre>

<p><strong>$ fs_cli -x "sofia status"</strong></p>

<pre><code>                     Name      Type                                       Data  State
=================================================================================================
            external-ipv6   profile                   sip:mod_sofia@[::1]:5080  RUNNING (0)
          192.168.230.143     alias                                   internal  ALIASED
                 external   profile         <a href="http://sip:mod_sofia@192.168.230.143:5080">sip:mod_sofia@192.168.230.143:5080</a>  RUNNING (0)
    external::<a href="http://example.com">example.com</a>   gateway                    <a href="mailto:sip%3Ajoeuser@example.com">sip:joeuser@example.com</a>  NOREG
            internal-ipv6   profile                   sip:mod_sofia@[::1]:5060  RUNNING (0)
                 internal   profile         <a href="http://sip:mod_sofia@192.168.230.143:5060">sip:mod_sofia@192.168.230.143:5060</a>  RUNNING (0)
=================================================================================================
</code></pre>

<p><strong>$ fs_cli -x "sofia status profile external"</strong></p>

<pre><code>=================================================================================================
Name                external
Domain Name         N/A
Auto-NAT            false
DBName              sofia_reg_external
Pres Hosts          
Dialplan            XML
Context             public
Challenge Realm     auto_to
RTP-IP              192.168.230.143
SIP-IP              192.168.230.143
URL                 <a href="http://sip:mod_sofia@192.168.230.143:5080">sip:mod_sofia@192.168.230.143:5080</a>
BIND-URL            sip:mod_sofia@192.168.230.143:5080;transport=udp,tcp
HOLD-MUSIC          local_stream://moh
OUTBOUND-PROXY      N/A
CODECS IN           OPUS,G722,PCMU,PCMA,VP8,H264
CODECS OUT          OPUS,G722,PCMU,PCMA,VP8,H264
TEL-EVENT           101
DTMF-MODE           rfc2833
CNG                 13
SESSION-TO          0
MAX-DIALOG          0
NOMEDIA             false
LATE-NEG            true
PROXY-MEDIA         false
ZRTP-PASSTHRU       true
AGGRESSIVENAT       false
CALLS-IN            0
FAILED-CALLS-IN     0
CALLS-OUT           0
FAILED-CALLS-OUT    0
REGISTRATIONS       0
</code></pre>

<p><strong>$ grep -r '"ext-' *</strong></p>

<pre><code>sip_profiles/external.xml:    <param name="ext-rtp-ip" value="auto-nat"/>
sip_profiles/external.xml:    <param name="ext-rtp-ip" value="auto-nat"/>
sip_profiles/internal.xml:    <param name="ext-rtp-ip" value="auto-nat"/>
sip_profiles/internal.xml:    <param name="ext-sip-ip" value="auto-nat"/>
</code></pre>

<p>When I perform a call the freeswitch.log file show:</p>

<pre><code>df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:44:51.218939 [NOTICE] switch_channel.c:1104 New Channel sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a> [df895d9a-30f2-40b5-97bb-56e222c1c45f]
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:44:51.218939 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) Running State Change CS_NEW (Cur 1 Tot 7)
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:44:51.218939 [DEBUG] sofia.c:10067 sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a> receiving invite from <a href="http://88.33.111.22:57076">88.33.111.22:57076</a> version: 1.9.0 -493-13f2f2a 64bit
2017-07-18 14:44:51.218939 [DEBUG] sofia.c:10238 IP 88.33.111.22 Rejected by acl "domains". Falling back to Digest auth.
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:44:51.218939 [DEBUG] switch_core_state_machine.c:603 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) State NEW
2017-07-18 14:44:51.218939 [DEBUG] sofia.c:2405 detaching session df895d9a-30f2-40b5-97bb-56e222c1c45f
</code></pre>

<p>and passed some seconds:</p>

<pre><code>df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [WARNING] switch_core_state_machine.c:687 df895d9a-30f2-40b5-97bb-56e222c1c45f sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a> Abandoned
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [NOTICE] switch_core_state_machine.c:690 Hangup sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a> [CS_NEW] [WRONG_CALL_STATE]
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) Running State Change CS_HANGUP (Cur 1 Tot 7)
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:850 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) Callstate Change DOWN -> HANGUP
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:852 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) State HANGUP
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] mod_sofia.c:449 Channel sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a> hanging up, cause: WRONG_CALL_STATE
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:60 sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a> Standard HANGUP, cause: WRONG_CALL_STATE
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:852 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) State HANGUP going to sleep
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:619 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) State Change CS_HANGUP -> CS_REPORTING
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) Running State Change CS_REPORTING (Cur 1 Tot 7)
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:938 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) State REPORTING
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:174 sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a> Standard REPORTING, cause: WRONG_CALL_STATE
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:938 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) State REPORTING going to sleep
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:610 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) State Change CS_REPORTING -> CS_DESTROY
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_session.c:1713 Session 7 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) Locked, Waiting on external entities
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [NOTICE] switch_core_session.c:1731 Session 7 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) Ended
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [NOTICE] switch_core_session.c:1735 Close Channel sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a> [CS_DESTROY]
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:741 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) Running State Change CS_DESTROY (Cur 0 Tot 7)
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:751 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) State DESTROY
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] mod_sofia.c:354 sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a> SOFIA DESTROY
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:181 sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a> Standard DESTROY
df895d9a-30f2-40b5-97bb-56e222c1c45f 2017-07-18 14:45:01.258940 [DEBUG] switch_core_state_machine.c:751 (sofia/internal/<a href="http://1009@192.168.230.143:5060">1009@192.168.230.143:5060</a>) State DESTROY going to sleep
</code></pre>

<p>Can it be an ACL or sip_profile bad configuration?? Router firewall configuration maybe?</p></div></div></div></div></div></div></div></div></div></div></div>
</div>