Unable to accept incoming PSTN calls


#1

I am new to Asterisk and the protocol/language complex world of VoIp and PBX. But I have a dedicated machine running A@H 2.8, a single TDM400P with one FXS module card connected to a standard analog phone. The second card is an X100P connected to my analog PSTN phone line. I also have Grandsteam IP phone plugged into the network and a couple of x-lite SIP softphones. I can make outgoing calls on the Grandstream or any registered SIP sofware phone from any computer. I can also get a dial tone from the analog phone connected to the ZAP X100P port. But when incoming callas come in, none of the phones ring. No VoIP trunks, just the single ZAP trunk from the X100P. Below are my configurations and a tail of /var/log/asterisk/full when making a call from an outside line. There is much more in the extenions.conf file but I was not sure how much to include and noticed in another post that only a couple sections were included.

sip.conf:

[general]

bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
disallow=all
allow=ulaw
allow=alaw
context = from-sip-external ; Send unknown SIP callers to this context
callerid = Unknown

#include sip_nat.conf
#include sip_custom.conf
#include sip_additional.conf
#include additional_a2billing_sip.conf
extensions.conf:

extensions.conf:

; include extension contexts generated from AMP
#include extensions_additional.conf

; Customizations to this dialplan should be made in extensions_custom.conf
; See extensions_custom.conf.sample for an example
#include extensions_custom.conf

[from-trunk] ; just an alias since VoIP shouldn’t be called PSTN
include => from-pstn

[from-pstn]
include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations
include => ext-did
;exten => fax,1,Goto(ext-fax,in_fax,1)
exten => _.,1,Wait(1)
exten => _.,2,Goto(from-pstn,s,1)

var/log/asterisk/full (when recieving a call from pstn):

Apr 26 18:43:33 VERBOSE[2696] logger.c: – Remote UNIX connection
Apr 26 18:43:52 VERBOSE[25804] logger.c: – Remote UNIX connection disconnected
Apr 26 18:44:57 VERBOSE[25810] logger.c: – Starting simple switch on 'Zap/1-1’
Apr 26 18:44:59 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:00 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:00 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:00 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:00 DEBUG[2775] manager.c: Manager received command ‘Command’
Apr 26 18:45:00 DEBUG[2775] manager.c: Manager received command ‘Command’
Apr 26 18:45:01 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:01 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:01 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:01 DEBUG[25810] chan_zap.c: Exception on 17, channel 1
Apr 26 18:45:01 DEBUG[25810] chan_zap.c: Got event Ring Begin(18) on channel 1 (index 0)
Apr 26 18:45:02 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:02 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:02 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:03 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:03 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:03 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:03 DEBUG[25810] chan_zap.c: Exception on 17, channel 1
Apr 26 18:45:03 DEBUG[25810] chan_zap.c: Got event Ring/Answered(2) on channel 1 (index 0)
Apr 26 18:45:03 DEBUG[25810] chan_zap.c: Setting IDLE polarity due to ring. Old polarity was 0
Apr 26 18:45:04 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:04 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:04 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:05 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:05 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:05 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:06 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:06 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:06 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:07 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:07 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:07 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:07 DEBUG[25810] chan_zap.c: Exception on 17, channel 1
Apr 26 18:45:07 DEBUG[25810] chan_zap.c: Got event Ring Begin(18) on channel 1 (index 0)
Apr 26 18:45:08 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:08 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:08 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:09 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:09 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:09 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:09 DEBUG[25810] chan_zap.c: Exception on 17, channel 1
Apr 26 18:45:09 DEBUG[25810] chan_zap.c: Got event Ring/Answered(2) on channel 1 (index 0)
Apr 26 18:45:09 DEBUG[25810] chan_zap.c: Setting IDLE polarity due to ring. Old polarity was 0
Apr 26 18:45:10 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:10 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:10 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:11 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:11 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:11 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:12 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:12 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:12 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:13 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:13 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:13 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:13 DEBUG[25810] chan_zap.c: Exception on 17, channel 1
Apr 26 18:45:13 DEBUG[25810] chan_zap.c: Got event Ring Begin(18) on channel 1 (index 0)
Apr 26 18:45:14 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:14 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:14 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:15 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:15 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:15 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:16 DEBUG[25810] chan_zap.c: Exception on 17, channel 1
Apr 26 18:45:16 DEBUG[25810] chan_zap.c: Got event Ring/Answered(2) on channel 1 (index 0)
Apr 26 18:45:16 DEBUG[25810] chan_zap.c: Setting IDLE polarity due to ring. Old polarity was 0
Apr 26 18:45:16 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:16 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:16 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:17 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:17 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:17 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:18 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:18 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:18 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:19 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:19 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:19 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:20 DEBUG[25810] chan_zap.c: Exception on 17, channel 1
Apr 26 18:45:20 DEBUG[25810] chan_zap.c: Got event Ring Begin(18) on channel 1 (index 0)
Apr 26 18:45:20 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:20 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:20 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:21 DEBUG[25810] chan_zap.c: Exception on 17, channel 1
Apr 26 18:45:21 DEBUG[25810] chan_zap.c: Got event Ring/Answered(2) on channel 1 (index 0)
Apr 26 18:45:21 DEBUG[25810] chan_zap.c: Setting IDLE polarity due to ring. Old polarity was 0
Apr 26 18:45:22 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:22 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:22 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:23 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:23 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:23 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:24 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:24 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:24 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:25 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:25 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:25 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:26 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:26 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:26 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:27 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:27 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:27 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:28 VERBOSE[25810] logger.c: – Executing Goto(“Zap/1-1”, “from-pstn|s|1”) in new stack
Apr 26 18:45:28 VERBOSE[25810] logger.c: – Goto (from-pstn,s,1)
Apr 26 18:45:28 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:29 VERBOSE[25810] logger.c: == Spawn extension (from-pstn, s, 1) exited non-zero on ‘Zap/1-1’
Apr 26 18:45:29 VERBOSE[25810] logger.c: – Executing Wait(“Zap/1-1”, “1”) in new stack
Apr 26 18:45:29 VERBOSE[25810] logger.c: == Spawn extension (from-pstn, h, 1) exited non-zero on ‘Zap/1-1’
Apr 26 18:45:29 DEBUG[25810] cdr_addon_mysql.c: cdr_mysql: inserting a CDR record.
Apr 26 18:45:29 DEBUG[25810] cdr_addon_mysql.c: cdr_mysql: SQL command as follows: INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid) VALUES (‘2006-04-26 18:44:59’,‘6048481125’,‘6048481125’,‘s’,‘from-pstn’, ‘Zap/1-1’,’’,‘Wait’,‘1’,30,0,‘NO ANSWER’,3,’’,‘1146102297.1’)
Apr 26 18:45:29 DEBUG[25810] chan_zap.c: Hangup: channel: 1 index = 0, normal = 17, callwait = -1, thirdcall = -1
Apr 26 18:45:29 DEBUG[25810] chan_zap.c: disabled echo cancellation on channel 1
Apr 26 18:45:29 DEBUG[25810] chan_zap.c: Set option TDD MODE, value: OFF(0) on Zap/1-1
Apr 26 18:45:29 DEBUG[25810] chan_zap.c: Updated conferencing on 1, with 0 conference users
Apr 26 18:45:29 VERBOSE[25810] logger.c: – Hungup ‘Zap/1-1’


#2

Looks like your incoming call is getting sent into a loop. I would set up an inbound route to go to echo test or milliwatt in a custom context. See what happens.

TheLostPacket


#3

This seems to be the case and although I understand what an “incoming route” is, as I am anewbie, I do not know how to do what you suggested. Using A@H 2.8 and freePBX, I created a dial group to ring all extensions, and then created an inbound route with a blank DID/CID and set its destination to be the newly created ring group, but still nothing rings. Another person suggested this setting below, which seems to work but does not go to the extensions mailbox if not picked up?

[from-pstn]
include => from-pstn-custom ; create this context in
extensions_custom.conf to include customizations
include => ext-did
exten => _.,1,Wait(1)
exten => _.,2,Goto(from-pstn,s,1)
exten => s,1,Answer
exten => s,2,Dial(SIP/100,20)


#4

Well, it is not going to go to voicemail because this example did not tell it to. After the Dial command you need lines that tell it what to do if it is ‘busy’, or if nobody answers,etc.


#5

There is your problem

exten => _. matches before exten => s,1 does.

[from-pstn]
include => from-pstn-custom ; create this context in
extensions_custom.conf to include customizations
include => ext-did
exten => _.,1,Wait(1)
exten => _.,2,Goto(custom-from-pstn,s,1)

[custom-from-pstn]
exten => s,1,Answer
exten => s,2,Dial(SIP/100,20)


#6

Ok, that suggestion for the [custom-from-pstn] worked and it seems to be the “better” or “cleaner” way to implement than the earlier suggestions where everything was in the extensions.conf file. So far so good. Now what would be the syntax/command so that if it rings busy, or no answer after x rings, it goes to that extensions mailbox?

My next question, assuming I will be able to get the voicemail routing, is to get it to ring to all extensions, say through a ring group?

And THANKS big time for getting me this far. I know how painful it can be to get newbies up to speed.


#7

All these questions are easily answered from various documents such as the faq’s and wiki and just plain Google’ing. I really hate the rtfm answer but it does apply sometimes.

Read the docs on the Dial command
http://www.voip-info.org/wiki-Asterisk+cmd+Dial

To ring x times before voicemail
Dial(Sip/1,20) will ring for 20 seconds before moving on

To ring multiple phones, same document
Dial(Sip/1&Sip/2&Sip/3) Just seperate the phones with a &


#8

If you are using amp or freepbx you should really keep most of your configuration in there. You need to define the inbound number ‘1’ and send it somewhere…

TheLostPacket


#9

Hey thanks again. That is what I had tried (creating an inbound route) with a blank DID/CID, but that didnt seem to have any effect at all. From my settings for the ZAP trunk in my previous posts, can you see what I “should” have in the Incoming Route settings so I can use freePBX to make these changes. I am certainly getting closer, can ring all phones, and got o voicemail for the one mailbox, with the settings below, but I would much rather, as you suggested, to use freePBX to modify/edit the settings.

extensions.conf:
[from-pstn]
include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations
include => ext-did
exten => _.,1,Wait(1)
exten => _.,2,Goto(from-pstn-custom,s,1)

extensions_custom.conf:
[from-pstn-custom]
exten => s,1,Answer
exten => s,2,Dial(SIP/100&SIP/101&SIP/200&ZAP/2,15)
exten => s,3,Voicemail(u100)