[asterisk-users] call forward all except the extension it is	forwarded to
    Vieri 
    rentorbuy at yahoo.com
       
    Wed Feb 11 07:12:32 CST 2009
    
    
  
--- On Wed, 2/11/09, Philipp Kempgen <philipp.kempgen at amooma.de> wrote:
> >> I would like to know if I can set Call Forwarding
> on an extension but allow direct calls from the extension it
> is forwarded to.
> >> 
> >> Example:
> >> Extension 100 sets call forwarding (all) to
> extension 101.
> >> All calls to 100 are immediately forwarded to 101
> as expected.
> >> However, if 101 tries to transfer a call to 100 or
> tries to call 100 directly, it sounds "busy"
> because it obviously goes into a loop where 101 tries to
> call itself.
> >> How do I set an "exception" so that 101
> can actually call 100 even if the latter is forwarded to
> 101?
> 
> > Use the "if" statement.
> > 
> > 100 => {
> > 	if ("${CALLERID(num)}" = "101") {
> > 		// call 100
> > 		Dial(SIP/100);
> > 	}
> > 	else {
> > 		// forward to 101
> > 		Dial(Local/101);
> > 	}
> > }
> 
> Or use Caller ID matching:
> 
> 100/101 => {
> 	// caller is 101
> 	Dial(SIP/100);
> }
> 100 => {
> 	// for other callers
> 	Dial(Local/101);
> }
I hacked the dialparties.agi script in freepbx and now it works for direct calls but fails for blind transfers, probably because I need to check another variable such as BLINDTRANSFER. Attended transfers seem to work.
Thanks
      
    
    
More information about the asterisk-users
mailing list