Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/tm/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,10 @@ int t_handle_async(struct sip_msg *msg, struct action* a,
}

if (route_type!=REQUEST_ROUTE) {
LM_WARN("async detected in non-request route, switching to sync\n");
LM_WARN("async detected in non-request route, switching to sync (extra debug info: Call-Id: %.*s, User-Agent: %.*s)\n",
(msg->callid ? msg->callid->body.len : 3), (msg->callid ? msg->callid->body.s : "N/A"),
(msg->user_agent ? msg->user_agent->body.len : 3), (msg->user_agent ? msg->user_agent->body.s : "N/A")
);
goto sync;
}

Expand Down
25 changes: 23 additions & 2 deletions receive.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,29 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info,
end:
reset_global_context();

__stop_expire_timer( start, execmsgthreshold, "msg processing",
msg->buf, msg->len, 0, slow_msgs);
if (msg) {
const char *fmt = "(extra debug info: Call-Id: %.*s, User-Agent: %.*s)";

int callid_len = (msg->callid ? msg->callid->body.len : 3);
const char *callid_str = (msg->callid ? msg->callid->body.s : "N/A");

int ua_len = (msg->user_agent ? msg->user_agent->body.len : 3);
const char *ua_str = (msg->user_agent ? msg->user_agent->body.s : "N/A");

int size = strlen(fmt) - 8 + callid_len + ua_len + 1;

char *buf = pkg_malloc(size);
if (buf) {
snprintf(buf, size, fmt, callid_len, callid_str, ua_len, ua_str);
__stop_expire_timer(start, execmsgthreshold, "msg processing",
buf, size, 0, slow_msgs);
pkg_free(buf);
} else {
__stop_expire_timer(start, execmsgthreshold, "msg processing",
NULL, 0, 0, slow_msgs);
}
}

reset_longest_action_list(execmsgthreshold);

/* free possible loaded avps -bogdan */
Expand Down
2 changes: 1 addition & 1 deletion ut.h
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ static inline void log_expiry(int time_diff,int expire,
tcp_timeout_con_get;
} else
LM_WARN("threshold exceeded : %s took too long - %d us."
"Source : %.*s\n",func_info,time_diff,dbg_len,redact_pii(extra_dbg));
"Source : %.*s\n",func_info,time_diff,dbg_len,(strncmp(func_info, "msg", 3) == 0 ? extra_dbg : redact_pii(extra_dbg)));

if (memcmp(func_info,"msg",3) == 0) {
for (i=0;i<LONGEST_ACTION_SIZE;i++) {
Expand Down
Loading