[sr-dev] [kamailio/kamailio] ruxc automatic retry (#2820)

Tim Chubb notifications at github.com
Wed Aug 11 12:53:52 CEST 2021


Just had a bash at adding this myself, and it seems to work nicely for my usecase...
Adding this changing calls to post or get, and defining a parameter for retry attempts
```
ruxc_http_get(&v_http_request, &v_http_response);
	//Retry enabled, either have a server error code or a connection error
	int attempt;
	attempt = 0;
	while(attempt < _ruxc_http_retry && (v_http_response.retcode < 0 || (v_http_response.rescode > 499 && v_http_response.rescode < 699)){
		attempt++;
		LM_DBG("Retrying Request Attempt: %d - Response Code: %d - Return Code: %d - URI: %s\n",
			attempt, v_http_response.retcode, v_http_response.rescode, v_http_request.url);
		ruxc_http_get(&v_http_request, &v_http_response);
	}
```
Im loving ruxc lol

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2820#issuecomment-896719750
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20210811/0acb36f8/attachment-0001.htm>


More information about the sr-dev mailing list