Browse code

more log info on failed CANCELing transactions

Stefan Sayer authored on 09/07/2014 18:48:17
Showing 1 changed files
... ...
@@ -1406,8 +1406,8 @@ int _trans_layer::cancel(trans_ticket* tt, const cstring& dialog_id,
1406 1406
     }
1407 1407
 
1408 1408
     if(!t){
1409
-	DBG("No transaction to cancel: wrong key or finally replied\n");
1410 1409
 	bucket->unlock();
1410
+	DBG("No transaction to cancel: wrong key or finally replied\n");
1411 1411
 	return 0;
1412 1412
     }
1413 1413
 
... ...
@@ -1416,8 +1416,10 @@ int _trans_layer::cancel(trans_ticket* tt, const cstring& dialog_id,
1416 1416
     // RFC 3261 says: SHOULD NOT be sent for other request
1417 1417
     // than INVITE.
1418 1418
     if(req->u.request->method != sip_request::INVITE){
1419
+	t->dump();
1419 1420
 	bucket->unlock();
1420
-	ERROR("Trying to cancel a non-INVITE request (we SHOULD NOT do that)\n");
1421
+	ERROR("Trying to cancel a non-INVITE request (we SHOULD NOT do that); inv_cseq: %u, i:%.*s\n",
1422
+	      inv_cseq, dialog_id.len,dialog_id.s);
1421 1423
 	return -1;
1422 1424
     }
1423 1425
     
... ...
@@ -1439,8 +1441,10 @@ int _trans_layer::cancel(trans_ticket* tt, const cstring& dialog_id,
1439 1441
     }
1440 1442
 
1441 1443
     case TS_COMPLETED:
1444
+	ERROR("Trying to cancel a request while in TS_COMPLETED state; inv_cseq: %u, i:%.*s\n",
1445
+	      inv_cseq, dialog_id.len,dialog_id.s);
1446
+	t->dump();
1442 1447
 	bucket->unlock();
1443
-	ERROR("Trying to cancel a request while in TS_COMPLETED state\n");
1444 1448
 	return -1;
1445 1449
 	
1446 1450
     case TS_PROCEEDING:
... ...
@@ -1449,8 +1453,10 @@ int _trans_layer::cancel(trans_ticket* tt, const cstring& dialog_id,
1449 1453
 	break;
1450 1454
 
1451 1455
     default:
1456
+	ERROR("Trying to cancel a request while in %s state; inv_cseq: %u, i:%.*s\n",
1457
+	      t->state_str(), inv_cseq, dialog_id.len,dialog_id.s);
1458
+	t->dump();
1452 1459
 	bucket->unlock();
1453
-	ERROR("Trying to cancel a request while in unknown state\n");
1454 1460
 	return -1;
1455 1461
     }
1456 1462