@@ -287,8 +287,29 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info,
287287end :
288288 reset_global_context ();
289289
290- __stop_expire_timer ( start , execmsgthreshold , "msg processing" ,
291- msg -> buf , msg -> len , 0 , slow_msgs );
290+ if (msg ) {
291+ const char * fmt = "(extra debug info: Call-Id: %.*s, User-Agent: %.*s)" ;
292+
293+ int callid_len = (msg -> callid ? msg -> callid -> body .len : 3 );
294+ const char * callid_str = (msg -> callid ? msg -> callid -> body .s : "N/A" );
295+
296+ int ua_len = (msg -> user_agent ? msg -> user_agent -> body .len : 3 );
297+ const char * ua_str = (msg -> user_agent ? msg -> user_agent -> body .s : "N/A" );
298+
299+ int size = strlen (fmt ) - 8 + callid_len + ua_len + 1 ;
300+
301+ char * buf = pkg_malloc (size );
302+ if (buf ) {
303+ snprintf (buf , size , fmt , callid_len , callid_str , ua_len , ua_str );
304+ __stop_expire_timer (start , execmsgthreshold , "msg processing" ,
305+ buf , size , 0 , slow_msgs );
306+ pkg_free (buf );
307+ } else {
308+ __stop_expire_timer (start , execmsgthreshold , "msg processing" ,
309+ NULL , 0 , 0 , slow_msgs );
310+ }
311+ }
312+
292313 reset_longest_action_list (execmsgthreshold );
293314
294315 /* free possible loaded avps -bogdan */
0 commit comments