From 9deb150f2ba289736e81f69bb7cf24e5b236ee96 Mon Sep 17 00:00:00 2001 From: Super User Date: Wed, 30 May 2007 06:14:41 +0200 Subject: backup --- apppbx.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'apppbx.cpp') diff --git a/apppbx.cpp b/apppbx.cpp index 880129d..15fa438 100644 --- a/apppbx.cpp +++ b/apppbx.cpp @@ -135,13 +135,56 @@ EndpointAppPBX::~EndpointAppPBX(void) } +/* + * trace header for application + */ +void EndpointAppPBX::trace_header(char *name, int direction) +{ + char msgtext[sizeof(trace.name)]; + + SCPY(msgtext, name); + + /* add direction */ + if (direction) + { + if (p_m_ntmode) + { + if (direction == DIRECTION_OUT) + SCAT(msgtext, " N->U"); + else + SCAT(msgtext, " N<-U"); + } else + { + if (direction == DIRECTION_OUT) + SCAT(msgtext, " U->N"); + else + SCAT(msgtext, " U<-N"); + } + } + + /* init trace with given values */ + start_trace(0, + NULL, + nationalize(e_callerinfo.id, e_callerinfo.ntype), + e_dialinginfo.number, + direction, + CATEGORY_AP, + msgtext); +} + + EPOINT_STATE_NAMES /* set new endpoint state */ void EndpointAppPBX::new_state(int state) { - PDEBUG(DEBUG_EPOINT, "EPOINT(%d) new state %s --> %s\n", ea_endpoint->ep_serial, state_name[e_state], state_name[state]); + if (e_state != state) + { + trace_header("NEW STATE", DIRECTION_NONE); + add_trace("state", "old", "%s", state_name[e_state]); + add_trace("state", "new", "%s", state_name[state]); + } e_state = state; } -- cgit v1.2.3-55-g7522