Wed May 7 10:08:17 EDT 2008 Pekka Pessi <first.last@nokia.com>

* nua: improved logging, fixed macro expansion on __LINE__ on most compilers



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8335 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-05-09 17:44:46 +00:00
parent 68543ddc11
commit a4d8241a5d
3 changed files with 17 additions and 8 deletions

View File

@ -1 +1 @@
Fri May 9 13:43:35 EDT 2008 Fri May 9 13:44:20 EDT 2008

View File

@ -511,12 +511,19 @@ int nua_signal(nua_t *nua, nua_handle_t *nh, msg_t *msg,
e->e_status = status; e->e_status = status;
e->e_phrase = phrase; e->e_phrase = phrase;
SU_DEBUG_7(("nua(%p): signal %s\n", (void *)nh,
nua_event_name(event) + 4));
su_msg_deinitializer(sumsg, nua_event_deinit); su_msg_deinitializer(sumsg, nua_event_deinit);
retval = su_msg_send_to(sumsg, nua->nua_server, nua_stack_signal); retval = su_msg_send_to(sumsg, nua->nua_server, nua_stack_signal);
if (retval == 0){
SU_DEBUG_7(("nua(%p): %s signal %s\n", (void *)nh,
"sent", nua_event_name(event) + 4));
}
else {
SU_DEBUG_0(("nua(%p): %s signal %s\n", (void *)nh,
"FAILED TO SEND", nua_event_name(event) + 4));
}
} }
ta_end(ta); ta_end(ta);
@ -552,9 +559,9 @@ void nua_stack_signal(nua_t *nua, su_msg_r msg, nua_ee_data_t *ee)
char const *name = nua_event_name(e->e_event); char const *name = nua_event_name(e->e_event);
if (e->e_status == 0) if (e->e_status == 0)
SU_DEBUG_5(("nua(%p): signal %s\n", (void *)nh, name + 4)); SU_DEBUG_5(("nua(%p): %s signal %s\n", (void *)nh, "recv", name + 4));
else else
SU_DEBUG_5(("nua(%p): signal %s %u %s\n", SU_DEBUG_5(("nua(%p): recv signal %s %u %s\n",
(void *)nh, name + 4, (void *)nh, name + 4,
e->e_status, e->e_phrase ? e->e_phrase : "")); e->e_status, e->e_phrase ? e->e_phrase : ""));
} }
@ -651,7 +658,8 @@ void nua_stack_signal(nua_t *nua, su_msg_r msg, nua_ee_data_t *ee)
} }
if (error < 0) { if (error < 0) {
nua_stack_event(nh->nh_nua, nh, NULL, event, NUA_ERROR_AT(__FILE__, __LINE__), NULL); nua_stack_event(nh->nh_nua, nh, NULL, event,
NUA_ERROR_AT(__FILE__, __LINE__), NULL);
} }
su_msg_destroy(nua->nua_signal); su_msg_destroy(nua->nua_signal);

View File

@ -207,7 +207,8 @@ typedef struct nua_event_frame_s nua_event_frame_t;
extern char const nua_internal_error[]; extern char const nua_internal_error[];
#define NUA_INTERNAL_ERROR 900, nua_internal_error #define NUA_INTERNAL_ERROR 900, nua_internal_error
#define NUA_ERROR_AT(file, line) 900, "Internal error at " file ":" #line #define _NUA_INTERNAL_ERROR_AT(file, line) "Internal error at " file ":" #line
#define NUA_ERROR_AT(file, line) 900, _NUA_INTERNAL_ERROR_AT(file, line)
struct nua_s { struct nua_s {
su_home_t nua_home[1]; su_home_t nua_home[1];