[asterisk-tech] GotoIf DURATION

Paul Hewlett paul at gccs.co.za
Thu Feb 22 14:43:30 SAST 2007


On Thursday 22 February 2007 14:01, Marnus van Niekerk wrote:
> Hi,
>
>  I am trying to branch a call based on it's duration but ${CDR(duration)}
> is always 0. (The idea is to keep ringing the operator until a certain
> amount of time has lapsed)
>
>  This does not work:
>  exten => s,4,Background(local/script8)
>  exten => s,5,Dial(${OPERATOR},30,tr)
>  exten => s,6,Noop(${CDR(duration)})
>  exten => s,7,GotoIf($[${CDR(duration)} < 80]?4)
>  exten => s,8,Playback(local/script7)

Try a while loop 

   exten => s,1,Set(LOOP=0)
   exten => s,n,While($[ ${LOOP} < 80 ] )
   exten => s,n,Dial(${OPERATOR},30,tr)
   exten => s,n,Gotoif( $[ "${DIALSTATUS}" != "NOANSWER"]?getout)
   exten => s,n,Set(LOOP=$[ ${LOOP} + 30 ])
   exten => s,n,Goto(s,continue)
   exten => s,n(getout),Set(LOOP=81)
   exten => s,ni(continue),Endwhile
   

Paul
-- 
Paul Hewlett  Technical Director 
Global Call Center Solutions Ltd, 2nd Floor, Milnerton Mall
Cnr Loxton & Koeberg Roads, 7435 Milnerton
paul at gccs.co.za  www.gccs.co.za
Tel: +27 86 111 3433 Fax: +27 86 111 3520 Cel: +27 76 072 7906
Gizmo: 1 747 659 6171



More information about the tech mailing list