Curl retry

Hi,

I am using Asterisk CURL for submitting data to an external server. I want to perform a retry if i don’t get any response from the external server?

How can i do this?

Thanks in advance,
Konstantinos

You have to check the response you get and igf you dont get what you want loop back. (but make sure you dont set up an infinate loop)

Use While, EndWhile construct.

same =>n,Set(i=1)
same =>n,While($[${i} < 5])
;-- PUT YOUR CURL LOGIC HERE. IF NO RESPONSE THEN CONTINUE, OTHERWISE SKIP THE LOOP–;
… …
same=>n,GotoIf($[${IsThisWhatIWant} = 1]? success,s,1 : )
same=>n,Set(i=$[${i} + 1])
same=>n,EndWhile()

–Satish Barot

Thank you,

Konstantinos