[Asterisk-Dev] Re: How Do I ... time for a index/strpos function ??

Gregory Hinton Nietsky gregory at networksentry.co.za
Wed May 25 18:04:06 MST 2005



ive put this together ...

heres one application i can see this coming in usefull all over ...

see http://bugs.digium.com/view.php?id=4378

 ;to forward all calls to a alternate number dial *21* followed by the
 ;number to forward and to cancel dial *21
 ;the number can be *21*<EXTEN>*<number to forward to>
 exten => _*21*X.,1,Macro(fwdim,${CALLERIDNUM},${EXTEN:4})
 exten => *21,1,Macro(fwdim,${CALLERIDNUM})
 
 [macro-fwdim]
 exten => s,1,GotoIF(${EXISTS(${ARG2})}?:del)
 exten => s,n,GotoIf($[${STRPOS(*,${ARG2})} > 0]?new)
 exten => s,n,SET(CFIM=${ARG2})
 exten => s,n,SET(FWD=${ARG1})
 exten => s,n,Goto(fwd)
 exten => s,n(new),SET(NUMBER=${STRPOS(*,${ARG2})})
 exten => s,n,SET(FWD=${ARG2:0:${NUMBER}})
 exten => s,n,SET(TMP=${ARG2:${NUMBER}})
 exten => s,n,SET(CFIM=${TMP:1})
 exten => s,n(fwd),Macro(authuser,${FWD})
 exten => s,n,SET(RTDB(${FWD}/CFIM)=${CFIM})
 exten => s,n,Background(call-fwd-unconditional)
 exten => s,n,Background(activated)
 exten => s,n,Hangup
 exten => s,n(del),SET(RTDB(${ARG1}/CFIM)=)
 exten => s,n,Macro(authuser,${ARG1})
 exten => s,n,Background(call-fwd-unconditional)
 exten => s,n,Background(de-activated)
 exten => s,n,Hangup

--
This message has been scanned for viruses and
dangerous content by Network Sentry, and is
believed to be clean.
http://www.networksentry.co.za




More information about the asterisk-dev mailing list