Inbound Call Issues

Hello all. I’m using Asterisk 1.4 with the GUI installed, and I’m experiencing some odd behavior with inbound calls.

Outbound calls work perfectly, but for some reason inbound calls rarely work. The only time they work is if I call out to an outside line using a phone on my PBX. Then it will accept incoming calls, but only for a short time. Whenever it doesn’t accept inbound calls, and I call in with my cell phone, there isn’t any sound at all. No ringing. No nothing. Has anyone else experienced or know the solution to this problem? Any help would be much appreciated. Thanks! :smiley:

P.S. If you need anymore info, I’ll be glad to cough it up!

Here’s a little more info.

I called Bandwidth.com, our SIP trunk provider, to run some tests, and he said that the asterisk box wasn’t accepting the invites that they were sending. I told him how it would work if I immediately called back after calling out, and he recommended to open up the firewall. Well, our asterisk box has had all ports open ever since we’ve started using it. Any ideas as to what’s going on? Because Mitel is starting to look pretty good…

can you see your provider if issue

on the asterisk console?

it may also help to see your sip.conf file

Thanks for the reply.

My provider does show up when I run sip show peers. Here’s my sip.conf. It’s not very long, but I don’t know if that’s a GUI thing or not.

[general]
context=default
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes

Most likely a nat issue. Try running ngrep and see if anything is coming in from your carrier ? Based on what you are saying it seems like nat. What kind of router are you using ?

But our network doesn’t have NAT.

The info you are looking for is in users.conf. Also what ports do you have forwarded to the asterisk box? Also do you have an ATA? If you do, you could set the ATA up to work with your SIP provider and put it in place of the Asterisk system and see if it works with the ATA…Also can you open up the CLI and copy the code of an incoming call and paste it in here. You could even have all calls go to Voicemail and leave a voicemail and see if it works then as well. What kind of phones are you using as well?

The problem is that we have no record of an incoming call in the Asterisk box, once again, unless you make an outgoing call and then immediately call back in using an outside line. I’m not using any ATAs, and I’m using Cisco 7960 telephones.

Is your asterisk PBX system assigned with a public IP Address?

Yes, the Asterisk box does have a public IP, as well as all of the phones.

Couple questions for you;

Has this ever worked right or is this a new installation?

What version of Linux are you running? It is possible that the OS itself has a firewall running on it that isn’t letting those ports in. You may need to tweak the Linux firewall in order to let the correct ports through. Since you say your machine is out on the internet with a public IP, I’d shy away from completely disabling the firewall as it does open you up more to attacks, but you could disable it temporarily for testing.

One more thing, this is an industry secret from the mainframe world that not many people know, try “IPL’ing” the machine. IPL stands for Initial Program Load. Which is, restart the system. Use IPL when talking to your boss etc. as it makes you look smarter and you don’t get all those pesky questions about why the restart fixed the problem. :smiley:

-Lyle

:laughing: Thanks for the IPL advice, Lyle.

To answer your questions, I’m running Ubuntu Desktop Hardy (8.04), so I’m not actually sure if there is any sort of firewall program built-in.

Please show us your complete sip.conf and extension.conf files. Please remove any credentials/passwords.

[quote=“Zipster90”]
To answer your questions, I’m running Ubuntu Desktop Hardy (8.04), so I’m not actually sure if there is any sort of firewall program built-in.[/quote]

What do you get if you do;

sudo ufw status

Also, Asterisk should be run without a “gui desktop”, just an FYI if you continue to have other issues. Best to run it standalone on a server.

-Lyle

Okay. I ran sudo ufw status and it said that I do not have a firewall loaded.

And yes, I do realize that I need to run asterisk without a GUI, but I accidentally downloaded the desktop version and just said what the heck. I’ll take off X windows as soon as I get this thing working.

Now, here’s the config files:

EXTENSIONS.CONF

[general]
static=yes
writeprotect=no
clearglobalvars=no
[globals]
CONSOLE=Console/dsp
IAXINFO=guest
TRUNK=Zap/G2
TRUNKMSD=1
trunk_1=SIP/trunk_1
trunk_1_cid=unknown
[dundi-e164-canonical]

[dundi-e164-customers]

[dundi-e164-via-pstn]

[dundi-e164-local]
include=dundi-e164-canonical
include=dundi-e164-customers
include=dundi-e164-via-pstn
[dundi-e164-switch]
switch=DUNDi/e164
[dundi-e164-lookup]
include=dundi-e164-local
include=dundi-e164-switch
[macro-dundi-e164]
exten=s,1,Goto(${ARG1},1)
include=dundi-e164-lookup
[iaxtel700]
exten=_91700XXXXXXX,1,Dial(IAX2/${GLOBAL(IAXINFO)}@iaxtel.com/${EXTEN:1}@iaxtel)
[iaxprovider]

[trunkint]
exten=_9011.,1,Macro(dundi-e164,${EXTEN:4})
exten=_9011.,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
[trunkld]
exten=_91NXXNXXXXXX,1,Macro(dundi-e164,${EXTEN:1})
exten=_91NXXNXXXXXX,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
[trunklocal]
exten=_9NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
[trunktollfree]
exten=_91800NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten=_91888NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten=_91877NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten=_91866NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
[international]
ignorepat=9
include=longdistance
include=trunkint
[longdistance]
ignorepat=9
include=local
include=trunkld
[local]
ignorepat=9
include=default
include=trunklocal
include=iaxtel700
include=trunktollfree
include=iaxprovider
include=parkedcalls
[macro-stdexten]
exten=s,1,Dial(${ARG2},20)
exten=s,2,Goto(s-${DIALSTATUS},1)
exten=s-NOANSWER,1,Voicemail(${ARG1},u)
exten=s-NOANSWER,2,Goto(default,s,1)
exten=s-BUSY,1,Voicemail(${ARG1},b)
exten=s-BUSY,2,Goto(default,s,1)
exten=_s-.,1,Goto(s-NOANSWER,1)
exten=a,1,VoicemailMain(${ARG1})
[macro-stdPrivacyexten]
exten=s,1,Dial(${ARG2},20|p)
exten=s,2,Goto(s-${DIALSTATUS},1)
exten=s-NOANSWER,1,Voicemail(${ARG1},u)
exten=s-NOANSWER,2,Goto(default,s,1)
exten=s-BUSY,1,Voicemail(${ARG1},b)
exten=s-BUSY,2,Goto(default,s,1)
exten=s-DONTCALL,1,Goto(${ARG3},s,1)
exten=s-TORTURE,1,Goto(${ARG4},s,1)
exten=_s-.,1,Goto(s-NOANSWER,1)
exten=a,1,VoicemailMain(${ARG1})
[macro-page]
exten=s,1,ChanIsAvail(${ARG1}|js)
exten=s,n,GoToIf([${AVAILSTATUS} = “1”]?autoanswer:fail)
exten=s,n(autoanswer),Set(_ALERT_INFO=“RA”)
exten=s,n,SIPAddHeader(Call-Info: Answer-After=0)
exten=s,n,NoOp()
exten=s,n,Dial(${ARG1}||)
exten=s,n(fail),Hangup
[demo]
exten=s,1,Wait(1)
exten=s,n,Answer
exten=s,n,Set(TIMEOUT(digit)=5)
exten=s,n,Set(TIMEOUT(response)=10)
exten=s,n(restart),BackGround(demo-congrats)
exten=s,n(instruct),BackGround(demo-instruct)
exten=s,n,WaitExten
exten=2,1,BackGround(demo-moreinfo)
exten=2,n,Goto(s,instruct)
exten=3,1,Set(LANGUAGE()=fr)
exten=3,n,Goto(s,restart)
exten=1000,1,Goto(default,s,1)
exten=1234,1,Playback(transfer,skip)
exten=1234,n,Macro(stdexten,1234,${GLOBAL(CONSOLE)})
exten=1235,1,Voicemail(1234,u)
exten=1236,1,Dial(Console/dsp)
exten=1236,n,Voicemail(1234,b)
exten=#,1,Playback(demo-thanks)
exten=#,n,Hangup
exten=t,1,Goto(#,1)
exten=i,1,Playback(invalid)
exten=500,1,Playback(demo-abouttotry)
exten=500,n,Dial(IAX2/guest@pbx.digium.com/s@default)
exten=500,n,Playback(demo-nogo)
exten=500,n,Goto(s,6)
exten=600,1,Playback(demo-echotest)
exten=600,n,Echo
exten=600,n,Playback(demo-echodone)
exten=600,n,Goto(s,6)
exten=76245,1,Macro(page,SIP/Grandstream1)
exten=_7XXX,1,Macro(page,SIP/${EXTEN})
exten=7999,1,Set(TIMEOUT(absolute)=60)
exten=7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n|d)
exten=8500,1,VoicemailMain
exten=8500,n,Goto(s,6)
[page]
exten=_X.,1,Macro(page,SIP/${EXTEN})
[default]
include=demo
exten=981,1,VoiceMailMain
exten=201,1,MeetMe(${EXTEN}|MI)
exten=o,1,Goto(default,245,1)
[macro-trunkdial]
exten=s,1,set(CALLERID(all)=${IF($[${LEN(${CALLERID(num)})} > 6]?${CALLERID(all)}:${ARG2})})
exten=s,n,Dial(${ARG1})
exten=s,n,Goto(s-${DIALSTATUS},1)
exten=s-NOANSWER,1,Hangup
exten=s-BUSY,1,Hangup
exten=_s-.,1,NoOp
[asterisk_guitools]
exten=executecommand,1,System(${command})
exten=executecommand,n,Hangup()
exten=record_vmenu,1,Answer
exten=record_vmenu,n,Playback(vm-intro)
exten=record_vmenu,n,Record(${var1})
[numberplan-custom-1]
plancomment=Default DialPlan
include=default
include=parkedcalls
exten=_9XXXXXXX!,1,Macro(trunkdial,${trunk_1}/+1${EXTEN:1},${trunk_1_cid})
comment=_9XXXXXXX!,1,General Calls,standard
exten=911,1,Macro(trunkdial,${trunk_1}/+1${EXTEN:0},${trunk_1_cid})
comment=911,1,Emergency,custom
exten=_411,1,Macro(trunkdial,${trunk_1}/+1${EXTEN:0},${trunk_1_cid})
comment=_411,1,Directory Assistance,standard
[DID_trunk_1]
include=default
exten=19402204525,1,Goto(default|200|1)
exten=+19402204525,1,Goto(${EXTEN:1}|1)
exten=19402302155,1,Goto(default|260|1)
exten=+19402302155,1,Goto(${EXTEN:1}|1)
[ringroups-custom-1]
gui_ring_groupname=Customer Service
exten=s,1,NoOp(RINGGROUP)
exten=s,n,Dial(SIP/245&SIP/230&SIP/228,20)
exten=s,n,Voicemail(245,b)
[ringroups-custom-2]
gui_ring_groupname=Technical Support
exten=s,1,NoOp(RINGGROUP)
exten=s,n,Dial(SIP/232&SIP/246&SIP/227,20)
exten=s,n,Voicemail(232,b)

SIP.CONF

[authentication]

[general]
context=default
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes

Boy I thought for sure there was a firewall issue in there somewhere. Once you made a successful outgoing call it “punched” the hole in the fw and then once things were quiet it would close up. Someone else will have to have a look at your configs as I’m pretty green on that.

Please don’t take offense to this, but check your ip on the machine to what ip address is given when you bring up a browser on your asterisk machine and go to www.whatismyip.com. Do they match? If so you are on the internet with a public ip address, if not, there is a router/firewall/something in between. You can check the ip address of the linux box by doing;

ifconfig -a

if you get a “not found” message it may not be in your path so try;

/sbin/ifconfig -a

Outside of that, I’m running out of paths to chase down for you… The only other thing I’d suggest trying is try one of the pre-built distro’s like Elastix. That’s what I’m using right now, I have a pretty simple setup and it works great for me.

-Lyle

Thanks for the help, guys. I really appreciate it. Elastix sounds like a good option, so I’ll be sure to give it a look. Also, I’d like to add that this exact same issue occurred when using trixbox as well. However, at one time, both incoming and outgoing calls worked. Only problem is that I can’t for the life of me remember when the problem started! Oh well, lessons learned, I guess.

Oh, and I do believe that the IPs match, since Bandwidth.com only allows SIP traffic from the IP on your account, and that I can access the admin page remotely by typing in the address.

If anyone has more suggestions, hit me up. Thanks again.

Try tossing Elastix on a completely separate box. I have mine running on an old laptop. Perhaps there is some weird hardware issue with your existing box for some reason. Grasping at straws here, but worth a shot and a pretty cheap and easy test.

Another thought is wiring. A buddy of mine has stated on many many occasions that 90% of problems can be directly related to wiring (he’s a telecom guy). So maybe along with above, try a different Ethernet cord, switch etc.

Good luck!

-Lyle

[quote=“Zipster90”]SIP.CONF

[authentication]

[general]
context=default
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes[/quote]
Are you sure the above is a complete sip.conf file? The reason I asked is because I don’t see any registration as well as channels configuration. I don’t claim to be an asterisk expert here; however, if I were you, I would post the necessary information for readers here to find out if there is some problems with the .conf files.

Why does the asterisk box and all phones have public IP’s? You dont need them to have PUBLIC IP’s, thats kinda scary…