[RESOLVED] Need help - basic looped control

Hi,

I am an Asterisk newbie. I am trying to implement a looped call system (I don’t know if it is the right term). The basic scenaro is that, there are 4 contacts in my contact list. I try to dial each one by one, and if I can reach anyone then the rest of the contacts are not dialled. Every time the other party answers, they hear a message (to accept the call press one, to reject the call press two). The call is considered as reached only if the users presses 1 (so just answering is not enough).

However, I am not able to continue to the next contact when the callee presses 2, the call just ends and no other numbers are dialled. How can I make it continue to dial the next contact if they press 2? Thanks very much in advance!

So, here is my actual dialplan implementation:

[code]exten=>400,1,Progress() ;telephony signaling
same => n,Playback(followme/pls-hold-while-try,noanswer)
same => n,Dial(PJSIP/6010,20,rU(ackcall^s^1)) ; first contact,call using ackcall context
same => n,Dial(PJSIP/6002,20,rU(ackcall^s^1)) ; second contact
same => n,Playback(followme/sorry,noanswer)
same => n,Hangup()

[ackcall]
exten => s,1,Background(followme/no-recording&followme/options) ;1 to answer, 2 to reject
;same=>n,WaitExten(5)
same=>n,Read(digito,1)
same=>n,GotoIf($[${digito}=1]?nooperation,s,1:busy,s,1)

[busy]
exten=>s,1,Set(GOSUB_RESULT=BUSY)

[nooperation]
exten=>n,NoOp()[/code]

These are just some ideas but maybe they could be helpful. Since you are using the U (calling a GoSub routine) with the Dial application then I think you could just set (according to the documentation) the return as CONTINUE to have it continue on in your dialplan if they press 2 then stack up your Dial statements for each of the extensions to call. My thinking is that we would continue to the next Dial statement if we sent the CONTINUE return, otherwise, we end the call when they end the conversation.

Great, that was it! :smile: Thank you very much!