[Asterisk-Users] GotoIf number exists in file. How can i do this?

Conrad Wood asterisk-users at conradwood.net
Fri Feb 10 13:07:26 MST 2006


On Wed, 2006-02-08 at 14:37 +0100, Arne Morten Johansen wrote:
>         Hi there.
>         
>          
>         
>         I currently have a GotoIf statement that goes to a special
>         extension priority if the CID match with one of the numbers in
>         my “list” of CIDs. The way I’ve done it now is by multiple OR
>         operators. There must be a better way. Anyone got some
>         suggestions? 
>         
>          
>         
>         This is basicly what I want.  “If CID Exists in $File, goto
>         s,10”. So when I want to add a new CID I just add a new line
>         in a txt file. 
>         
>          
>         
Or, maybe you can use the existence of a file rather then the content of
it?

exten => s,1,System(test -e /var/lib/asterisk/callerids/${CALLERID})
exten => s,2,NoOp("Normal caller")
exten => s,102,NoOp("special caller")

this way you can add callerids by simply
touch /var/lib/asterisk/callerids/<phonenumber>

does that help?

Conrad




More information about the asterisk-users mailing list