All pastes #584821 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-06-22 22:59 UTC
rendered paste body
     [macro-snap-catch]
          exten     =>   s,              1,              GotoIf($["${CALLERID(num)}"=""]?returntoivr);
          exten     =>   s,              n,              GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardLimit)})}=1]?returntoivr);
          exten     =>   s,              n,              GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardTo)})}=1]?returntoivr);
          exten     =>   s,              n,              GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardUntil)})}=1]?returntoivr);
          exten     =>   s,              n,              GotoIf($[${DB(${CALLERID(num)}/ForwardLimit)}!=0]?4:returntoivr);
          exten     =>   s,              n,              GotoIf($[${DB(${CALLERID(num)}/ForwardUntil)}<${EPOCH}]?5:returntoivr);
          exten     =>   s,              n,              NoOp(Call caught);          
          exten     =>   s,              n,              GotoIf($[${DB(${CALLERID(num)}/ForwardLimit)}!=-1]?7:calluser);
          exten     =>   s,              n,              Set(newlimit=$[${DB(${CALLERID(num)}/ForwardLimit)} - 1]);
          exten     =>   s,              n,              Set(DB(${CALLERID(num)}/ForwardLimit)=${newlimit})
          exten     =>   s,              n,              Set(extension=${DB(${DB(${CALLERID(num)}/ForwardTo)}/Extension)})
          exten     =>   s,              n(calluser),    Goto(${extension});
          exten     =>   s,              n(returntoivr), NoOp(Caller not found in database, continuing dialplan)