Answer app question and Caller ID quirks

Hello, all!

I’m working through a caller id problem on my * box and had a minor question about the Answer() app.

On incoming calls, when you invoke Answer() in the ‘s’ exten, will it wait the appropriate number of rings as specified in zapata.conf for caller id under the “sendcalleridafter” option…or is a delay necessary?

Does the “sendcalleridafter” even have any affect for incoming PSTN calls on a TDM400 card?

I’m at work now and don’t have my .conf files handy…however, in my zapata.conf I have something like:

usercallerid=yes
callerid=asreceived
cidstart=ring
cidsignalling=bell
sendcalleridafter=1

In my inbound.conf file, which handles incoming calls…

exten => s,1,Wait(10)     ; Allow time to catch cid
exten => s,n,Answer()
exten => s,n,PlayTones(ring)     ; comfort ringing during fax detect
exten => s,n,Wait(5)    ; Allow time for fax detection
...other code...

The code pieces are from the best of my memory! :smile:
I am using * 1.2.13 compiled from individual source, not via TrixBox or *@H or anything like that. This is on Fedora Core 5 on a rinky-dink Compaq Deskpro EN 1GHz 512Mb RAM with a TDM400 with 1 FXO.

The main issue that I have is that some calls present caller id, notably calls via Ameritech/SBC/AT&T landlines (my PSTN), via Sprint landlines (local long-distance) and Verizon Wireless cell phones. The caller id comes in as name just as expected.

Calls from working cid numbers (in the above paragraph) work as expected if the cid is blocked…they go to an announcement then congest out.

Calls from my work, in which we use Time Warner Telecom via a PRI, and Cingular cellular phones do not present caller id…or at least none that * can understand. The strange part is that caller id appears on a regular caller id box, a caller id cordless phone, and my Verizon cell phone when they call that number. None of the phones used to call my * via PSTN have caller id blocking turned on. I have changed the “sendcalleridafter” to 2 with the same result.

I am using the * box in my home as an answering machine and call processor and have set up caller blacklists and whitelists and all kind of fancy-schmancy stuff! :smile: I’ve never had this much fun with a piece of software! The only hitch so far has been the cid not appearing. I would like to have the people on the other ends of the Cingular cell phones and select nums at work on the whitelist, but they go to the generic extension for people blocking cid. I’d hate to have to take that out, since the telemarketer annoyance factor is quite high! :smiling_imp:

Anyone on list have any experience like this? Any ideas that I should try? I’ve searched high and low across the vastness of the interweb with no luck.

I will post greater swaths of my code when I get home. It has just bothered me so much in the last three weeks that I had to post.

Thanks,
Mike G

does anything at all show up? eg in your inbound context, do a:

NoOp(CALLERID(all))

and see what shows up?

My incoming config has a NoOp statement to display the cid and some info about the call in the status on the console. I will change the code to do a more generic statement to display the cid both before and after the answer just to see. Here is the most current code that I have been playing with…

[inbound]
include => faxes-in
include => vm-in

;Generic inbound context
exten => s,1,Wait(10)                                                           ; Delay for caller id detection
exten => s,n,Answer()                                                           ; Actually answer the call
exten => s,n,PlayTones(ring)                                                    ; "Comfort ringing" during fax detection
exten => s,n,Wait(5)                                                            ; Delay for fax detection
exten => s,n,GotoIf($["X${CALLERID(num)}" = "X"]?inbound,s-inv,1)               ; Checks for unidentified calls
exten => s,n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?inbound,s-blk,1)   ; Checks for blacklisted numbers
exten => s,n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(name)})}?inbound,s-blk,1)  ; Checks for blacklisted names
exten => s,n,GotoIf(${DB_EXISTS(whitelist/${CALLERID(num)})}?inbound,s-wht,1)   ; Checks for whitelisted numbers
exten => s,n,GotoIf(${DB_EXISTS(whitelist/${CALLERID(name)})}?inbound,s-wht,1)  ; Checks for whitelisted names
exten => s,n,Goto(inbound,s-cid,1)

;Inbound calls without caller id
exten => s-inv,1,NoOp(Incoming call with invalid Caller ID info)
exten => s-inv,n,PlayTones(info)
exten => s-inv,n,Wait(1)
exten => s-inv,n,Playback(were-sorry)
exten => s-inv,n,Playback(privacy-unident)
exten => s-inv,n,Playback(please-hang-up-and-try-again)
exten => s-inv,n,Congestion()

;Inbound blacklisted calls
exten => s-blk,1,NoOp(Incoming Blacklist Call - ${CALLERID(all)})
exten => s-blk,n,PlayTones(info)
exten => s-blk,n,Wait(1)
exten => s-blk,n,Playback(were-sorry)
exten => s-blk,n,Playback(privacy-you-are-blacklisted)
exten => s-blk,n,Playback(privacy-stop-calling-not-welcome2)
exten => s-blk,n,Congestion()

;Inbound whitelisted calls
exten => s-wht,1,NoOp(Incoming Whitelist Call - ${CALLERID(all)})
exten => s-wht,n,Goto(inbound,s-pass,1)                                         ; Process call

;Inbound calls with proper caller id
exten => s-cid,1,NoOp(Incoming Call - ${CALLERID(all)})
exten => s-cid,n,Zapateller()                                                   ; Oblitterate telemarketers
exten => s-cid,n,GotoIf(${DB(Features/GlobalTC)}=0?inbound,s-pass,1)            ; Check if time conditions active
exten => s-cid,n,GotoIfTime(22:00-07:00|*|*|*?vm-in,vm,1)                       ; No ringing from 10p-7a daily
exten => s-cid,n,GotoIfTime(07:00-17:00|mon-fri|*|*?vm-in,vm,1)                 ; No ringing from 7a-5p weekdays
exten => s-cid,n,Goto(inbound,s-pass,1)                                         ; Process call

;Process calls
exten => s-pass,1,GotoIf(${DB(Features/GlobalDND)}=1?vm-in,vm,1)                ; Check if global DND active
exten => s-pass,n,Playback(pls-wait-connect-call)
exten => s-pass,n,Dial(SIP/100,45,tmro)                                         ; Dial internal extens
exten => s-pass,n,Goto(vm-in,vm,1)

And here is an excerpt of a call that has no cid. I called home from work just today…

    -- Starting simple switch on 'Zap/1-1'
    -- Executing Wait("Zap/1-1", "10") in new stack
    -- Executing Answer("Zap/1-1", "") in new stack
    -- Executing PlayTones("Zap/1-1", "ring") in new stack
    -- Executing Wait("Zap/1-1", "5") in new stack
    -- Executing GotoIf("Zap/1-1", "1?inbound|s-inv|1") in new stack
    -- Goto (inbound,s-inv,1)
    -- Executing NoOp("Zap/1-1", "Incoming call with invalid Caller ID info") in new stack
    -- Executing PlayTones("Zap/1-1", "info") in new stack
    -- Executing Wait("Zap/1-1", "1") in new stack
    -- Executing Playback("Zap/1-1", "were-sorry") in new stack
    -- Playing 'were-sorry' (language 'en')
    -- Executing Playback("Zap/1-1", "privacy-unident") in new stack
    -- Playing 'privacy-unident' (language 'en')
    -- Executing Playback("Zap/1-1", "please-hang-up-and-try-again") in new stack
    -- Playing 'please-hang-up-and-try-again' (language 'en')
    -- Executing Congestion("Zap/1-1", "") in new stack
  == Spawn extension (inbound, s-inv, 7) exited non-zero on 'Zap/1-1'
    -- Hungup 'Zap/1-1'

Here is the console log of a successful call, this is from my cell phone to home (cell number obfuscated)…

    -- Starting simple switch on 'Zap/1-1'
    -- Executing Wait("Zap/1-1", "10") in new stack
    -- Executing Answer("Zap/1-1", "") in new stack
    -- Executing PlayTones("Zap/1-1", "ring") in new stack
    -- Executing Wait("Zap/1-1", "5") in new stack
    -- Executing GotoIf("Zap/1-1", "0?inbound|s-inv|1") in new stack
    -- Executing GotoIf("Zap/1-1", "0?inbound|s-blk|1") in new stack
    -- Executing GotoIf("Zap/1-1", "0?inbound|s-blk|1") in new stack
    -- Executing GotoIf("Zap/1-1", "1?inbound|s-wht|1") in new stack
    -- Goto (inbound,s-wht,1)
    -- Executing NoOp("Zap/1-1", "Incoming Whitelist Call - "CELLULAR CALL" <937XXXXXXX>") in new stack
    -- Executing Goto("Zap/1-1", "inbound|s-pass|1") in new stack
    -- Goto (inbound,s-pass,1)
    -- Executing GotoIf("Zap/1-1", "0=1?vm-in|vm|1") in new stack
    -- Executing Playback("Zap/1-1", "pls-wait-connect-call") in new stack
    -- Playing 'pls-wait-connect-call' (language 'en')
    -- Executing Dial("Zap/1-1", "SIP/100|45|tmro") in new stack
    -- Called 100
    -- Started music on hold, class 'default', on Zap/1-1
    -- SIP/100-08cdff58 is ringing
    -- Nobody picked up in 45000 ms
    -- Stopped music on hold on Zap/1-1
    -- Executing Goto("Zap/1-1", "vm-in|vm|1") in new stack
    -- Goto (vm-in,vm,1)
    -- Executing Wait("Zap/1-1", "1") in new stack
  == Spawn extension (vm-in, vm, 1) exited non-zero on 'Zap/1-1'
    -- Hungup 'Zap/1-1'

And finally, my zapata.conf file…

[channels]
;Channel defaults
usecallerid=yes
hidecallerid=no
cidsignalling=bell
callerid=asreceived
cidstart=ring
sendcalleridafter=1
usecallingpres=yes
faxdetect=incoming
callwaiting=no
threewaycalling=no
transfer=no
echocancel=yes
echotraining=yes
immediate=no
hanguponpolarityswitch=yes
musiconhold=default

;Channel definitions
context=inbound
signalling=fxs_ks
rxgain=12.5
txgain=3.0
group=1
channel => 1

All the adjustments in the zapata.conf are from things that I have been able to find on the internet from various * faqs, wikis and such. I’ve changed the rxgain up and down, and none of the variances affected reception of cid from those numbers that seem to send cid correctly. The only things that I can think of that there could be wrong is the caller id string comparator at the 5th line of ‘s’ exten…beats me, though.

Of everything in asterisk, this is the only thing that has given me fits. Everything else works perfectly. I can even do stuff that my Nortel Option 11c at work can’t do…and * is a LOT easier to program! :wink:

Thanks everyone for a great forum and great software!
Mike

I kinda wanted to see CALLERID(all) in the NoOp before you did any processing…

Ahhh, I think I see where you are going with this. Didn’t think about checking before all the processing…

I changed the code in the ‘s’ extension, thus…

;Generic inbound context
exten => s,1,NoOp(${CALLERID(all)})                                             ; No CID here, maybe?
exten => s,n,Wait(10)                                                           ; Delay for caller id detection
exten => s,n,NoOp(${CALLERID(all)})                                             ; Should have CID
exten => s,n,Answer()                                                           ; Actually answer the call
exten => s,n,NoOp(${CALLERID(all)})                                             ; Should still have CID after answer
exten => s,n,PlayTones(ring)                                                    ; "Comfort ringing" during fax detection
exten => s,n,Wait(5)                                                            ; Delay for fax detection
...etc, etc...

This is the result with a known working CID…

    -- Starting simple switch on 'Zap/1-1'
    -- Executing NoOp("Zap/1-1", ""CELLULAR CALL" <937XXXXXXX>") in new stack
    -- Executing Wait("Zap/1-1", "10") in new stack
    -- Executing NoOp("Zap/1-1", ""CELLULAR CALL" <937XXXXXXX>") in new stack
    -- Executing Answer("Zap/1-1", "") in new stack
    -- Executing NoOp("Zap/1-1", ""CELLULAR CALL" <937XXXXXXX>") in new stack
    -- Executing PlayTones("Zap/1-1", "ring") in new stack
    -- Executing Wait("Zap/1-1", "5") in new stack
    -- Executing GotoIf("Zap/1-1", "0?inbound|s-inv|1") in new stack
    -- Executing GotoIf("Zap/1-1", "0?inbound|s-blk|1") in new stack
    -- Executing GotoIf("Zap/1-1", "0?inbound|s-blk|1") in new stack
    -- Executing GotoIf("Zap/1-1", "1?inbound|s-wht|1") in new stack
    -- Goto (inbound,s-wht,1)
    -- Executing NoOp("Zap/1-1", "Incoming Whitelist Call - "CELLULAR CALL" <937XXXXXXX>") in new stack
    -- Executing Goto("Zap/1-1", "inbound|s-pass|1") in new stack
    -- Goto (inbound,s-pass,1)
    -- Executing GotoIf("Zap/1-1", "0=1?vm-in|vm|1") in new stack
    -- Executing Playback("Zap/1-1", "pls-wait-connect-call") in new stack
    -- Playing 'pls-wait-connect-call' (language 'en')
    -- Executing Dial("Zap/1-1", "SIP/100|45|tmro") in new stack
    -- Called 100
    -- Started music on hold, class 'default', on Zap/1-1
    -- SIP/100-08f50d00 is ringing
    -- Stopped music on hold on Zap/1-1
  == Spawn extension (inbound, s-pass, 3) exited non-zero on 'Zap/1-1'
    -- Hungup 'Zap/1-1'

I will make a call from work and a problem cell phone in the morning and post the results here. I was surprised to see the first NoOp populated with CID info even before the 10s delay.

As far as the cell phones, the only differences I noticed in testing with my phone switch at work is the Cingular cell phones transmit the subscriber name and number, whereas Verizon transmits “CELLULAR CALL” and the number. I haven’t looked around for other people at work that have other cell providers to test yet.

For the phone switch at work, our caller id is often no name, and a seven digit number, i.e. instead of 937425XXXX, it often appears on caller id boxes as 425XXXX. I think this is an artifact of our phone switch rather than Time Warner.

Thanks for your help, dswartz! I look forward to getting this taken care of.

Here is the log of a call this morning from an extension at work…

    -- Starting simple switch on 'Zap/1-1'
    -- Executing NoOp("Zap/1-1", """ <>") in new stack
    -- Executing Wait("Zap/1-1", "10") in new stack
    -- Executing NoOp("Zap/1-1", """ <>") in new stack
    -- Executing Answer("Zap/1-1", "") in new stack
    -- Executing NoOp("Zap/1-1", """ <>") in new stack
    -- Executing PlayTones("Zap/1-1", "ring") in new stack
    -- Executing Wait("Zap/1-1", "5") in new stack
    -- Executing GotoIf("Zap/1-1", "1?inbound|s-inv|1") in new stack
    -- Goto (inbound,s-inv,1)
    -- Executing NoOp("Zap/1-1", "Incoming call with invalid Caller ID info") in new stack
    -- Executing PlayTones("Zap/1-1", "info") in new stack
    -- Executing Wait("Zap/1-1", "1") in new stack
    -- Executing Playback("Zap/1-1", "were-sorry") in new stack
    -- Playing 'were-sorry' (language 'en')
    -- Executing Playback("Zap/1-1", "privacy-unident") in new stack
    -- Playing 'privacy-unident' (language 'en')
    -- Executing Playback("Zap/1-1", "please-hang-up-and-try-again") in new stack
    -- Playing 'please-hang-up-and-try-again' (language 'en')
    -- Executing Congestion("Zap/1-1", "") in new stack
  == Spawn extension (inbound, s-inv, 7) exited non-zero on 'Zap/1-1'
    -- Hungup 'Zap/1-1'

As expected, no caller id info is present. Any thoughts on what I should check next? Should I change any settings in the zapata.conf file? …or anywhere else? If I call my cell phone from the same number, the caller id number is there, but is only 7 digits.

Thanks!
Mike

I got hold of a Cingular cell phone just now, one that I tried in the past that did not get CID…and it is working. Here is the excerpt from the log…

    -- Starting simple switch on 'Zap/1-1'
    -- Executing NoOp("Zap/1-1", ""CELLULAR CALL" <937XXXXXXX>") in new stack
    -- Executing Wait("Zap/1-1", "10") in new stack
    -- Executing NoOp("Zap/1-1", ""CELLULAR CALL" <937XXXXXXX>") in new stack
    -- Executing Answer("Zap/1-1", "") in new stack
    -- Executing NoOp("Zap/1-1", ""CELLULAR CALL" <937XXXXXXX>") in new stack
    -- Executing PlayTones("Zap/1-1", "ring") in new stack
    -- Executing Wait("Zap/1-1", "5") in new stack
    -- Executing GotoIf("Zap/1-1", "0?inbound|s-inv|1") in new stack
    -- Executing GotoIf("Zap/1-1", "0?inbound|s-blk|1") in new stack
    -- Executing GotoIf("Zap/1-1", "0?inbound|s-blk|1") in new stack
    -- Executing GotoIf("Zap/1-1", "0?inbound|s-wht|1") in new stack
    -- Executing GotoIf("Zap/1-1", "0?inbound|s-wht|1") in new stack
    -- Executing Goto("Zap/1-1", "inbound|s-cid|1") in new stack
    -- Goto (inbound,s-cid,1)
    -- Executing NoOp("Zap/1-1", "Incoming Call - "CELLULAR CALL" <937XXXXXXX>") in new stack
    -- Executing Zapateller("Zap/1-1", "") in new stack
    -- Executing GotoIf("Zap/1-1", "1=0?inbound|s-pass|1") in new stack
    -- Goto (inbound,s-pass,1)
    -- Executing GotoIf("Zap/1-1", "0=1?vm-in|vm|1") in new stack
    -- Executing Playback("Zap/1-1", "pls-wait-connect-call") in new stack
    -- Playing 'pls-wait-connect-call' (language 'en')
    -- Executing Dial("Zap/1-1", "SIP/210&SIP/220|45|tmro") in new stack
    -- Called 210
    -- Called 220
    -- Started music on hold, class 'default', on Zap/1-1
    -- SIP/210-090a3b10 is ringing
    -- SIP/210-090a3b10 is ringing
    -- SIP/220-090c3970 is ringing
    -- Stopped music on hold on Zap/1-1
  == Spawn extension (inbound, s-pass, 3) exited non-zero on 'Zap/1-1'
    -- Hungup 'Zap/1-1'

I don’t know what changed between yesterday and today that would cause the caller id to come through on a cell that was not working. The only thing I changed is the dial statement in the ‘s-pass’ exten to dial two sip hard-phone extensions. This is only executed after all the caller id processing.

The only other interesting thing is that the cid is “CELLULAR CALL” as opposed to the person’s actual name. When he calls an extension at work it will display his name. This is probably something goofy with the way Ameritech/SBC/AT&T handles cid as opposed to Time Warner (our CLEC at work).

Thanks!
Mike

I have done more testing and it appears that calls from some Cingular cell phones still cause the issue with no Caller ID appearing, and it happens randomly.

I tested from several work numbers and they are all still not showing Caller ID.

I have sent an email to our phone system maintenance company for info on how to examine and change the Caller ID output on our Nortel switch. Any thoughts that since the CID output is only the seven-digit phone number that Asterisk may view this as a corrupt CID string and not recognize it?

If anyone has any ideas on what to try I’m willing to entertain ideas and try anything. I really don’t think it is a problem with Asterisk, though.

Thanks,
Mike