Browse code

dialog: detailed debug messages when resolving the timeout

Daniel-Constantin Mierla authored on 22/03/2020 14:05:17
Showing 1 changed files
... ...
@@ -674,11 +674,20 @@ inline static int get_dlg_timeout(struct sip_msg *req)
674 674
 	pv_value_t pv_val;
675 675
 
676 676
 	if( timeout_avp ) {
677
-		if ( pv_get_spec_value( req, timeout_avp, &pv_val)==0 &&
678
-				pv_val.flags&PV_VAL_INT && pv_val.ri>0 ) {
679
-			return pv_val.ri;
677
+		if ( pv_get_spec_value( req, timeout_avp, &pv_val)==0) {
678
+			if(pv_val.flags&PV_VAL_INT) {
679
+				if(pv_val.ri>0 ) {
680
+					return pv_val.ri;
681
+				} else {
682
+					LM_DBG("invalid AVP value\n");
683
+				}
684
+			} else {
685
+				LM_DBG("invalid AVP type\n");
686
+			}
680 687
 		}
681
-		LM_DBG("invalid AVP value, using default timeout\n");
688
+		LM_DBG("unable to get valid AVP value, using default timeout\n");
689
+	} else {
690
+		LM_DBG("using default timeout\n");
682 691
 	}
683 692
 	return default_timeout;
684 693
 }