My system is Asterisk V1 using an x100p. I’m in the UK and have a BT line.
My goal is to drop all callers with no CallerID to voice mail. I can’t seem to find a way to lookup the CallerID that’s being presenting on the PSTN line.
The X100P is a zaptel card. It’s configured in zapata.conf. There, you’ll point any incoming calls on that card at some context in extensions.conf.
In extensions.conf, you can check the callerid and branch from there.
You might use something like:
.
. [do whatever initial stuff here]
.
exten => s,n,GoToIf($["$CALLERIDNUM" = ""]?intovmail)
.
. [handle call if they have a callerid number here]
.
exten => s,n(intovmail),VoiceMail(u100)
You’ll obviously have to flesh this out, and decide whether the test of [$CALLERIDNUM" = “”] is sufficient. There are lots and lots of examples of this kind of processing out there. If you’re going to set up asterisk, you’re going to have to dig up and wade through a lot of code examples, so you need to find the places that have them. voip-info.org and “nerd vittles” are a couple of good places to start. Also this forum, the mailing lists, and voxilla.com.
And of course “the book” (Asterisk - The Future of Telephony) is essential for beginners.
It sounds like you’ve been working hard at it! Certainly post any specific questions you run into after having a go at the dial plan.
By the way, the test of CALLERIDNUM="" is probably insufficient. The nerd vittles site has, somewhere, a little callerid screening script that includes a bunch of tests for conditions that probably indicate a non-existant, blocked, or otherwise undesireable callerid condition. I’ve adapted mine from there and a few others I’ve found hunting around.