MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / __script_trace

Function __script_trace

action.c:1297–1317  ·  view source on GitHub ↗

* prints the current point of execution in the OpenSIPS script * * @class - optional, string to be printed meaning the class of action (if any) * @action - mandatory, string with the name of action * @msg - mandatory, sip message * @line - line in script */

Source from the content-addressed store, hash-verified

1295 * @line - line in script
1296 */
1297void __script_trace(const char *class, const char *action, struct sip_msg *msg,
1298 const char *file, int line)
1299{
1300 str val;
1301
1302 if (pv_printf_s(msg, &script_trace_elem, &val) != 0) {
1303 LM_ERR("Failed to evaluate variables\n");
1304 return;
1305 }
1306
1307 /* Also print extra info */
1308 if (script_trace_info) {
1309 LM_GEN1(script_trace_log_level, "[Script Trace][%s:%d][%s][%s %s]"\
1310 " -> (%.*s)\n", file, line, script_trace_info,
1311 class?class:"", action, val.len, val.s);
1312 } else {
1313 LM_GEN1(script_trace_log_level, "[Script Trace][%s:%d][%s %s]"\
1314 " -> (%.*s)\n", file, line,
1315 class?class:"", action, val.len, val.s);
1316 }
1317}
1318
1319/**
1320 * functions used to populate $params() vars in the route_param structure

Callers

nothing calls this directly

Calls 1

pv_printf_sFunction · 0.85

Tested by

no test coverage detected