Zap ports not working without internet?

Discussion in 'General' started by Croc, Feb 1, 2009.

  1. Croc

    Joined:
    Jan 29, 2009
    Messages:
    19
    Likes Received:
    0
    i got few small issues with my setup but this is really big problem and i'm out of ideas how to get this working.

    if i pull adsl line out of my router (so my whole network is fine just adsl line is down) i can't make calls via pstn ports, if i keep trying it will finally work but only for one or two calls and then it stops again, internal calls to other extensions work fine but can't make calls outside, yet as soon as i reconnect adsl my pstn trunks work fine again.

    any help would be great

    TIA

    BTW this is with zap trunks only, at first i though i got issue with auto failover but when i removed my sip trunks and leave zap ports only on my outbound rout this problem is still there.
     
  2. telecomtechnician

    Joined:
    Jan 8, 2008
    Messages:
    422
    Likes Received:
    0
    Hi there
    Please answer this questions:

    1) Is the elastix server behind a NAT or firewall or connected directly to the internet?

    2) The ZAP trunk are FXO or E1, T1, ISDN?

    3) If you have sip and zap trunks you should have them in separate trunk groups and different outbound and inbound routes, is that correct?

    Based on this answers I can help you more

    Waiting for your comments

    David Medina
     
  3. Croc

    Joined:
    Jan 29, 2009
    Messages:
    19
    Likes Received:
    0
    1) Behind NAT
    2) TDM400 with 4xFXO modules
    3) Right now i removed all sip trunks.

    with such setup all works perfect as long as elastix got access to internet, if i pull the adsl line out all goes stupid :(
     
  4. telecomtechnician

    Joined:
    Jan 8, 2008
    Messages:
    422
    Likes Received:
    0
    Hi there

    1) Verify that you have configured correctly all the network parameters of the elastix server. The server has to know it is inside a LAN. THIS IS A MUST

    2) Verify that you have correctly opened or forwarded the ports in your router/firewall to allow external sip/iax registrations(if it is your case).

    In my experience, the only issues I had when I loose internet connection is the external registrations. Everything else works fine regard of the internet connection. My server is inside a LAN and the router has forwarded the appropiated ports.

    Waiting for your comments

    David Medina
     
  5. Croc

    Joined:
    Jan 29, 2009
    Messages:
    19
    Likes Received:
    0
    1) all set by hand, 192.168.1.xxx/255.255.255.0 and DG/DNS 192.168.1.1 and is working very well with extensions working still 100% for internet calls while net is down
    2) ports are forwarded but since i'm testing with internet being down that doesn't mean much
     
  6. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
  7. Croc

    Joined:
    Jan 29, 2009
    Messages:
    19
    Likes Received:
    0
    thanks for that post dicko, i got failover happening with adsl down to zap channels after changing sip address to ip instead as posted in that thread but still only 50% of time which is better but still not good enough, hope there are some other ideas someone can point out to me because my head is starting to hurt.
     
  8. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    What worked fro me was the part started by Dick (unrelated)


    snip:-


    Hi Guys,

    This has bugged me for a long time and I think I may have solved it based on some suggestions above..

    I created a SIP extension - ie 19999 and then a trunk called SIPFAIL with the below:-

    PEER DETAILS
    username=SIP EXT
    type=peer
    secret=PASS
    qualify=yes
    host=IP ADDY OF * BOX

    USER DETAILS
    type=user
    secret=PASS
    context=from-trunk

    REG STRING
    SIPEXT:pASS@IP ADDY OF * BOX

    It all registered OK and when the router was powered down, all internal EXT worked fine - turned that TRUNK off and all internal EXT failed...

    Hope this helps out - a VERY strange workaround and I hope it can be replicated..

    Let me know..

    DICK

    .
    .
    .
    (and following)


    where a faux sip trunk is attached in effect to the box itself, and this fools/short circuits the apparent aberrant asterisk looping behavior. the trunk is always there (because it is local) Voodoo, true, who knew! but it seems to work. (just don't reload sip while the internet is down)
     
  9. Croc

    Joined:
    Jan 29, 2009
    Messages:
    19
    Likes Received:
    0
    i'm getting somewhere, with extension/trunk loop failover works EVERY TIME but only till my extension try to reregister plus that fake trunk and once that fails its no more calling, even internal calls stop, any ideas??
     
  10. A.G.A.

    Joined:
    Jul 20, 2008
    Messages:
    33
    Likes Received:
    0
    try to enable managed dns lookups - put "enable=yes" in /etc/asterisk/dnsmgr.conf.

    if it helps - take a look at
    http://www.elastix.org/index.php?option ... mitstart=0

    another way - put "srvlookup=no" in sip_general_custom.conf, and call all your sip-peers by ip's, not by names.

    the first way is preferrable, but not both.
     
  11. Croc

    Joined:
    Jan 29, 2009
    Messages:
    19
    Likes Received:
    0
    i got fix, posted by lostdave on whirlpool

    nscd is your answer.

    nscd is a name server cache.

    if you run the nscd service and then point your dns on your asterisk box to localhost, it should survive outage hiccups and restarts without an internet connection.


    now you will have to configure nscd to make dns work on your box or you can replace voip provider address.com in to ip address on trunks settings which is what i done and so far it is working 100%
    i was able even reboot my box and all extensions worked plus incoming/outgoing via FXO was working as well.

    very happy for now, thanks everyone that tried to help
     
  12. A.G.A.

    Joined:
    Jul 20, 2008
    Messages:
    33
    Likes Received:
    0
    hmm... you're a little wrong :)

    caching dns is good, but not forever.

    it helps, until dns records TTL for your trunks is not expired, after that, your sip will die.

    use managed dns lookups (dnsmgr.conf), it's recommended by digium.
     
  13. Croc

    Joined:
    Jan 29, 2009
    Messages:
    19
    Likes Received:
    0
    how long is TTL? i have replaced domain names on my trunks with ip addresses so i'm guessing there shouldn't be any dns records cashed for this sip trunks.
    i had sip trunk registration fail and with this fix my extensions stay online and all works fine, had it offline for about 30min? how long should i keep it offline to be sure this is solid fix?
    dns with this fix as i said is broken and no domain gets resolved but i couldn't care less about this small issue.
     
  14. A.G.A.

    Joined:
    Jul 20, 2008
    Messages:
    33
    Likes Received:
    0
    TTL is set by original zone's DNS admin. it could be short or long, depended on his needs, you can't change it.
    if you've changed your sip names to ip's, it could be usefull to set srvlookup=no in sip_general_custom.conf - to deny asterisk resolving sip SRV records. it helped me constantly for a long time, until i changed to DNSMGR. now it works well, about month.

    using IP's for trinks is not very well, if your provider changes his IP's or uses some kind of load balancing etc...
     
  15. Croc

    Joined:
    Jan 29, 2009
    Messages:
    19
    Likes Received:
    0
    so setting enable managed dns lookups - put "enable=yes" in /etc/asterisk/dnsmgr.conf is all i have to do ?
     
  16. A.G.A.

    Joined:
    Jul 20, 2008
    Messages:
    33
    Likes Received:
    0
    yes, that's enough.
     
  17. Croc

    Joined:
    Jan 29, 2009
    Messages:
    19
    Likes Received:
    0
    did fresh install to make sure all other fixes were gone did changes as you mentioned in dnsmgr.conf and extensions act better but far from perfect :(
    where before they would go in to "no service" on lcd and stay like this now they drop off for short while and then they come back just to drop of again and so on.
    when they not working right calls from pstn lines via FXO ports don't ring which is huge problem :(
    any other ideas ? it seem i'm a lot closer to get this working right but still not quite there :(
     
  18. Croc

    Joined:
    Jan 29, 2009
    Messages:
    19
    Likes Received:
    0
    for future references
    its multi fix solution, fix posted by flexdv took care of everything going south but still had to change sip trunks domain names for ip addresses, this seem to work great.
    also in one of the threads linked by flexdv there was script to automatically swap domain names for ip addresses only when net goes down which would be even better but for now i leave this as is.
     
  19. wiseoldowl

    Joined:
    Aug 19, 2008
    Messages:
    251
    Likes Received:
    0
    I've tried to get the FreePBX folks to address this issue...see

    http://www.freepbx.org/trac/ticket/3199

    http://www.freepbx.org/trac/ticket/3505

    I don't think changing provider addresses to fixed IP's is a good idea - providers load balance their servers and if you go to a fixed IP, they could take that server down for maintenance (or for good) and you'd be pointing at a server that isn't there.

    IMHO the BEST solution would be to run a script every five minutes to check if Internet connectivity exists (it should probably ping two or three different addresses, in case one is down) and if so, disable all SIP trunks that go to a normal Internet address (then when the Internet comes back up, reverse the procedure). The problem with that is that as far as I know, there is no way to enable or disable individual trunks from outside the FreePBX GUI.

    Other attempts at finding a solution to this issue were discussed (with some topic wander) in this thread:

    http://www.elastix.org/index.php?option=com_fireboard&Itemid=55&func=view&catid=3&id=10405#10405
     
  20. A.G.A.

    Joined:
    Jul 20, 2008
    Messages:
    33
    Likes Received:
    0
    Croc, i was wrong.
    tested carefully dnsmgr option - it does not help - sip steel freezing.
    so, reverted back to IP's and srvlookup=no.
     

Share This Page