X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=apppbx.cpp;h=15fa438905b28e86dc142a4b9d9fab33afcedab5;hp=880129d6da5063d31d9f3918874bdcb7971ca9d5;hb=9deb150f2ba289736e81f69bb7cf24e5b236ee96;hpb=b53b484c91209f5d8f1e2f9c56026021de1b6142 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; }