All pastes #584945 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-06-23 00:15 UTC
rendered paste body
     [macro-snap-catch]
          exten => s, 1, GotoIf($["${CALLERID(num)}"=""]?returntoivr);
          exten => s, n, GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardLimit)})}=1]?cleanup);
          exten => s, n, GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardUntil)})}=1]?cleanupuntil);
          exten => s, n, GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardTo)})}=1]?cleanupto);
          exten => s, n, GotoIf($[${ISNULL(${DB(${DB(${CALLERID(num)}/ForwardTo)}/Extension)})}=1]?cleanupto);
          exten => s, n, GotoIf($[${DB(${CALLERID(num)}/ForwardLimit)}=0]?returntoivr);
          exten => s, n, GotoIf($[${DB(${CALLERID(num)}/ForwardUntil)}>${EPOCH}]?returntoivr);
          exten => s, n, NoOp(Call caught);          
          exten => s, n, GotoIf($[${DB(${CALLERID(num)}/ForwardLimit)}=-1]?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(cleanup), DBdel(${CALLERID(num)}/ForwardLimit)}) 
          exten => s, n(cleanupuntil), DBdel(${CALLERID(num)}/ForwardUntil)}) 
          exten => s, n(cleanupto), DBdel(${CALLERID(num)}/ForwardTo)}) 
          exten => s, n(returntoivr), NoOp(Caller not found in database, continuing dialplan)