[asterisk-users] Including doesn't have any effect

A J Stiles asterisk_list at earthshod.co.uk
Mon Jun 6 03:14:38 CDT 2016


On Saturday 04 Jun 2016, Markus wrote:
> Hi list,
> 
> n00b question, but I can't figure it out:
> 
> [callthrough]
> exten => _+X.,1,NoOp(nothing here)
> #include "blockedall.conf"
> exten => _+X.,n(hangup),Hangup
> exten => _+X.,n(nohangup),GotoIf($["${CALLERID(num)}" =
> "anonymous"]?nocli:cli)
> ... more stuff that is handling the call ...
> 
> I'm putting CLIs that I don't want to be able to call my system into
> blockedall.conf:
> 
> exten => _+X.,n,GotoIf($["${CALLERID(num)}" =
> "+493456789"]?hangup:nohangup) exten => _+X.,n,GotoIf($["${CALLERID(num)}"
> = "+492345678"]?hangup:nohangup) exten =>
> _+X.,n,GotoIf($["${CALLERID(num)}" = "+491234567"]?hangup:nohangup)
> 
> But it never moves to "hangup" when I call from any of those CLIs :-(
> 
> BUT, if I include it directly in extensions.conf, it works:
> 
> [callthrough]
> exten => _+X.,1,NoOp(nothing here)
> exten => _+X.,n,GotoIf($["${CALLERID(num)}" =
> "+493456789"]?hangup:nohangup) exten => _+X.,n(hangup),Hangup
> exten => _+X.,n(nohangup),GotoIf($["${CALLERID(num)}" =
> "anonymous"]?nocli:cli)
> ... more stuff that is handling the call ...
> 
> I made sure that "blockedall.conf" actually gets included by executing
> "dialplan show callthrough".
> 
> What am I missing?

You missed that you were jumping past the second and subsequent tests, if the 
first one failed.  But that's already been pointed out.

But why not call an AGI script, have this check the caller ID against a MySQL 
database and return a status -- blocked or not -- in a variable?  Then you can 
manage individual number blocking in a much cleaner, more extensible fashion.

Feel free to ignore me if it sounds like I'm suggesting you walk all the way 
to the tool shed to fetch a chisel, when you know the screwdriver in your 
drawer is already up to the job :)

-- 
AJS

Note:  Originating address only accepts e-mail from list!  If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .



More information about the asterisk-users mailing list