static void local_log_tx_msg(pjsip_tx_data* tdata) { LOG_VERBOSE("TX %d bytes %s to %s %s:%d:\n" "--start msg--\n\n" "%.*s\n" "--end msg--", (tdata->buf.cur - tdata->buf.start), pjsip_tx_data_get_info(tdata), tdata->tp_info.transport->type_name, tdata->tp_info.dst_name, tdata->tp_info.dst_port, (int)(tdata->buf.cur - tdata->buf.start), tdata->buf.start); }
static pj_status_t on_tx_msg(pjsip_tx_data *tdata) { if (msg_log_enabled) { PJ_LOG(4,(THIS_FILE, "TX %d bytes %s to %s:%s:%d:\n" "%.*s\n" "--end msg--", (tdata->buf.cur - tdata->buf.start), pjsip_tx_data_get_info(tdata), tdata->tp_info.transport->type_name, tdata->tp_info.dst_name, tdata->tp_info.dst_port, (tdata->buf.cur - tdata->buf.start), tdata->buf.start)); } return PJ_SUCCESS; }
/* Notification on outgoing messages */ static pj_status_t logging_on_tx_msg(pjsip_tx_data *tdata) { if (!app.enable_msg_logging) return PJ_SUCCESS; PJ_LOG(3,(THIS_FILE, "TX %d bytes %s to %s %s:%d:\n" "%.*s\n" "--end msg--", (tdata->buf.cur - tdata->buf.start), pjsip_tx_data_get_info(tdata), tdata->tp_info.transport->type_name, tdata->tp_info.dst_name, tdata->tp_info.dst_port, (int)(tdata->buf.cur - tdata->buf.start), tdata->buf.start)); return PJ_SUCCESS; }
/* * Decrease transport data reference, destroy it when the reference count * reaches zero. */ PJ_DEF(pj_status_t) pjsip_tx_data_dec_ref( pjsip_tx_data *tdata ) { pj_assert( pj_atomic_get(tdata->ref_cnt) > 0); if (pj_atomic_dec_and_get(tdata->ref_cnt) <= 0) { PJ_LOG(5,(tdata->obj_name, "Destroying txdata %s", pjsip_tx_data_get_info(tdata))); pjsip_tpselector_dec_ref(&tdata->tp_sel); #if defined(PJ_DEBUG) && PJ_DEBUG!=0 pj_atomic_dec( tdata->mgr->tdata_counter ); #endif pj_atomic_destroy( tdata->ref_cnt ); pj_lock_destroy( tdata->lock ); pjsip_endpt_release_pool( tdata->mgr->endpt, tdata->pool ); return PJSIP_EBUFDESTROYED; } else { return PJ_SUCCESS; } }
/* Notification on outgoing messages */ static pj_status_t logging_on_tx_msg(pjsip_tx_data *tdata) { /* Important note: * tp_info field is only valid after outgoing messages has passed * transport layer. So don't try to access tp_info when the module * has lower priority than transport layer. */ PJ_LOG(4,(THIS_FILE, "TX %d bytes %s to %s %s:%d:\n" "%.*s\n" "--end msg--", (tdata->buf.cur - tdata->buf.start), pjsip_tx_data_get_info(tdata), tdata->tp_info.transport->type_name, tdata->tp_info.dst_name, tdata->tp_info.dst_port, (int)(tdata->buf.cur - tdata->buf.start), tdata->buf.start)); /* Always return success, otherwise message will not get sent! */ return PJ_SUCCESS; }