Asterisk can't connect to SIP-Provider after DSL reconnect



  • Hi all,

    I've just got a SIP-Trunk from Sipgate, before that I only had an old private accoount at sipgate. Now that both accounts are configured on my Askozia Box they don't reconnect after my DSL reconnect at 4AM…

    First thing I tried was rebooting the Askozia Box, guess what no success...

    Then I tried resetting my DSL-Modem, no success again.

    Then I rebooted pfSense and both SipGate connection's became available again!!!

    Today I had another try, first the log entry from Askozia:

    
    Nov 7 04:01:02 asterisk[1819]: NOTICE[1847]: chan_sip.c:27638 in sip_poke_noanswer: Peer 'SIP-PROVIDER-901827029526f27e0abeda' is now UNREACHABLE! Last qualify: 15
    Nov 7 04:01:28 asterisk[1819]: NOTICE[1847]: chan_sip.c:13706 in sip_reg_timeout: -- Registration for 'xxxxxxx@sipgate.de' timed out, trying again (Attempt #2)
    Nov 7 04:01:29 asterisk[1819]: NOTICE[1847]: chan_sip.c:13706 in sip_reg_timeout: -- Registration for 'yyyyyyyt0@sipconnect.sipgate.de' timed out, trying again (Attempt #2)
    Nov 7 04:01:48 asterisk[1819]: NOTICE[1847]: chan_sip.c:13706 in sip_reg_timeout: -- Registration for 'xxxxxxx@sipgate.de' timed out, trying again (Attempt #3)
    Nov 7 04:01:49 asterisk[1819]: NOTICE[1847]: chan_sip.c:13706 in sip_reg_timeout: -- Registration for 'yyyyyyyt0@sipconnect.sipgate.de' timed out, trying again (Attempt #3)
    
    

    Then I resetted the PF state's table and the connection was immediatly available:

    
    Nov 7 10:06:32 asterisk[1819]: NOTICE[1847]: chan_sip.c:21766 in handle_response_peerpoke: Peer 'SIP-PROVIDER-901827029526f27e0abeda' is now Reachable. (19ms / 2000ms)
    Nov 7 10:06:32 asterisk[1819]: NOTICE[1847]: chan_sip.c:21766 in handle_response_peerpoke: Peer 'SIP-PROVIDER-7064207814f5e087f7238c' is now Reachable. (70ms / 2000ms)
    
    

    I don't wanna reset my state's table every morning an hope one of you can give me a hint to an automatic solution



  • As no one replied I do…  ???

    There's an article about VoIP-Config:
    https://doc.pfsense.org/index.php/VoIP_Configuration

    Which contains a link to https://doc.pfsense.org/index.php/Static_Port but I don't get it right:

    In many cases you must enable advanced outbound NAT and not rewrite the source port on this traffic, such as where multiple phones must connect on a single public IP. To do so you need to not check the static port box.

    So could someone please describe a bit more detailed where this setting has to be done?

    The only other option I see is installing package "siproxd", but before I do that I'ld like to test the other options recommended in the docs!



  • seems I was hit by this bug:
    https://redmine.pfsense.org/issues/1629

    which is also discussed here:
    http://forums.askozia.com/index.php?topic=2336.0

    I'll try the script mentioned here:
    http://forum.pfsense.org/index.php?topic=18053.5

    EDIT #1:
    I went with the hint from the redmine:

    So to fix my issue i had to run this command every time the WAN IP Address changes.

    I created this script with info i found in the internet

    create /usr/local/bin/reset_states.sh

    #!/bin/sh

    Kill Udp Sip States after new wan IP

    echo "Killing States from ASTERISKIP to SIPPROVIDER" |logger;
    /sbin/pfctl -k ASTERISKIP -k SIPPROVIDER

    Change file permissions

    chmod 755 /usr/local/bin/reset_states.sh
    Edit config file /conf/config.xml

    <system>…
    <afterfilterchangeshellcmd>/usr/local/bin/reset_states.sh</afterfilterchangeshellcmd></system>

    And if I've success report with a last self-reply…

    EDIT #2:
    Half successfull, inbound is fine with the script, but outbound is still not working:

    Nov 13 15:54:36 asterisk[1819]: WARNING[1847]: chan_sip.c:3718 in retrans_pkt: Retransmission timeout reached on transmission 3971c7fc6bf2378170f10d2b1cdc2eb6@sipconnect.sipgate.de for seqno 102 (Critical Request) – See https://wiki.asterisk.org/wik
    Nov 13 15:54:36 asterisk[1819]: WARNING[1847]: chan_sip.c:3747 in retrans_pkt: Hanging up call 3971c7fc6bf2378170f10d2b1cdc2eb6@sipconnect.sipgate.de - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmission
    Nov 13 15:56:33 asterisk[1819]: WARNING[1847]: chan_sip.c:3718 in retrans_pkt: Retransmission timeout reached on transmission 18ceab0a0b43bcb822909075784c8bd4@sipconnect.sipgate.de for seqno 102 (Critical Request) – See https://wiki.asterisk.org/wik
    Nov 13 15:56:33 asterisk[1819]: WARNING[1847]: chan_sip.c:3747 in retrans_pkt: Hanging up call 18ceab0a0b43bcb822909075784c8bd4@sipconnect.sipgate.de - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmission