Browse code

topoh: let replies for CANCEL requests be handled

- CANCEL is hop by hop, but can have the call-id hidden when sending out

Daniel-Constantin Mierla authored on 21/02/2014 17:26:34
Showing 1 changed files
... ...
@@ -318,8 +318,9 @@ int th_msg_received(void *data)
318 318
 		if(msg.via2==0)
319 319
 		{
320 320
 			/* one Via in received reply -- it is for local generated request
321
-			 * - nothing to unhide */
322
-			goto done;
321
+			 * - nothing to unhide unless is CANCEL/ACK */
322
+			if((get_cseq(&msg)->method_id)&(METHOD_CANCEL))
323
+				goto done;
323 324
 		}
324 325
 
325 326
 		th_unmask_via(&msg, &th_cookie_value);
... ...
@@ -385,12 +386,6 @@ int th_msg_sent(void *data)
385 386
 		th_del_cookie(&msg);
386 387
 	if(msg.first_line.type==SIP_REQUEST)
387 388
 	{
388
-		if(msg.via2==0)
389
-		{
390
-			/* one Via in request sent out -- it is local generated
391
-			 * - nothing to hide */
392
-			goto done;
393
-		}
394 389
 		direction = (th_cookie_value.s[0]=='u')?1:0; /* upstream/downstram */
395 390
 		dialog = (get_to(&msg)->tag_value.len>0)?1:0;
396 391
 		local = (th_cookie_value.s[0]!='d'&&th_cookie_value.s[0]!='u')?1:0;