[Asterisk-Users] Call Forward or DND

Kristian Kielhofner kris at krisk.org
Mon Mar 7 17:50:29 MST 2005


Howard Lowndes wrote:
> On Tue, 2005-03-08 at 10:48, Anton Krall wrote:
> 
>>Nice idea.. Now, also We would need to check the number of digitsentered, if
>>more than X, then call is an outside number, is less than X, then its an
>>internal extension..
> 
> 
> Simple.
> 
> SetGlobalVar(DIGITS=4)
> GotoIf($[${LEN(${EXTEN}) > ${DIGITS}]?s-ext:s-int)
> 
>>Sounds good? 

I don't like to shoot down other users' ideas, but I feel that this is a 
situation where there is clearly one superior way to accomplish this task:

A GotoIf/SetVar is completely unnecessary.  Again, use the context that 
your internal sip phones use, and a goto() into that context with the 
forwarded number:

Goto(my-internal-sipphones,1234)
Goto(my-internal-sipphones,8005551212)

	The first argument is the context, the next argument is the number. 
Your internal sip phones should be able to reach each other via 
"extension" dialing and (hopefully) be able to reach outside numbers as 
well.  No gotoif's, etc. needed.  It gives you the ability to forward 
calls to ANY number that your sip phones can call (via THEIR context). 
Very flexible.

--
Kristian Kielhofner



More information about the asterisk-users mailing list