TDM400P can't make outgoing calls with dahdi, fine with zap

Hi,

I’ve got a Digium TDM400P with 1x FXO running on FreeBSD 8.1 with Asterisk 1.4.29 (I also tried in 1.6.0.21 and got the same thing) and I’m having trouble dialing out with the dahdi-freebsd-complete-2.3.0-rc2+2.3.0 drivers. Here are my configs:

“/usr/local/etc/dahdi/system.conf” 4L, 55C

[quote]fxsls=1
loadzone=au
defaultzone=au
echocanceller=mg2,1
[/quote]

“/usr/local/etc/asterisk/chan_dahdi.conf” 16L, 244C

[quote][channels]
context=default
usecallerid=yes
hidecallerid=no
immediate=no
signalling=fxs_ls
callerid=pstn
group=1
channel=>1
echocancel=128
echocancelwhenbridged=yes
echotraining=800
callgroup=1
pickupgroup=1
rxgain=9.0
txgain=-6.0
[/quote]

“/usr/local/etc/asterisk/extensions.conf” [readonly] 614L, 22781C

[quote][outgoing]
exten => 600,1,Playback(demo-echotest) ; Let them know what’s going on
exten => 600,n,Echo ; Do the echo test
exten => 600,n,Playback(demo-echodone) ; Let them know it’s over
exten => 600,n,Goto(s,6) ; Start over

exten => _0X.,1,DIAL(dahdi/1/${EXTEN},60,otr)
exten => _0X.,2,Congestion[/quote]

It’s also being detected fine by the kernel, output of dmesg:

[quote]Telephony Interface Registered on major 196
Version: 2.3.0-rc2
wctdm0: vendor=e159 device=1 subvendor=b100
wctdm0: <Wildcard TDM400P REV E/F> port 0xde00-0xdeff mem 0xfdbff000-0xfdbfffff irq 20 at device 0.0 on pci3
wctdm0: [FILTER]
Freshmaker version: 71
Freshmaker passed register test
Module 0: Installed – AUTO FXO (AUSTRALIA mode)
Module 1: Not installed
Module 2: Not installed
Module 3: Not installed
Found a Wildcard TDM: Wildcard TDM400P REV E/F (1 modules)
Registered echo canceler 'MG2’
Registered tone zone 1 (Australia)[/quote]

Incoming calls work just fine, when I try to make an outgoing call though I just get a long congested “beeep, beeep” tone. Followed by this on the asterisk console:

[quote] – Saved useragent “Ekiga/3.2.6” for peer 1000
– Executing [phoneNumber@outgoing:1] Dial(“SIP/1000-00000000”, “dahdi/1/phoneNumber|60|otr”) in new stack
– Called 1/phoneNumber
– Hungup ‘DAHDI/1-1’
== Spawn extension (outgoing, phoneNumber, 1) exited non-zero on ‘SIP/1000-00000000’
[/quote]

NOTE: I’ve censored the phone number.

I’ve plugged another phoneline in and a cordless phone to that to listen to the signal and I can certainly hear asterisk hanging up and taking the phone off the hook.

I tried the zaptel-1.4.11.3 drivers however found that fxotune was broken (probes all modules /dev/zap/1-254 as opposed to the one with the FXO module and then eventually kernel panics) and while I could make outgoing calls with this and recieve I couldn’t tune my modules, dahdi seems to fix this problem making pstn calls that I receive much clearer, however it’s kind of useless not being able to make any calls.

Also I’ve tried echo "hint.wctdm.0.opermode="AUSTRALIA"" >> /boot/device.hints this does nothing I had to modify some source code:

diff -ur work/dahdi-freebsd-complete-2.3.0-rc2+2.3.0/freebsd/drivers/dahdi/wctdm.c work.1/dahdi-freebsd-complete-2.3.0-rc2+2.3.0/freebsd/drivers/dahdi/wctdm.c --- work/dahdi-freebsd-complete-2.3.0-rc2+2.3.0/freebsd/drivers/dahdi/wctdm.c 2010-06-01 18:32:14.000000000 +0930 +++ work.1/dahdi-freebsd-complete-2.3.0-rc2+2.3.0/freebsd/drivers/dahdi/wctdm.c 2010-08-13 18:10:42.000000000 +0930 @@ -338,7 +338,7 @@ static int boostringer = 0; static int fastringer = 0; static int _opermode = 0; -static char *opermode = "FCC"; +static char *opermode = "AUSTRALIA"; static int fxshonormode = 0; static int alawoverride = 0; static int fastpickup = 0;

does the phone number that you censored look correct? No missing digits?

The log makes me believe that the beep beep beep is coming from the phone company. Since you dont see the phoneNumber@outgoing:2 line for the Congestion statement in the log.

[quote]-- Saved useragent “Ekiga/3.2.6” for peer 1000
– Executing [phoneNumber@outgoing:1] Dial(“SIP/1000-00000000”, “dahdi/1/phoneNumber|60|otr”) in new stack
– Called 1/phoneNumber
– Hungup ‘DAHDI/1-1’
== Spawn extension (outgoing, phoneNumber, 1) exited non-zero on ‘SIP/1000-00000000’[/quote]

The beep beep sound appears to be something generated by Ekiga the soft phone, and is not related to the carrier’s equipment, X-Lite does a very similar thing except it’s a purr purr sound, and it’s too high quality to be coming from the PSTN line.

[quote] – Registered SIP ‘1000’ at 192.168.1.21 port 5060
– Saved useragent “Ekiga/3.2.6” for peer 1000
[Aug 14 17:52:59] WARNING[9476]: chan_sip.c:13656 handle_response: Remote host can’t match request NOTIFY to call ‘1af909ac14de0d485f58d06d0ff6f172@192.168.1.254’. Giving up.
– Executing [<correctly_formatted_phone_number>@outgoing:1] Dial(“SIP/1000-00000000”, “dahdi/1/<correctly_formatted_phone_number>|60|otr”) in new stack
– Called 1/<correctly_formatted_phone_number>
– Hungup ‘DAHDI/1-1’
== Spawn extension (outgoing, <correctly_formatted_phone_number>, 1) exited non-zero on ‘SIP/1000-00000000’[/quote]

[quote] – Registered SIP ‘1000’ at 192.168.1.20 port 41944
– Saved useragent “X-Lite Beta release 4.0 v3 stamp 56227” for peer 1000
– Executing [<correctly_formatted_phone_number>@outgoing:1] Dial(“SIP/1000-00000001”, “dahdi/1/<correctly_formatted_phone_number>|60|otr”) in new stack
– Called 1/<correctly_formatted_phone_number>
– Nobody picked up in 60000 ms
– Hungup ‘DAHDI/1-1’
– Executing [<correctly_formatted_phone_number>@outgoing:2] Congestion(“SIP/1000-00000001”, “”) in new stack
== Spawn extension (outgoing, <correctly_formatted_phone_number>, 2) exited non-zero on 'SIP/1000-00000001[/quote]

It should also be noted when restarting the zaptel service i often get kernel panics too. I doubt this is a configuration problem or problem with the hardware because i can make outgoing calls with zaptel, (with the same configuration) dahdi only allows incoming calls. Perhaps the driver is broken on FreeBSD.

I can report that dahdi-freebsd-complete-2.4.0-rc2+2.4.0-rc1 fixes this problem. The new version of the driver committed today works perfectly.

[quote]dahdi 2.4.0rc2 misc files touched by this commit Digium/Asterisk Hardware Device Interface

Update to 2.4.0-rc2.

Most notable changes are:
- wctdm, wcte11xp, wcte12xp drivers are no longer experimental
- outgoing FXO calls now work properly
- experimental wctc4xxp support
- experimental sparc64 support

Add a bchan patch for zaphfc driver.[/quote]

Modifying the source is not necessary anymore to put the FXO module into ‘AUSTRALIA’ mode or another mode.

01 Sep 2010 16:22:32 Original commit files touched by this commit 2.4.0rc4_2 Fix wctdm driver parameters declaration.

So for wctdm do:

kenv dahdi.wctdm.opermode=AUSTRALIA before loading the driver or just