[asterisk-users] Re: Please help parse this GotoIf line

Ioan Indreias ioan.indreias at modulo.ro
Mon Feb 5 08:43:15 MST 2007


Hello Larry,

A quick suggestion - probably is not the best one, but maybe it will help:

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

exten => _4XX,1,Set(CALLERID(num)="Internal"
exten => _4XX,2,Goto(s|continue)

exten => _X.,1,Goto(s|continue)

Best regards,
nini @ www.modulo.ro


Larry Alkoff wrote:
> Thanks for your reply Anselm.  I'll play it with tomorrow.
>
> Let me ask a related question.  I also have to assign a calleridnum 
> (number) of 'Internal' to each extension dialed on an internal to 
> internal call.  They would all have 4 digit calleridnum in the range 4??
> ( or _4xx in dial plan form ) to be changed to 'Internal'.  I'd like 
> to avoid many lines of code so is there any way to do that with a wild 
> card or dial plan type?
>
> Larry
>
>
> Anselm Martin Hoffmeister wrote:
>> 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
>>
>> _______________________________________________
>> --Bandwidth and Colocation provided by Easynews.com --
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>


More information about the asterisk-users mailing list