How to go to the beginning of the macro in ael?

Hello! Found on the Internet suitable for my needs, the macro and try to translate it in ael format. Faced with the problem of the return to the beginning of the macro.
[macro-gsm]
exten => s,1(start),Set(ARG2=$[${ARG2} + 1]); 
same => n,GotoIf($[${ARG2}>=9005]?sip:repeat);
same => n(repeat),MYSQL(Connect connid localhost asterisk password asterisk); 
same => n,MYSQL(Query resultid ${connid} SELECT SUM(`billsec`) FROM `cdr` WHERE `dstchannel` LIKE '%${ARG2}%' AND `calldate` BETWEEN DATE_FORMAT(NOW(),'%Y-%m-01') AND LAST_DAY(NOW()) + INTERVAL 1 DAY) ;
same => n,MYSQL(Fetch fetchid ${resultid} duration) ; 
same => n,MYSQL(Clear ${resultid}) ;
same => n,MYSQL(Disconnect ${connid})
same => n,GotoIf($[${duration}<=18000]?call:start) ; 
same => n(call),Set(limit=$[18000 - ${duration}]) ; 
same => n,Dial(SIP/${ARG2}/${ARG1},,S(${limit})tTr) ;
same => n,GotoIf($[${DIALSTATUS}=ANSWER]?finish:start) ;
same => n(sip),Dial(SIP/ctm/${ARG1},,Ttr) ;
same => n(finish),Hangup ;


In the choice of sw I need to run the cycle, ie to back up.
macro test( ext, trk ) {
 Set(trk=$[${trk} + 1]);
GotoIf($[${trk}>=9005]?sip:repeat);
repeat:
 MYSQL(Connect connid localhost asterisk password asterisk);
 MYSQL(Query resultid ${connid} SELECT SUM(`billsec`) FROM `cdr` WHERE `dstchannel` LIKE '%${trk}%' AND `calldate` BETWEEN DATE_FORMAT(NOW(),'%Y-%m-01') AND LAST_DAY(NOW()) + INTERVAL 1 DAY);
 MYSQL(Fetch fetchid ${resultid} duration);
 MYSQL(Clear ${resultid});
 MYSQL(Disconnect ${connid});
Noop(${duration});
 GotoIf($["${duration}" <= "50"]?wll:sw);
wll:
 Set(limit=$[50 - ${duration}]);
Dial(SIP/${ext}@${trk},,S(${limit})tTr);
sw:
????
sip:
Dial(SIP/${ext}@provider,60);
Hangup;
}

How can we implement the transition?
July 8th 19 at 15:58
1 answer
July 8th 19 at 16:00
Decided using labels and goto.
What happened in the end write? - Dariana.OKon commented on July 8th 19 at 16:03

Find more questions by tags Asterisk