Inbound route not working

Hello, I’m missing something basic so I’m looking for some help.

This is a new install of AsteriskNOW (Asterisk 1.6.2.11 with FreePBX upgraded to 2.9.0.6). The inbound lines are 8 analog and 4 SIP. Right now I have a ZAP g0 for the analog 1-8 channels with no DID defined. Calls come in fine and hit an IVR. I want to add a new Inbound Route to send a specific analog line to a Ring Group (basically the office’s back line) and bypass the IVR.

The old AsteriskNOW box worked fine, as soon as I defined the DID and pointed it to the Ring Group it worked. I can’t get this one to direct to the correct Ring Group it always winds up in the main IVR. Via Asterisk Info module > Channels I can watch the line ring and I see it is seven digits (i.e. 5551234) so I’ve set the Inbound Route to use that, I’ve also tried 10 digits (i.e. 7025551234) with no luck. My chan_dahdi.conf is set as context=from-zaptel with channels=1-8.

With so little needed to set this up I’m wondering about something that was missed in the 2.9 upgrade/install. One other thing to note is the old PBX did not have SIP lines.

Does anyone have a clue on this?

  • I’m wondering if I need to install a module but after looking at notes on the modules I don’t see any additional ones needed
  • the line I’m trying to intercept and re-direct is an analog one (actually there are two but neither work)
  • in the chan_dahdi.conf, should the context be zaptel or pstn?

Here’s a log file from when I dial in, besides a *** WARNING[3933] app_macro.c: No such context ‘macro-from-dahdi-7’ for macro ‘from-dahdi-7’ *** I don’t see anything wrong.

The line is ringing on inbound dahdi analog line #7


Jul 27 22:41:41] VERBOSE[3929] manager.c: == Manager ‘admin’ logged off from 127.0.0.1
[Jul 27 22:42:07] VERBOSE[3933] chan_dahdi.c: – Starting simple switch on ‘DAHDI/7-1’
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:1] NoOp(“DAHDI/7-1”, "Entering from-dahdi with DID == ") in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:2] Ringing(“DAHDI/7-1”, “”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:3] Set(“DAHDI/7-1”, “DID=s”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:4] NoOp(“DAHDI/7-1”, “DID is now s”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:5] GotoIf(“DAHDI/7-1”, “1?dahdiok:checkzap”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Goto (from-zaptel,s,9)
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:9] NoOp(“DAHDI/7-1”, “Is a DAHDi Channel”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:10] Set(“DAHDI/7-1”, “CHAN=7-1”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:11] Set(“DAHDI/7-1”, “CHAN=7”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:12] Macro(“DAHDI/7-1”, “from-dahdi-7,s,1”) in new stack
[Jul 27 22:42:08] WARNING[3933] app_macro.c: No such context ‘macro-from-dahdi-7’ for macro ‘from-dahdi-7’
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:13] NoOp(“DAHDI/7-1”, “Returned from Macro from-dahdi-7”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:14] Goto(“DAHDI/7-1”, “from-pstn,s,1”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Goto (from-pstn,s,1)
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:1] Set(“DAHDI/7-1”, “__FROM_DID=s”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:2] ExecIf(“DAHDI/7-1”, “1 ?Set(CALLERID(name)=702637XXXX)”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:3] Set(“DAHDI/7-1”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:4] Set(“DAHDI/7-1”, “CALLERPRES()=allowed_not_screened”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:5] Goto(“DAHDI/7-1”, “app-daynight,0,1”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Goto (app-daynight,0,1)
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:1] GotoIf(“DAHDI/7-1”, “0?ivr-3,s,1:timeconditions,1,1”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Goto (timeconditions,1,1)
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:1] GotoIfTime(“DAHDI/7-1”, “08:00-16:30,mon-thu,,?truestate”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:2] GotoIfTime(“DAHDI/7-1”, “08:00-15:30,fri,,?truestate”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:3] GotoIf(“DAHDI/7-1”, “0?truegoto”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:4] ExecIf(“DAHDI/7-1”, “0?Set(DB(TC/1)=)”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:5] GotoIf(“DAHDI/7-1”, “1?ivr-3,s,1”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Goto (ivr-3,s,1)
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:1] Set(“DAHDI/7-1”, “MSG=custom/AnnMainNight”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:2] Set(“DAHDI/7-1”, “LOOPCOUNT=0”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:3] Set(“DAHDI/7-1”, “__DIR-CONTEXT=”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:4] Set(“DAHDI/7-1”, “_IVR_CONTEXT_ivr-3=”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:5] Set(“DAHDI/7-1”, “_IVR_CONTEXT=ivr-3”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:6] GotoIf(“DAHDI/7-1”, “0?begin”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:7] Answer(“DAHDI/7-1”, “”) in new stack
[Jul 27 22:42:08] VERBOSE[3933] pbx.c: – Executing [[email protected]:8] Wait(“DAHDI/7-1”, “1”) in new stack
[Jul 27 22:42:10] VERBOSE[3933] pbx.c: – Executing [[email protected]:9] Set(“DAHDI/7-1”, “TIMEOUT(digit)=3”) in new stack
[Jul 27 22:42:10] VERBOSE[3933] func_timeout.c: – Digit timeout set to 3.000
[Jul 27 22:42:10] VERBOSE[3933] pbx.c: – Executing [[email protected]:10] Set(“DAHDI/7-1”, “TIMEOUT(response)=0”) in new stack
[Jul 27 22:42:10] VERBOSE[3933] func_timeout.c: – Response timeout set to 0.000
[Jul 27 22:42:10] VERBOSE[3933] pbx.c: – Executing [[email protected]:11] Set(“DAHDI/7-1”, “__IVR_RETVM=”) in new stack
[Jul 27 22:42:10] VERBOSE[3933] pbx.c: – Executing [[email protected]:12] ExecIf(“DAHDI/7-1”, “1?Background(custom/AnnMainNight)”) in new stack
[Jul 27 22:42:10] VERBOSE[3933] file.c: – <DAHDI/7-1> Playing ‘custom/AnnMainNight.slin’ (language ‘en’)
[Jul 27 22:42:13] VERBOSE[3933] pbx.c: == Spawn extension (ivr-3, s, 12) exited non-zero on ‘DAHDI/7-1’
[Jul 27 22:42:13] VERBOSE[3933] pbx.c: – Executing [[email protected]:1] Hangup(“DAHDI/7-1”, “”) in new stack
[Jul 27 22:42:13] VERBOSE[3933] pbx.c: == Spawn extension (ivr-3, h, 1) exited non-zero on ‘DAHDI/7-1’
[Jul 27 22:42:13] VERBOSE[3933] chan_dahdi.c: – Hungup ‘DAHDI/7-1’

OK, finally found my issue. I neglected to add the number to the ‘ZAP Channel DID’. It was something very basic like I originally thought - a big aargh over that.

I’m writing this up as info for other noobs. If you see errors please add corrections!

In my example let’s use

  • the analog telephone number is 702.555.1212
  • the line is coming in on port (channel) 4 on a A400P analog FXO card
  • the desired destination is a ring group named RG-BackLine, previously defined
  • the Zap Channel DID name will be ZC-Backline1

My setup includes the following 3 items:

  1. the /etc/asterisk/chan_dahdi.conf needs to reference the channel as context=from-zaptel
  2. on the Inbound Route page set DID 7025551212, Set Destination to RG-BackLine
  3. add the channel and number to the ZAP Channel DID: Channel 4, Description ZC-BackLine1, DID 7025551212

In ZAP Channel DID its info references the zapata.conf file. I never found the file or looked for it. As soon as I added the ZAP Channel DID things started working.

Do you think maybe you need to add a trunk because you want to manage the ZAP group? The answer is 99% of the time NO. Granted if you have no trucks at all defined you do need something, you just don’t need a dedicated trunk defining your group for this setup to work.

Some additional lingering questions:

  • since channels can be in multiple groups in the chan_dahdi.conf what happens if one group has context=from-pstn while another has the context=from-zaptel? will the forward to the ring group randomly fail because it is ‘read’ as part of the group definition with context=from-pstn?
  • what happens with multiple lines? say the 702.555.1212 has a rollover from the telco of 702.555.1213, do you need to create (2) ZAP Channel DID? I did just to make things work but is there a cleaner way via bundling them together?