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

Gregory Hinton Nietsky gregory at networksentry.co.za
Tue May 24 07:11:20 MST 2005



i want have a simple macro to set the DB with information on how to handle 
DDI/MSN i however have numbers of various lengths my current DP looks like 
this ...

exten => _*94*XXXX*XX.,1,Macro(setddi,${EXTEN:4:4},${EXTEN:9})
exten => _*94*XXXXX*XX.,1,Macro(setddi,${EXTEN:4:5},${EXTEN:10})
exten => _*94*XXXXXX*XX.,1,Macro(setddi,${EXTEN:4:6},${EXTEN:11})
exten => _*94*XXXXXXX*XX.,1,Macro(setddi,${EXTEN:4:7},${EXTEN:12})
exten => _*94*XXXXXXXX*XX.,1,Macro(setddi,${EXTEN:4:8},${EXTEN:13})
exten => _*94*XXXXXXXXX*XX.,1,Macro(setddi,${EXTEN:4:9},${EXTEN:14})
exten => _*94*XXXXXXXXXX*XX.,1,Macro(setddi,${EXTEN:4:10},${EXTEN:15})

rather messy what id like to do is 
exten => _*94*X.,1,Macro(setddi,${EXTEN})

and do somthing like this in the macro
exten => s,n,SET(NUMBER=${STRPOS(*,${ARG1})}
exten => s,n,SET(DB(DDI/${ARG1:1:${NUMBER}})=${ARG1:${NUMBER}})

--
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