Browse code

tm: handle success return code by forward_request() for e2e ACK

- forward_request() returns 0 on success, propagate 1 to config wrapper
- backport of 171e3b9f197ffebaa2b1a1959ba109bb442764a2

(cherry picked from commit ef84d989228836c28dd5ec5acea5c4239cab58db)

Daniel-Constantin Mierla authored on 22/02/2018 09:45:29
Showing 1 changed files
... ...
@@ -282,7 +282,7 @@ int t_relay_to( struct sip_msg  *p_msg , struct proxy_l *proxy, int proto,
282 282
 	/* at this point if the msg is an ACK it is an e2e ACK and
283 283
 	   e2e ACKs do not establish a transaction and are fwd-ed statelessly */
284 284
 	if ( p_msg->REQ_METHOD==METHOD_ACK) {
285
-		DBG( "SER: forwarding ACK  statelessly \n");
285
+		DBG("forwarding ACK statelessly\n");
286 286
 		if (proxy==0) {
287 287
 			init_dest_info(&dst);
288 288
 			dst.proto=proto;
... ...
@@ -303,7 +303,11 @@ int t_relay_to( struct sip_msg  *p_msg , struct proxy_l *proxy, int proto,
303 303
 			proxy2su(&dst.to, proxy);
304 304
 			/* dst->send_sock not set, but forward_request will take care
305 305
 			 * of it */
306
-			ret=forward_request( p_msg , 0, 0, &dst) ;
306
+			ret=forward_request(p_msg, 0, 0, &dst);
307
+		}
308
+		if (ret>=0) {
309
+			/* convert return code for cfg script */
310
+			ret=1;
307 311
 		}
308 312
 		goto done;
309 313
 	}