[resolved] no callerID from long-distance on TDM400p

Hoping someone can help me with this:

I have a TDM400p with an FXO module (Asterisk v1.4.10). My problem is that Asterisk seems unable to get the callerID for all incoming long-distance calls. Local calls work perfectly.

The following are my current configurations. I have tried with and without the Wait(x) in extensions and with/without the Answer()… no luck.

extensions.conf:

exten => s,1,Wait(4) ;exten => s,2,Answer() exten => s,2,Dial(${SPA942}&${ZAP1}&${ZAP2},20,o) exten => s,3,VoiceMail(u501@default) exten => s,103,VoiceMail(b501,default)

zapata.conf:

[code][channels]
usecallerid=yes
callerid=asreceived
callwaiting=yes
echocancel=yes
echotraining=yes
immediate=no
busydetect=yes
busycount=5

context=internal
signalling=fxo_ks
mailbox=501@default
channel => 1
channel => 2

context=incoming
signalling=fxs_ks
channel => 4[/code]

Until I get this working, I cannot use Zapteller – please help me escape the telemarketers!

And with a regular phone LD CID comes in fine ? Can you please get the results from both a local and long distance calls using a regular phone with CID and post it here.

Yes, I see the callerID on local calls, but not on long-distance ones.

Is it the reports generated from the Asterisk CLI (/asterisk -vvvr)?

Just to clarify: for any incoming local call through my TDM400p card, all of my phones (Zap/1, Zap/2, SIP/spa942) receive and display the callerID. However, all incoming long-distance calls, no callerID (asterisk is displayed).

My PSTN is through Bell Canada–I have confirmed that if I by-pass Asterisk entirely, LD calls do display CID.

Here is the Asterisk CLI output for an incoming call… I tried with both local & LD and could not see any difference:

-- Starting simple switch on 'Zap/4-1' -- Executing [s@incoming:1] Wait("Zap/4-1", "4") in new stack -- Executing [s@incoming:2] Dial("Zap/4-1", "SIP/spa942&Zap/1&Zap/2|20|o") in new stack -- Called spa942 -- Called 1 -- Called 2 -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- SIP/spa942-081bc888 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Nobody picked up in 20000 ms -- Hungup 'Zap/2-1' -- Hungup 'Zap/1-1' -- Executing [s@incoming:3] VoiceMail("Zap/4-1", "u501@default") in new stack -- <Zap/4-1> Playing '/var/spool/asterisk/voicemail/default/501/unavail' (language 'en') -- <Zap/4-1> Playing 'vm-intro' (language 'en') -- <Zap/4-1> Playing 'beep' (language 'en') -- Recording the message -- x=0, open writing: /var/spool/asterisk/voicemail/default/501/tmp/N0fuqT format: wav49, 0x81b3730 -- x=1, open writing: /var/spool/asterisk/voicemail/default/501/tmp/N0fuqT format: gsm, 0x81b28a8 -- x=2, open writing: /var/spool/asterisk/voicemail/default/501/tmp/N0fuqT format: wav, 0x81b8480 -- User hung up -- Recording was 1 seconds long but needs to be at least 5 - abandoning == Spawn extension (incoming, s, 3) exited non-zero on 'Zap/4-1' -- Hungup 'Zap/4-1'

Again, any help would be gratefully appreciated!

Can anyone help with this?

Asterisk does not discriminate where the call is coming from. Again as I said before put a “regular” phone in and see how the CID comes in. Try to see what is different and why asterisk may be acting up.

When I unplugged my * box and had my analog phone connected directly to the PSTN, it was able to receive CID for both local and LD calls.

I repeated the calling sequence and traced it through *. There are some differences… can you help and tell me what the difference is?

LD: -- Starting simple switch on 'Zap/4-1' [Nov 15 21:01:02] NOTICE[22609]: chan_zap.c:6369 ss_thread: Got event 18 (Ring Begin)... [Nov 15 21:01:03] NOTICE[22609]: chan_zap.c:6369 ss_thread: Got event 2 (Ring/Answered)... [Nov 15 21:01:03] NOTICE[22609]: chan_zap.c:6369 ss_thread: Got event 18 (Ring Begin)... -- Executing [s@incoming:1] Dial("Zap/4-1", "SIP/spa942&Zap/1&Zap/2|20|o") in new stack -- Called spa942 -- Called 1 -- Called 2 -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- SIP/spa942-081b3b38 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Hungup 'Zap/2-1' -- Hungup 'Zap/1-1' == Spawn extension (incoming, s, 1) exited non-zero on 'Zap/4-1' -- Hungup 'Zap/4-1'

local:

-- Starting simple switch on 'Zap/4-1' -- Executing [s@incoming:1] Dial("Zap/4-1", "SIP/spa942&Zap/1&Zap/2|20|o") in new stack -- Called spa942 -- Called 1 -- Called 2 -- SIP/spa942-081b3b38 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Hungup 'Zap/2-1' -- Hungup 'Zap/1-1' == Spawn extension (incoming, s, 1) exited non-zero on 'Zap/4-1' -- Hungup 'Zap/4-1'

Why the difference? My extension.conf is still:

[incoming] exten => s,1,Dial(${SPA942}&${ZAP1}&${ZAP2},20,o) exten => s,2,VoiceMail(u501@default) exten => s,102,VoiceMail(b501,default)

Many thanks for your help & patience!

This should fix it:

Edit the file wctdm.c and find this line:
#define DEFAULT_RING_DEBOUNCE 64

Change it to this:
#define DEFAULT_RING_DEBOUNCE 128

recompile zaptel(make install) and unload the driver(rmmod wctdm) and load it back(modprobe wctdm). Maybe run “ztcfg” if needed.

CID should work for both local and LD after this. If not the value may need to be doubled in the driver again.

In the file wtcdm.c, I could not find:
#define DEFAULT_RING_DEBOUNCE 64

Instead, I found:
#define RING_DEBOUNCE 4 /* Ringer Debounce (64 ms) */

I tried changing this to 8, reinstaling the driver, no luck. So I upped it to 32, still no luck. For all long-distance calls, I get the following:

-- Starting simple switch on 'Zap/4-1' [Nov 17 19:28:49] NOTICE[4352]: chan_zap.c:6369 ss_thread: Got event 18 (Ring Begin)... [Nov 17 19:28:49] NOTICE[4352]: chan_zap.c:6369 ss_thread: Got event 2 (Ring/Answered)... [Nov 17 19:28:50] NOTICE[4352]: chan_zap.c:6369 ss_thread: Got event 18 (Ring Begin)... -- Executing [s@incoming:1] Dial("Zap/4-1", "SIP/spa942&Zap/1&Zap/2|20|o") in new stack -- Called spa942 -- Called 1 -- Called 2 -- SIP/spa942-081afa40 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 answered Zap/4-1 -- Hungup 'Zap/2-1' -- Native bridging Zap/4-1 and Zap/1-1 -- Hungup 'Zap/1-1'

Should I try upping this beyond 32? Is 128 not equal to 128*4=512ms?

I have now changed this to 128, but am still not able to get the CID. Any other thoughts?

cheers,
J.

[quote=“angler”]This should fix it:

Edit the file wctdm.c and find this line:
#define DEFAULT_RING_DEBOUNCE 64

Change it to this:
#define DEFAULT_RING_DEBOUNCE 128

recompile zaptel(make install) and unload the driver(rmmod wctdm) and load it back(modprobe wctdm). Maybe run “ztcfg” if needed.

CID should work for both local and LD after this. If not the value may need to be doubled in the driver again.[/quote]

Is this a bug ?

[quote=“Juggler00”]In the file wtcdm.c, I could not find:
#define DEFAULT_RING_DEBOUNCE 64

Instead, I found:
#define RING_DEBOUNCE 4 /* Ringer Debounce (64 ms) */

I tried changing this to 8, reinstaling the driver, no luck. So I upped it to 32, still no luck. For all long-distance calls, I get the following:

-- Starting simple switch on 'Zap/4-1' [Nov 17 19:28:49] NOTICE[4352]: chan_zap.c:6369 ss_thread: Got event 18 (Ring Begin)... [Nov 17 19:28:49] NOTICE[4352]: chan_zap.c:6369 ss_thread: Got event 2 (Ring/Answered)... [Nov 17 19:28:50] NOTICE[4352]: chan_zap.c:6369 ss_thread: Got event 18 (Ring Begin)... -- Executing [s@incoming:1] Dial("Zap/4-1", "SIP/spa942&Zap/1&Zap/2|20|o") in new stack -- Called spa942 -- Called 1 -- Called 2 -- SIP/spa942-081afa40 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 answered Zap/4-1 -- Hungup 'Zap/2-1' -- Native bridging Zap/4-1 and Zap/1-1 -- Hungup 'Zap/1-1'

Should I try upping this beyond 32? Is 128 not equal to 128*4=512ms?[/quote]

Yes thats the correct one, I was looking at a different driver so they were named differently. You could try a value of 64 which would debounce any ring thats less than 1024ms. Make sure you are recompiling and reloading the drivers.

No, this value needs changed sometimes for lines with that aren’t so clean.

I have already upped this to 128, but am not receiving caller ID. How can I verify that the recompiled drivers with the new value are being used?

Should I try even higher to see if this fixes the problem?

I changed the value to 512 (now over 2 seconds):
#define RING_DEBOUNCE 512

As a verification, I used the following procedure:

/usr/src/temp$ sudo tar -cjf zaptel.tar.bz2 modules/ /usr/src/temp$ cd .. /usr/src$ sudo cp temp/zaptel.tar.bz2 . /usr/src$ sudo m-a -t build zaptel /usr/src$ sudo dpkg -i zaptel-modules-2.6.22-14-server_1.4.3~dfsg-2ubuntu1+2.6.22-14.46_i386.deb /usr/src$ sudo depmod -a /usr/src$ sudo shutdown -r now

Once my server had come up again, I still could not get CID for incoming long-distance calls. I still get the following output from Asterisk:

-- Starting simple switch on 'Zap/4-1' [Nov 19 21:26:20] NOTICE[4346]: chan_zap.c:6369 ss_thread: Got event 18 (Ring Begin)... [Nov 19 21:26:21] NOTICE[4346]: chan_zap.c:6369 ss_thread: Got event 2 (Ring/Answered)... [Nov 19 21:26:21] NOTICE[4346]: chan_zap.c:6369 ss_thread: Got event 18 (Ring Begin)... -- Executing [s@incoming:1] Dial("Zap/4-1", "SIP/spa942&Zap/1&Zap/2|20|o") in new stack -- Called spa942 -- Called 1 -- Called 2 -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- SIP/spa942-081b0148 is ringing -- Zap/1-1 is ringing -- Zap/2-1 is ringing -- Zap/1-1 answered Zap/4-1 -- Hungup 'Zap/2-1' -- Native bridging Zap/4-1 and Zap/1-1 -- Hungup 'Zap/1-1'

What else can I do? Should I continue to double this? Could there not be some other source for this trouble?

I thought I would try the newest driver Zaptel 1.4.6. I downloaded it and did the following:

/usr/src/temp$ sudo tar -xf zaptel-1.4.6.tar.gz /usr/src/temp$ cd zaptel-1.4.6/ /usr/src/temp$ sudo mkdir modules /usr/src/temp$ sudo mv zaptel-1.4.6 modules /usr/src/temp$ cd modules /usr/src/temp/modules$ sudo mv zaptel-1.4.6 zaptel /usr/src/temp$ sudo tar -cjf zaptel.tar.bz2 modules/ /usr/src$ sudo mv temp/zaptel.tar.bz2 . /usr/src$ sudo m-a -t build zaptel
However, this gave me a BUILD FAILED result:

strip: supported targets: elf32-i386 a.out-i386-linux efi-app-ia32 elf32-little elf32-big elf64-x86-64 efi-app-x86_64 elf64-little elf64-big srec symbolsrec tekhex binary ihex trad-core make[1]: *** [binary-modules] Error 123 make[1]: Leaving directory `/usr/src/modules/zaptel' make: *** [kdist_build] Error 2 BUILD FAILED! See /var/cache/modass/zaptel-source.buildlog.2.6.22-14-server.1195609481 for details. Build failed. Press Return to continue...

I am a Linux neophyte, but have been able to negotiate my way round Ubuntu server reasonably well. If anyone can point to my error or suggest a way to build this latest driver…

many thanks,
J.

I thought I would do a little more reading, and followed the instructions in the readme (newbie mistake :blush:). I did the following:

/usr/src/temp/modules/zaptel$ sudo ./configure /usr/src/temp/modules/zaptel$ sudo make /usr/src/temp/modules/zaptel$ sudo make install /usr/src/temp/modules/zaptel$ sudo make config /usr/src/temp/modules/zaptel$ sudo shutdown -r now
No errors or anything. However, also still no CID. Executing:

[code]sudo ztcfg -v

Zaptel Version: 1.4.6
Echo Canceller: MG2
Configuration

3 channels to configure.[/code]

I see that I am using the latest Zaptel, but am curious about the 3 channels. Doing a:

*CLI> zap show status Description Alarms IRQ bpviol CRC4 Wildcard TDM400P REV I Board 1 OK 0 0 0

It looks like Asterisk is configured correctly. I do have a zaptel.conf and can send/receive calls.

Again, I plead… what am I doing wrong???

Hi, I’m having this exact same problem - very very intermittent callerid on incoming calls that produce those 3 NOTICE messages. Maybe 2% of my incoming calls DO NOT produce those messages and callerid ALWAYS works for those. Unlike you, I have not only get those messages on long distance calls.

Anyone out there that can explain what those messages are trying to tell us? I’d appreciate any direction!

[quote=“Quahtrader”]Hi, I’m having this exact same problem - very very intermittent callerid on incoming calls that produce those 3 NOTICE messages. Maybe 2% of my incoming calls DO NOT produce those messages and callerid ALWAYS works for those. Unlike you, I have not only get those messages on long distance calls.

Anyone out there that can explain what those messages are trying to tell us? I’d appreciate any direction![/quote]

Try the above about raising the ring debounce.

Juggler00:

I’m not sure if module assistance is loading the driver with the correct settings or not. I’m pretty confident that this should fix your issue. Try doing it without using module assistance.

Do the following:
tar -zxvf zaptel-1.4.6.tar.gz
cd zaptel-1.4.6
edit wctdm.c
make install
insmod zaptel.ko
insmod wctdm.ko
ztcfg -vv
ztcfg -vv
start Asterisk and give it a try