[asterisk-users] Please help parse this GotoIf line

Anselm Martin Hoffmeister anselm at hoffmeister-online.de
Thu Feb 1 16:14:26 MST 2007


Am Donnerstag, den 01.02.2007, 16:15 -0600 schrieb Larry Alkoff:
> I wish to have my Grandstream GXP-2000 phones make a different 
> distinctive ring for internal calls ( Internal ) or if the incoming call 
> has no caller id 'NOCID'.
> 
> The Grandstream phones calls allow 3 distinctive rings depending on the 
> caller id.  I have one set up and working for 'Internal' calls but 
> unfortunately the same tone will ring if caller id is absent on a call.
> 
> My solution is to insert a caller id number of 'NOCID' if there is no 
> caller id to have separate ring tones for 'NOCID' and "Internal' calls.
> 
> I have gotten this far for the nth line in my extensions.conf 
> [telasip-in] context but need help with the syntax.
> In Asteriskish it would look something like:
> 
> exten => s,n,GotoIf( NO  ${CALLERID} then SetCIDNum(NOCID)

I think something like

exten => s,n,GotoIf($["${CALLERID}" = ""]?anonymous:withnumber)
exten => s,n(anonymous),Set(CALLERID(num)="NOCID")
exten => s,n(withnumber),..........

should do the trick.

BR
Anselm



More information about the asterisk-users mailing list