externhost option leaves no audio?

Discussion in 'General' started by tarnok, Jul 21, 2009.

  1. tarnok

    Joined:
    Apr 20, 2009
    Messages:
    16
    Likes Received:
    0
    Hey all,

    Within my sip_nat.conf I use the following:

    Code:
    nat=yes
    externip=xxx.xxx.xx.xx
    localnet=192.168.1.0/255.255.255.0
    And it works fine however, my externip sometimes changes and I need to change the setting manually, so I decided to use my dyndns hostname instead with the following code:

    Code:
    nat=yes
    externhost=example.dyndns.org
    externrefresh=120
    localnet=192.168.1.0/255.255.255.0
    And do a "sip reload" on the command line and internally we can make outgoing calls and everything is fine. But for external extensions the phone rings and people are able to recieve and pickup calls but there is no audio!

    Once I change the setting back to externip the sound issue goes away.

    Any suggestions? I would really like to get externhost going so that I no longer have to worry about ip changes.
     
  2. donhwyo

    Joined:
    Aug 8, 2008
    Messages:
    293
    Likes Received:
    0
    Here is what I have. I used sip_general_custom.conf so it wont get over writen on an update. It may be setup differently at the router though.


    nano /etc/asterisk/sip_general_custom.conf


    Code:
    nat=no
    externhost=xxxxxxxx.dyndns.org
    loacalnet=10.x.x.x/24
    10.x.x.x/24
    
    
    bindport = 5060 ; Port to bind to (SIP is 5060)
    bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
    insecure=invite
    tos=0x68
    srvlookup=no
    
    ;alwaysauthreject=yes
    Be sure you have all the posible ports forwarded.

    Don
     
  3. tarnok

    Joined:
    Apr 20, 2009
    Messages:
    16
    Likes Received:
    0
    Hey Don,

    I havn't tried this yet as I am not in the office, but I was hoping to get a few things cleared up.

    Firstly, why do you have nat=no? Is your server not behind a firewall? Ours is so I was under the impression that nat=yes needs to be enabled.

    Second, is the line below localnet supposed to be like that, just an internal IP and nothing "=" it?

    Regards
     
  4. donhwyo

    Joined:
    Aug 8, 2008
    Messages:
    293
    Likes Received:
    0
    It is behind a firewall but ports are forwarded and it works for me. I also have a vpn connecting 2 offices so 2 local nets. I use untange.com for the firewall and vpn connections and it works well but was a little tricky to setup. Actually only the voip was tricky. They also have some voip helpers in there just to make it more confusing. But if you can beat it into submission it works very well.

    What is your firewall etc?

    Don
     
  5. tarnok

    Joined:
    Apr 20, 2009
    Messages:
    16
    Likes Received:
    0
    Hey Don,

    I am using a modified WRT54G router with the Tomato firmware as the firewall. I have all the proper ports forwarded to my server. 5060 SIP / 10001-20000 RTP and 4569 for future IAX installations.


    Today I tried the following settings:

    Code:
    nat=no
    externhost=xxxxxxxx.dyndns.org
    localnet=192.168.1.0/255.255.255.0
    externrefresh=180
    insecure=invite
    tos=0x68
    srvlookup=no
    And calls could be made internally to the external extensions and they could hear me, but I was unable to hear them which seems like the the RTP ports were being blocked.

    However once I changed it back to the original settings of
    Code:
    nat=yes
    externip=xxx.xxx.xx.xx
    localnet=192.168.1.0/255.255.255.0
    Everything was working as it should be with all parties able to hear each other.

    As an FYI after I change the settings I do a full 'reload' of asterisks.
     
  6. tarnok

    Joined:
    Apr 20, 2009
    Messages:
    16
    Likes Received:
    0
    Hey,

    So does anyone know why extenhost does this? I would really like a solution where I dont have to periodically edit the IP whenever it changes.

    Regards,
     
  7. tarnok

    Joined:
    Apr 20, 2009
    Messages:
    16
    Likes Received:
    0
    Bump, still looking for some answers to this question of why externhost leads to no audio? Can anyone help please?
     
  8. sasben2

    Joined:
    Jul 24, 2009
    Messages:
    14
    Likes Received:
    0
    AS funny as it sounds... try:

    externip=example.dyndns.org


    I did that by mistake on one installation, and it works fine for dyndns.org. I too also had one way audio when using externhost=
     
  9. sasben2

    Joined:
    Jul 24, 2009
    Messages:
    14
    Likes Received:
    0
    Usage:
    externip = IP_Address or a hostname

    The address placed in SIP messages when behind a NAT.

    If a hostname is used as the value, then the IP address associated with the hostname is looked up only once during the reading of the sip.conf and include files.

    If you want support for a hostname associated with a dynamic IP address, use externhost.


    externhost = hostname.dyndys.org

    This will ping the externhost name (perhaps based on the externrefresh=x number you also supplied, and update its records for the SIP headers.

    Note: If you ping your dyndns etc type zone and get a 127.0.0.1 or private address, you may have an issue as well. This happens when you configure mail on the box as well.
     
  10. tarnok

    Joined:
    Apr 20, 2009
    Messages:
    16
    Likes Received:
    0
    Ok I tried both externhost and externip for my host.dyndns.org addy. Both didn't work so I did a ping request within the server.

    Here are my results:
    Code:
    64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.095 ms
    Turns out sasben2 was on the right track. Am I going to need to change the host files on the server? We currently do not have email configured for others but we do have the "send voicemail to email address" setup and working. BUt since that is outbound email I do not think it will have much effect.

    Regards,
     
  11. sasben2

    Joined:
    Jul 24, 2009
    Messages:
    14
    Likes Received:
    0
    Yep. I believe you need to remove your dyndns.org domain name from your hosts.

    Your postfix should still send mail with this change.

    Note: If you want incoming mail, configure an MX record on your zone. i.e. don't let your hosts file give postfix the 127.0.0.1 for delivery. (it will work it out anyway i think)
     
  12. sasben2

    Joined:
    Jul 24, 2009
    Messages:
    14
    Likes Received:
    0
    mail test:
    echo "test" | mail -s testmessage <your email here>
     
  13. tarnok

    Joined:
    Apr 20, 2009
    Messages:
    16
    Likes Received:
    0
    Hey guys, I think I got it working.

    Commented out the two entries in /etc/hosts that had xxx.dyndns.org pointed to 127.0.0.1.
    in sip_nat.conf changed externip to externhost=xxx.dyndns.org and did an asterisk -vvvrx 'reload'.

    I called the external extensions and all seemed to be fine, both sides could hear the other.

    Thank you everyone for your help!

    My only question now is, why was those enteries in there? I didnt configure this system, a techie who isn't working here anymore did and so now I may never know.
     
  14. sasben2

    Joined:
    Jul 24, 2009
    Messages:
    14
    Likes Received:
    0
    I believe Elastix does it through the network module in the control panel. Best not to use your external zone in the configuration.

    e.g. sip.domain.com could be your external A/CNAME,
    whilst the internal could be a number of items, whatever makes sense for your network (perhaps if you have AD as well? etc etc)

    <servername>.<domain>

    pbx.local
    pbx1.local
    asterisk.internal.domain.com
    ausyd-asterisk.it.domain.com
    etc
     

Share This Page