Outgoing calls fail (Bug?)

Hello,

This is a very messed up problem/situation.

I am running latest asterisk (1.2.12.1) with latest Zaptel (1.2.9.1), on Debian linux Sarge (I’ll give out exact kernel soon).

I’ve been having problems with outgoing calls on my asterisk PBX.

The computer has a Digium TDM04B to handle the calls, the phones are on the LAN.

To handle my outgoing calls, I put a line, like so in extensions.conf:

I have arranged a group g1 in zapata.conf, so no worries there. The Zap card works fine, (it can handle incoming calls, call phones on the LAN, no problem).

So I put the line in extensions.conf. I go to the CLI, reload, works.

Then I shutdown the machine (CLEANLY!) and restart… and lo and behold, the line IS STILL in extensions.conf, but I get an “unable to create channel of type zap” with unknown cause.

And here comes the absolute best part of this (you’re going to love this)… if I just retype the EXACT SAME LINE in extensions.conf, just underneath, go to the CLI and reload, everything is fine and dandy.

Did I miss something, a part of asterisk I should have updated (?), something? Has anyone else ever seen this? Is this a bug? Am I in hell or is this just a horrible nightmare?

I’ve tested this about 100 times in case you’re wondering, and yes, it does that EVERY SINGLE TIME… but only for the outgoing calls extensions… everything else seems fine.

Hard drive damage, bad ram, bad mobo…?

What do I do now?

i doubt this has anything to do with it, but your dial line can be simplified…change this:

exten => _9NXXNXXXXXX,1,Dial(Zap/g1/${EXTEN:-10:10})

to this:

exten => _9NXXNXXXXXX,1,Dial(Zap/g1/${EXTEN:1})

now, as far as your zap issue goes - make sure that your zaptel drivers are getting loaded at startup, followed by a ztcfg -vvv, THEN a start of asterisk. i’m wondering if asterisk is getting started before the zap subsystem is getting loaded and config’d…

try manually running the following commands off of a fresh restart, after you have disabled all startup scripts:

modprobe wctdm (i think this is right, for your card)
ztcfg -vvv
asterisk

this is just a guess, but it’s the only thing that makes sense to me right now.

Hi again whoiswes!

I wanted to paste the error when I dialout, so here goes:

-- Executing Dial("SIP/144-081d4c88", "Zap/g1/9xxxxxxxxxx") in new stack Sep 20 13:08:00 NOTICE[2774]: app_dial.c:1056 dial_exec_full: Unable to create channel of type 'Zap' (cause 0 - Unknown) == Everyone is busy/congested at this time (1:0/0/1) == Auto fallthrough, channel 'SIP/144-081d4c88' status is 'CHANUNAVAIL' Sep 20 13:08:00 WARNING[2665]: channel.c:787 channel_find_locked: Avoided initial deadlock for '0x8149598', 10 retries!

By the way, the xxxxxxxxxx are any phone number, I see the number I dialed, not a string of x’es.

I’m going to try what you just said, be right back in a minute.

All right, here goes:

After a reboot, lsmod:

wctdm 40256 0 ztdummy 3556 0 zaptel 228804 2 wctdm,ztdummy

I rmmodded and modprobed wctdm, just to be sure.

And ztcfg -vvvv says:

[code]ztcfg -vvvvvv

Zaptel Configuration

Channel map:

Channel 01: FXS Kewlstart (Default) (Slaves: 01)
Channel 02: FXS Kewlstart (Default) (Slaves: 02)
Channel 03: FXS Kewlstart (Default) (Slaves: 03)
Channel 04: FXS Kewlstart (Default) (Slaves: 04)
Channel 05: FXS Kewlstart (Default) (Slaves: 05)
Channel 06: FXS Kewlstart (Default) (Slaves: 06)
Channel 07: FXS Kewlstart (Default) (Slaves: 07)
Channel 08: FXS Kewlstart (Default) (Slaves: 08)

8 channels configured.[/code]

Seems pretty good.

Manual asterisk start, then I make a call and I get:

-- Executing Dial("SIP/144-081ca520", "Zap/g1/95143359007") in new stack Sep 20 14:48:52 NOTICE[2851]: app_dial.c:1056 dial_exec_full: Unable to create channel of type 'Zap' (cause 0 - Unknown) == Everyone is busy/congested at this time (1:0/0/1) == Auto fallthrough, channel 'SIP/144-081ca520' status is 'CHANUNAVAIL' Sep 20 14:48:52 WARNING[2832]: channel.c:787 channel_find_locked: Avoided initial deadlock for '0x81c74a8', 10 retries!
Yet again. Call doesn’t go through, I get a sort of fast busy, just like if input a non-existing extension.

Can you see anything else, possibly? I have absolutely NO idea what is going on here!

The computer has two TDM04B cards, forgot to mention, but it works fine in other computers, so no worries there.

If I just retype the line in extensions.conf, and do a reload, it works fine.

Thanks for all the help!

may sound dumb, but what happens when you don’t modify extensions.conf and just do a reload in asterisk? i want to know if it starts working based on the reload or the extensions.conf edit…

also, this probably doesn’t matter, but you do need to alter your dial command as i posted above - if you look at your logs, you’re passing the full 11 digit dial string with the 9 included…not a biggie, but eventually you’ll need to fix that.

i’m assuming your card has all FXO modules on it (since you’re using FXS signalling)…i believe they should be red in color…please double check.

Hi again whoiswes, and thanks a lot for helping out!

It’s not dumb at all, I tried it too… and unfortunately it doesn’t do jack. I get the same error when I attempt to dial out.

That’s a big 10-4 buddy, all FXO modules.

I think I mentioned it but it here goes… it can answer calls with no problem at all, for example if I call the line it answers and plays a little message. And it does so right from the startup of the machine. This probably rules out Zap problems.

Also I can call from my phone internal extensions with no problem, I just have problems when the call goes out. It’s really as if the line isn’t in extensions.conf.

Thanks for all your help!

i’m interested to know how you’ve got 8 channels from a single TDM04B :smiley:

Off-topic but it’s two TDM04B.

Back on topic, I’m at the point where I think wiping the disk is the only option. Something is obviously very wrong, but if I can’t find it then I’m done for.

what does ‘show channeltypes’ return ? can you turn on debug logging, rotate the logs (‘logger rotate’) and reload asterisk ? do you get any errors when asterisk loads the chan_zap module ?

i really can’t think of anything else…one thing before a total wipe, do a complete clean recompile of zaptel, libpri (if you’re using it) and asterisk…just to be sure.

Hi, what’s up.

My system doesn’t use a PRI, it’s two analog FXO digium cards.

Here goes show channeltypes:
show channeltypes

[code]Type Description Devicestate Indications Transfer


Zap Zapata Telephony Driver w/PRI no yes no
Phone Standard Linux Telephony API D no no no
Console OSS Console Channel Driver no yes no
Feature Feature Proxy Channel Driver no yes no
Skinny Skinny Client Control Protocol no yes no
Local Local Proxy Channel Driver no yes no
IAX2 Inter Asterisk eXchange Driver yes yes yes
MGCP Media Gateway Control Protocol no yes no
Agent Call Agent Proxy Channel yes yes no
SIP Session Initiation Protocol (S yes yes yes[/code]
That looks odd doesn’t it? Devicestate no on Zap what the hell? (Nevermind that, I just checked on another working machine and it’s “no” also.)

However, reload for chan_zap:

-- Reloading module 'chan_zap.so' (Zapata Telephony w/PRI) == Parsing '/etc/asterisk/zapata.conf': Found Sep 20 16:13:35 WARNING[2796]: chan_zap.c:10874 setup_zap: Ignoring switchtype Sep 20 16:13:35 WARNING[2796]: chan_zap.c:10874 setup_zap: Ignoring signalling Sep 20 16:13:35 WARNING[2796]: chan_zap.c:10874 setup_zap: Ignoring rxwink Sep 20 16:13:35 WARNING[2796]: chan_zap.c:10874 setup_zap: Ignoring signalling -- Reconfigured channel 1, FXS Kewlstart signalling -- Reconfigured channel 2, FXS Kewlstart signalling -- Reconfigured channel 3, FXS Kewlstart signalling -- Reconfigured channel 4, FXS Kewlstart signalling -- Reconfigured channel 5, FXS Kewlstart signalling -- Reconfigured channel 6, FXS Kewlstart signalling -- Reconfigured channel 7, FXS Kewlstart signalling -- Reconfigured channel 8, FXS Kewlstart signalling
Nothing very important or critical here.

Thanks for helping out.

Hi to all.

I’ve similar problem but on chan_sip…(see forums.digium.com/viewtopic.php?t=9773)

when I attempt to make an outgoing call with option canreinvite=yes, Asterisk notifies the follow message?

Sep 20 14:13:42 WARNING[2373]: channel.c:787 channel_find_locked: Avoided initial deadlock for ‘0x819b240’, 10 retries!

Can anyone tell me what it does mean and how to fix it?

Thanks for hijacking, Donuil!

Anyway, to everyone, except Donuil, it’s very strange. If I issue ONE reload, it doesn’t work. If I issue 2 consecutive reloads, it starts wroking. Whatever the hell is going on I have no idea.

(Someone suggested that I issue reloads like crazy and it worked.)

Solved:

I crontabbed two delayed reloads of asterisk at reboot. Works fine but takes some 10 odd seconds more to reboot the system, not that tragic.