Having Issues Setting Up Dahdi Trunks

Tags: #<Tag:0x00007f7029cb27f8>

(Heynow) #1

Hey guys, I’m working through my first install here and I’m having some issues sending calls out.

PBX Version:
PBX Distro: 12.7.8-2012-1.sng7
Asterisk Version: 16.15.1
Dahdi version: 2.11.1

I have 2 Dahdi Channel DID’s, both setup identical with the only difference being their respective Dahdi channels and their DID’s, (we have two phone lines/ numbers). I’ve setup a default internal route with the CID and DID fields set to “ANY”. I’ve setup 1 inbound route per channel DID. Calls ARE received by the IVR and work as expected. I’ve setup 2 Dahdi trunks both set to use Group 0 Round Robin Ascending and both have the respective DID’s configured. Our telco has both lines setup in a hunt group and I’ve confirmed that both lines have Caller ID setup. I’ve got a Sangoma A200 card that I setup using the Dahdi Config Module using the GUI with 4 FXO ports, I have all ports set up as follows:

Signaling = Kewl-Start
Group = 0
Context = from-analog

Port 1 is assigned the DID: (951)xxx-xxxx with Channel 1
Port 2 is assigned the DID: (951)xxx-xxxx with Channel 2
Ports 3-4 are not in use.

Now, I can dial internally between extensions (PJSIP) and I can receive calls from an external number to the IVR or to a direct extension. However, when I dial out I am given the message “Your call cannot be completed as dialed, please check the number and dial again.” I used the dial plan wizard to create local dial plans when I made my outbound routes. Initially, I had them all setup with a number 9 prefix to dial out. However, after further reading on the forums this is not advised with newer systems and I removed all of the prefixes but to no avail. I am still not able to dial out. I’m new to FreePBX and have scoured the forums for a solution but have had no luck. Any help would be greatly appreciated. I’ll attach my config files here.

root@ies-pbx-01 ~]# ls -al /etc/asterisk/ |grep dahdi
-rw-rw-r–. 1 asterisk asterisk 664 Feb 3 11:42 chan_dahdi_additional.conf
-rw-rw-r-- 1 asterisk asterisk 0 Nov 7 14:36 chan_dahdi_channels_custom.conf
-rw-rw-r-- 1 asterisk asterisk 1741 Feb 3 11:42 chan_dahdi.conf
-rw-rw-r-- 1 asterisk asterisk 1741 Feb 3 11:26 chan_dahdi.conf.bak
-rw-rw-r-- 1 asterisk asterisk 1757 Nov 7 14:36 chan_dahdi.conf.old
-rw-rw-r-- 1 asterisk asterisk 664 Feb 3 11:42 chan_dahdi_general.conf
-rw-rw-r-- 1 asterisk asterisk 0 Nov 7 14:36 chan_dahdi_general_custom.conf
-rw-rw-r-- 1 asterisk asterisk 895 Feb 3 11:42 chan_dahdi_groups.conf
-rw-rw-r-- 1 asterisk asterisk 737 Nov 7 14:56 dahdi-channels.conf

GNU nano 2.3.1 File: /etc/asterisk/chan_dahdi.conf


; for user additions not provided by module
#include chan_dahdi_channels_custom.conf

; include dahdi groups defined by DAHDI module of FreePBX
#include chan_dahdi_groups.conf

; include dahdi extensions defined in FreePBX
#include chan_dahdi_additional.conf


Autogenerated by /usr/sbin/setup-sangoma 2020-11-07
; If you edit this file and execute /usr/sbin/setup-sangoma again,
; your manual changes will be LOST.
; Dahdi Channels Configurations (chan_dahdi.conf)
; This is not intended to be a complete chan_dahdi.conf. Rather, it is intended
; to be #include-d by /etc/chan_dahdi.conf that will include the global settings

;Sangoma AFT-200 [slot:4 bus:6 span:1]
signalling = fxs_ks
channel => 1

signalling = fxs_ks
channel => 2

signalling = fxs_ks
channel => 3

signalling = fxs_ks
channel => 4



Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;

this file must be done via the web gui. There are alternative files to make ;

custom modifications. ;



If there’s any more info needed please do not hesitate to ask, I am looking to getting this resolved ASAP, thanks everyone in advance. I can’t upload more than 1 picture so I’ll post the failed call logs in the comments.

(Heynow) #2


(Heynow) #3


(Heynow) #4


(Heynow) #5



Please use pastebin, it’s too hard to analyse these ‘pictures’

(Heynow) #7

Will do, it’s my first post. I’ll reupload, thanks!

(Heynow) #8


Here’s the pastebin link. Thanks for the help!


Line 37 and following

41220	[2021-02-03 16:49:19] VERBOSE[18903][C-00000018] pbx.c: Channel 'PJSIP/2108-0000001b' sent to invalid extension: context,exten,priority=restrictedroute-46173bdc398c1494d88c070772f9d9d4,19092786288,2	
41221	[2021-02-03 16:49:19] VERBOSE[18903][C-00000018] pbx.c: Executing [i@restrictedroute-46173bdc398c1494d88c070772f9d9d4:1] Goto("PJSIP/2108-0000001b", "bad-number,s,1") in new stack	

Unfortunately the ‘restricted routes’ module is ‘commercial’ so not open source, so I can’t use it.


If you don’t need it, remove the Extension Routing (or Class of Service) module. Otherwise, see
and set your route to allow all extensions that should use it.

If you still have trouble, post screenshots of all tabs for the Outbound Route in question.

BTW, to paste info as part of your thread, please use pastebin.freepbx.org . Use another service if you must, but choose one where the paste (or other content) never expires, so future readers can benefit from your thread.


I would also note that you have from-zaptel when the Sangoma was setup, that would be less convoluted as from-dahdi in 2021

(Heynow) #12

Bummer, thanks for your help though. I noticed that as well in my dahdi-channels.conf that the context=from-zaptel setting was set but I don’t remember ever doing that. I don’t have remote access setup for this server so I’ll check my Sangoma config and update tomorrow morning.

(Heynow) #13

I was using Extension routing to block certain extensions from using a long distance outbound route. I thought I set my routes to allow specific extensions access to them but perhaps I misconfigured them. I thought I had followed that wiki.I won’t have access to this server until tomorrow morning, I will check my configs and update with pictures tomorrow.

Also, thanks for the tip. I will remember that in the future. And thank you for the help.

(Heynow) #14

Ok, so I checked my configs and you we’re right, the context=fromzaptel setting was set and I expect it was auto-generated but what script or module would control that? I used the dahdi module to configure the card but I don’t remember ever setting the context. I’ve followed various guides when setting this up but to be honest there isn’t a lot of information on this topic, or maybe I’m not looking hard enough. For example, what does the various context settings control? I’ve seen them used in a multitude of places and have even seen custom context being used but I haven’t found anything concrete to help me build a better understanding. Would you advise that I reconfigure the card manually instead of using the dahdi module?

(Lorne Gaetz) #15

from-zaptel is a long existing context which is just an alias for from-dahdi, you can use them interchangeably.

(Heynow) #16

Ok, so I checked all of Outbound routes and all seem to be configured according to the wiki. I’ve set which extensions are allowed to use those routes and which aren’t and the extension I was using SHOULD have been able to go through. I changed my dial plan to be more simple for the sakes of testing to see if that was the issue but to no avail. However, this time instead of getting the message played back I get a busy dial tone. I’ll post pictures of the config tabs as well as the failed call log.


(Heynow) #17



I’m guessing that you are hearing a re-order tone (two beeps per second), rather than a busy signal (one beep per second).
US re-order tone can be heard here – press the yellow play button.

Possibly, your phone provider requires 10-digit dialing for this call, rather than 11, even though it’s shown as not quite local:

Try calling 1-800-437-7950.

Who is the phone provider? What is the A200 connected to (copper pair from CO, cable MTA, fiber ONT, etc.)?

Perhaps it’s not waiting for dial tone or there is a problem with the DTMF. Do you have a way to listen on the analog line while it is dialing (butt set or similar)?

(Heynow) #19

Got it, thanks! I guess I can rule that out as a culprit.

(Heynow) #20

Ok, so I think you were correct. That was the tone that I was hearing. You we’re also correct about my carrier wanting 10 digits. Here’s the info you requested:

Carrier: Spectrum
The A200 card is connected directly to the MTA modem provided by the carrier. I will look into checking for dial tone and DTMF issues. Thank you for your help.