Can't receive/place calls to PSTN after upgrade to 2.3.0

I had a working zaptel/asterisk/freepbx system. Then I decided to exchange an analogue phone ext101 for a snom SIP/101 extension. I moved the analogue phone to ext100 and then all my extensions quit working. So I then moved it to x109 and then my extensions resumed function, but x109 was “I’m sorry that number is unavailable, please try again.” So I decided to upgrade from freepbx-2.3.0beta1.0
to 2.3.0 and also updated all modules. I also upgraded asterisk and the rest of my gentoo x86 system. Now all the internal extensions work just fine, but I can no longer make/receive calls to the PSTN.

My /etc/zaptel.conf (by genzaptelconf):

Span 1: WCTDM/0 “Wildcard TDM400P REV I Board 1”

fxols=1
fxols=2

channel 3, WCTDM, no module.

channel 4, WCTDM, no module.

Span 2: WCTDM/1 “Wildcard TDM400P REV I Board 2”

fxsks=5
fxsks=6
fxsks=7

channel 8, WCTDM, no module.

Global data

loadzone = us
defaultzone = us

ztcfg -vvvv | grep -v “^$”

Zaptel Configuration

Channel map:
Channel 01: FXO Loopstart (Default) (Slaves: 01)
Channel 02: FXO Loopstart (Default) (Slaves: 02)
Channel 05: FXS Kewlstart (Default) (Slaves: 05)
Channel 06: FXS Kewlstart (Default) (Slaves: 06)
Channel 07: FXS Kewlstart (Default) (Slaves: 07)
5 channels configured.

I set channels 5,6,7 as group 0 (PSTN Trunk ZAP/g0) in zapata-channels.conf using fxs_ks
and channels 1,2 as group 1 with fxo_ls

All internal calls work just fine. If I dial x102 (channel 2) the analog phone rings and I can talk OK so fxo_ls is working fine for Board #1. If I try to make an outgoing call using PSTN trunk g0, I hear one ring/click and then the call goes dead. The same thing happens when a call comes in on PSTN trunk ZAP/g0.

Here’s a verbose asterisk log when trying to make an outside call:
pbx*CLI>
Connected to Asterisk 1.2.21.1 currently running on pbx (pid = 32642)
Verbosity is at least 9
– Remote UNIX connection
– Executing Set(“SIP/104-08217900”, “EMERGENCYROUTE=YES”) in new stack
– Executing Macro(“SIP/104-08217900”, “dialout-trunk|1|7108097||”) in new stack
– Executing Set(“SIP/104-08217900”, “DIAL_TRUNK=1”) in new stack
– Executing Set(“SIP/104-08217900”, “DIAL_NUMBER=7108097”) in new stack
– Executing Set(“SIP/104-08217900”, “ROUTE_PASSWD=”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “1?noauth”) in new stack
– Goto (macro-dialout-trunk,s,6)
– Executing GotoIf(“SIP/104-08217900”, “0?disabletrunk|1”) in new stack
– Executing Set(“SIP/104-08217900”, “_NODEST=”) in new stack
– Executing Set(“SIP/104-08217900”, “DIAL_TRUNK_OPTIONS=Ttrw”) in new stack
– Executing Set(“SIP/104-08217900”, “GROUP()=OUT_1”) in new stack
– Executing Macro(“SIP/104-08217900”, “user-callerid|SKIPTTL”) in new stack
– Executing NoOp(“SIP/104-08217900”, “user-callerid: device 104”) in new stack
– Executing Set(“SIP/104-08217900”, “AMPUSER=104”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “0?report”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “0?start”) in new stack
– Executing Set(“SIP/104-08217900”, “REALCALLERIDNUM=104”) in new stack
– Executing NoOp(“SIP/104-08217900”, “REALCALLERIDNUM is 104”) in new stack
– Executing Set(“SIP/104-08217900”, “AMPUSER=104”) in new stack
– Executing Set(“SIP/104-08217900”, “AMPUSERCIDNAME=Jeremy”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “0?report”) in new stack
– Executing Set(“SIP/104-08217900”, “AMPUSERCID=104”) in new stack
– Executing Set(“SIP/104-08217900”, “CALLERID(all)=“Jeremy” <104>”) in new stack
– Executing Set(“SIP/104-08217900”, “REALCALLERIDNUM=104”) in new stack
– Executing NoOp(“SIP/104-08217900”, “TTL: ARG1: SKIPTTL”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,23)
– Executing NoOp(“SIP/104-08217900”, “Using CallerID “Jeremy” <104>”) in new stack
– Executing Macro(“SIP/104-08217900”, “record-enable|104|OUT”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing AGI(“SIP/104-08217900”, “recordingcheck|20070906-062551|1189074351.12”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20070906-062551|1189074351.12: Outbound recording not enabled
– AGI Script recordingcheck completed, returning 0
– Executing NoOp(“SIP/104-08217900”, “No recording needed”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “0?skipoutcid”) in new stack
– Executing Set(“SIP/104-08217900”, “DIAL_TRUNK_OPTIONS=trWT”) in new stack
– Executing Macro(“SIP/104-08217900”, “outbound-callerid|1”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “1?start”) in new stack
– Goto (macro-outbound-callerid,s,3)
– Executing NoOp(“SIP/104-08217900”, “REALCALLERIDNUM is 104”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,9)
– Executing Set(“SIP/104-08217900”, “USEROUTCID=Jeremy [email protected]”) in new stack
– Executing Set(“SIP/104-08217900”, “EMERGENCYCID=7577878743”) in new stack
– Executing Set(“SIP/104-08217900”, “TRUNKOUTCID=ACJLaw <757-787-8743>”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “0?trunkcid”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “0?trunkcid”) in new stack
– Executing Set(“SIP/104-08217900”, “CALLERID(all)=7577878743”) in new stack
– Executing Goto(“SIP/104-08217900”, “report”) in new stack
– Goto (macro-outbound-callerid,s,22)
– Executing NoOp(“SIP/104-08217900”, “CallerID set to “” <7577878743>”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “0?nomax”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “0?chanfull”) in new stack
– Executing AGI(“SIP/104-08217900”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
> fixlocalprefix: Using pattern 1NXXNXXXXXX
> fixlocalprefix: Using pattern NXXNXXXXXX
> fixlocalprefix: Using pattern NXXXXXX
== fixlocalprefix: Dialpattern NXXXXXX matched. 7108097 -> 7108097
– AGI Script fixlocalprefix completed, returning 0
– Executing Set(“SIP/104-08217900”, “OUTNUM=7108097”) in new stack
– Executing Set(“SIP/104-08217900”, “custom=ZAP/g0”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “1?gocall”) in new stack
– Goto (macro-dialout-trunk,s,22)
– Executing GotoIf(“SIP/104-08217900”, “0?customtrunk”) in new stack
– Executing Dial(“SIP/104-08217900”, “ZAP/g0/7108097|300|trWT”) in new stack
– Called g0/7108097
– Zap/5-1 answered SIP/104-08217900
– Hungup ‘Zap/5-1’
== Spawn extension (macro-dialout-trunk, s, 23) exited non-zero on ‘SIP/104-08217900’ in macro ‘dialout-trunk’
== Spawn extension (macro-dialout-trunk, s, 23) exited non-zero on ‘SIP/104-08217900’
– Executing Macro(“SIP/104-08217900”, “hangupcall”) in new stack
– Executing ResetCDR(“SIP/104-08217900”, “w”) in new stack
– Executing NoCDR(“SIP/104-08217900”, “”) in new stack
– Executing GotoIf(“SIP/104-08217900”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing GotoIf(“SIP/104-08217900”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing GotoIf(“SIP/104-08217900”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,11)
– Executing Hangup(“SIP/104-08217900”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/104-08217900’ in macro ‘hangupcall’
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/104-08217900’

And an incoming call:
pbx*CLI> set verbose 9
Verbosity was 0 and is now 9
– Starting simple switch on ‘Zap/5-1’
– Executing Set(“Zap/5-1”, “__FROM_DID=s”) in new stack
– Executing Gosub(“Zap/5-1”, “app-blacklist-check|s|1”) in new stack
– Executing LookupBlacklist(“Zap/5-1”, “”) in new stack
– Executing GotoIf(“Zap/5-1”, “0?blacklisted”) in new stack
– Executing Return(“Zap/5-1”, “”) in new stack
– Executing GotoIf(“Zap/5-1”, “0 ?cidok”) in new stack
– Executing Set(“Zap/5-1”, “CALLERID(name)=”) in new stack
– Executing NoOp(“Zap/5-1”, “CallerID is “” <>”) in new stack
– Executing Ringing(“Zap/5-1”, “”) in new stack
– Executing Set(“Zap/5-1”, "[email protected]") in new stack
– Executing Answer(“Zap/5-1”, “”) in new stack
– Executing Wait(“Zap/5-1”, “0”) in new stack
– Executing Goto(“Zap/5-1”, “app-daynight|2|1”) in new stack
– Goto (app-daynight,2,1)
– Executing GotoIf(“Zap/5-1”, “0?ivr-3|s|1:timeconditions|1|1”) in new stack
– Goto (timeconditions,1,1)
– Executing GotoIfTime(“Zap/5-1”, “08:30-17:15|mon-fri|1-31|jan-dec?ivr-2|s|1”) in new stack
– Executing Goto(“Zap/5-1”, “ivr-3|s|1”) in new stack
– Goto (ivr-3,s,1)
– Executing Set(“Zap/5-1”, “LOOPCOUNT=0”) in new stack
– Executing Set(“Zap/5-1”, “__DIR-CONTEXT=default”) in new stack
– Executing Set(“Zap/5-1”, “_IVR_CONTEXT_ivr-3=”) in new stack
– Executing Set(“Zap/5-1”, “_IVR_CONTEXT=ivr-3”) in new stack
– Executing GotoIf(“Zap/5-1”, “1?begin”) in new stack
– Goto (ivr-3,s,8)
– Executing Set(“Zap/5-1”, “TIMEOUT(digit)=3”) in new stack
– Digit timeout set to 3
– Executing Set(“Zap/5-1”, “TIMEOUT(response)=10”) in new stack
– Response timeout set to 10
– Executing BackGround(“Zap/5-1”, “custom/MY_Closed&custom/MY_Extensions”) in new stack
– Playing ‘custom/MY_Closed’ (language ‘en’)
– Playing ‘custom/MY_Extensions’ (language ‘en’)
– Executing WaitExten(“Zap/5-1”, “|”) in new stack
– Timeout on Zap/5-1, going to ‘t’
– Executing Goto(“Zap/5-1”, “loop|1”) in new stack
– Goto (ivr-3,loop,1)
– Executing Set(“Zap/5-1”, “LOOPCOUNT=1”) in new stack
– Executing GotoIf(“Zap/5-1”, “0?hang|1”) in new stack
– Executing Goto(“Zap/5-1”, “ivr-3|s|begin”) in new stack
– Goto (ivr-3,s,8)
– Executing Set(“Zap/5-1”, “TIMEOUT(digit)=3”) in new stack
– Digit timeout set to 3
– Executing Set(“Zap/5-1”, “TIMEOUT(response)=10”) in new stack
– Response timeout set to 10
– Executing BackGround(“Zap/5-1”, “custom/MY_Closed&custom/MY_Extensions”) in new stack
– Playing ‘custom/MY_Closed’ (language ‘en’)
– Playing ‘custom/MY_Extensions’ (language ‘en’)
– Executing WaitExten(“Zap/5-1”, “|”) in new stack
– Timeout on Zap/5-1, going to ‘t’
– Executing Goto(“Zap/5-1”, “loop|1”) in new stack
– Goto (ivr-3,loop,1)
– Executing Set(“Zap/5-1”, “LOOPCOUNT=2”) in new stack
– Executing GotoIf(“Zap/5-1”, “0?hang|1”) in new stack
– Executing Goto(“Zap/5-1”, “ivr-3|s|begin”) in new stack
– Goto (ivr-3,s,8)
– Executing Set(“Zap/5-1”, “TIMEOUT(digit)=3”) in new stack
– Digit timeout set to 3
– Executing Set(“Zap/5-1”, “TIMEOUT(response)=10”) in new stack
– Response timeout set to 10
– Executing BackGround(“Zap/5-1”, “custom/MY_Closed&custom/MY_Extensions”) in new stack
– Playing ‘custom/MY_Closed’ (language ‘en’)

================================
Does anybody have a clue as to what might have broken?
Why doesn’t the phone ring
when I place an outside call?:
– Called g0/7108097
– Zap/5-1 answered SIP/104-08217900
– Hungup ‘Zap/5-1’

In the meantime I’ve stopped asterisk, and have reverted to the old analog PSTN (so my 3 PSTN lines are OK)

THANKS for any ideas.

I’ve done some more testing. When I call in from the PSTN to Asterisk, asterisk answers and says that it’s plaing my Welcom message then my List-of-extensions. I hear my cell phone ringing, then asterisk answers (I hear a click) then I hear nothing more, even though asterisk says its Backgrounding my Announcements. Then when asterisk’s IVR determines that I’ve timedout, it then dials my default Receptionist @ SIP/101 and that phone rings. If I go over to that phone and pick it up, asterisk shows that the call has been answered, but if I talk into either that sip phone or my cell phone I can’t hear a thing on the other end. Then when I hang up (either the cell phone or the sip phone) asterisk shows that the call has terminated.

I had a similar issue. I fixed my issue by making sure the paths to php executable was found. I created a symbolic link to do so. Some FreePBX scripts use the “/usr/bin/env php” so if you php binary isn’t found, then it won’t work. Another possibility could be the codecs you are using.

If I dial 7777 (simulate incoming call), Asterisk plays “Thanks for calling …, please press 2 for …” so the mpg123 stuff appears to be working. It’s only when I place calls to/from PSTN that I can’t hear a thing after asterisk answers.

I was under the impression that the ZAP/3-1 or ZAP/g1 syntax was only for digital channels?

I’ve always used ZAP/1 ZAP/2 etc. with TDM Analog cards, and this appears to work fine.

I define each FXO as a trunk in FreePBX, then add the appropriate set of trunks to an outbound route.

The ZAP/3-1 is an internal asterisk syntax - it’s ZAP/3 call 1 i think. And you can group zap channels - it does not matter if they are digital or analog - as long as they are zap. But for an answer to the original question - i don’t know. Try to get some more logging set debug 999 and set verbose 999 and check the /var/log/asterisk/full for more info.

I did some more troubleshooting this afternoon. I realized that all these problems started after I replaced the Receptionist’s x101 ZAP/1 analog phone with a SIP/101 Snom360 iphone, and moved the old analog phone to x109.

So I made a 2D chart with FROM extensions along the left and TO extensions along the top. Then I placed either an X or Check mark in each cell depending on whethor the connection worked. I found out that in my dialplan any SIP extenion could dial another SIP extension. Any ZAP extension could also connect to any other SIP extension. But neither SIP nor ZAP extensions could connect to another ZAP extension. And of course no connections could be made to PSTN ZAP/g0. So something is borked.

So next I deleted both ZAP extensions, and voila now my PSTN ZAP/g0 trunk works.
So now I went back to the FreePBX extension screen and added a new ZAP extension, after which my ZAP/g0 trunk broke again. I’ve verified this repeatedly, that adding a ZAP extension breaks my ZAP/g0 trunk. Of course, FreePBX used to be able to add a ZAP extension without these problems.

Is anybody else able to delete their ZAP extensions, then re-create them without breaking their dialplan? I’m beginning to think that if I had just kept the original ZAP/1 as x101 and added a new extension for the Snom phone that none of these problems would have manifested themselves. So either something is broken in the new FreePBX or my FreePBX is broken somehow. The good news I suppose is that my TDM400P cards aren’t toast.

THANKS

To the best of my memory, the portion of code that you are referring to has not been changed between 2.2 and 2.3. You can always fire up a virtual machine loaded with 2.2, put in the same configuration and compare it against what 2.3 generates. The places to look are the zapata_additional.conf and related zapata.conf files that you have manually configured. It does sound like a configuration issue but if you detect an anomaly with our configuration when you do the compare you can fire up a bug on the tracker for review.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

Double-checking my upgrade, I found that install_amp has a variable $sin_dir. Is that a typo?
I run a gentoo system and usually need to change my webserver path, etc.:

diff install_amp.original install_amp

13c13
< $webroot = “/var/www/html”;

$webroot = “/var/www/localhost/htdocs”;
15,16c15,16
< $ampsbin_dir = “/usr/local/sbin”; // default if not set
< $bin_dir = “/var/lib/asterisk/bin”;


$ampsbin_dir = “/usr/sbin/”; // default if not set
$bin_dir = “/var/lib/asterisk/bin/”;
18c18
< $sin_dir = “/usr/sbin”;


$sbin_dir = “/usr/sbin/”;

it’s a typo on an unused variable. $ampsbin_dir is the right variable. Revisions r5019 and r5020 removed this based on your comment though, thanks.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx