[asterisk-commits] mmichelson: branch mmichelson/direct_media r382816 - /team/mmichelson/direct_...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 11 15:52:52 CDT 2013


Author: mmichelson
Date: Mon Mar 11 15:52:48 2013
New Revision: 382816

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382816
Log:
General debug cleanup.

Raised the debug level for transaction printouts since they will print a *lot*
otherwise.

Removed the S_OR() calls for getting endpoint names. It will not be needed once
the pimp_sip_location work is merged.


Modified:
    team/mmichelson/direct_media/res/res_sip_session.c

Modified: team/mmichelson/direct_media/res/res_sip_session.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/direct_media/res/res_sip_session.c?view=diff&rev=382816&r1=382815&r2=382816
==============================================================================
--- team/mmichelson/direct_media/res/res_sip_session.c (original)
+++ team/mmichelson/direct_media/res/res_sip_session.c Mon Mar 11 15:52:48 2013
@@ -390,7 +390,7 @@
 	}
 
 	ast_debug(3, "Queuing delayed request to run for %s\n",
-			S_OR(ast_sorcery_object_get_id(session->endpoint), "outbound"));
+			ast_sorcery_object_get_id(session->endpoint));
 
 	ao2_ref(session, +1);
 	ast_sip_push_task(session->serializer, send_delayed_request, session);
@@ -422,14 +422,14 @@
 	if (inv_session->state == PJSIP_INV_STATE_DISCONNECTED) {
 		/* Don't try to do anything with a hung-up call */
 		ast_debug(3, "Not sending reinvite to %s because of disconnected state...\n",
-				S_OR(ast_sorcery_object_get_id(session->endpoint), "outbound"));
+				ast_sorcery_object_get_id(session->endpoint));
 		return 0;
 	}
 
 	if (inv_session->invite_tsx) {
 		/* We can't send a reinvite yet, so delay it */
 		ast_debug(3, "Delaying sending reinvite to %s because of outstanding transaction...\n",
-				S_OR(ast_sorcery_object_get_id(session->endpoint), "outbound"));
+				ast_sorcery_object_get_id(session->endpoint));
 		return delay_request(session, on_request_creation, on_response, "INVITE");
 	}
 
@@ -495,7 +495,7 @@
 		char method[15];
 		ast_copy_pj_str(method, &tdata->msg->line.req.method.name, sizeof(method));
 		ast_debug(3, "Delaying sending %s request to %s due to outstanding transaction\n",
-				method, S_OR(ast_sorcery_object_get_id(session->endpoint), "outbound"));
+				method, ast_sorcery_object_get_id(session->endpoint));
 		delay_request(session, NULL, on_response, method);
 		return;
 	}
@@ -584,7 +584,7 @@
 	struct ast_sip_session_delayed_request *delay;
 
 	ast_debug(3, "Destroying SIP session with endpoint %s\n",
-			S_OR(ast_sorcery_object_get_id(session->endpoint), "outbound"));
+			ast_sorcery_object_get_id(session->endpoint));
 
 	while ((supplement = AST_LIST_REMOVE_HEAD(&session->supplements, next))) {
 		if (supplement->session_destroy) {
@@ -1062,36 +1062,38 @@
 	pjsip_endpt_schedule_timer(ast_sip_get_pjsip_endpoint(), &session->rescheduled_reinvite, &tv);
 }
 
-static void print_debug_details(const char *function, pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e)
+static void __print_debug_details(const char *function, pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e)
 {
 	struct ast_sip_session *session;
-	ast_debug(3, "Function %s called on event %s\n", function, pjsip_event_str(e->type));
+	ast_debug(5, "Function %s called on event %s\n", function, pjsip_event_str(e->type));
 	if (!inv) {
-		ast_debug(3, "Transaction %p does not belong to an inv_session?\n", tsx);
-		ast_debug(3, "The transaction state is %s\n", pjsip_tsx_state_str(tsx->state));
+		ast_debug(5, "Transaction %p does not belong to an inv_session?\n", tsx);
+		ast_debug(5, "The transaction state is %s\n", pjsip_tsx_state_str(tsx->state));
 		return;
 	}
 	session = inv->mod_data[session_module.id];
 	if (!session) {
-		ast_debug(3, "inv_session %p has no ast session\n", inv);
+		ast_debug(5, "inv_session %p has no ast session\n", inv);
 	} else {
-		ast_debug(3, "The state change pertains to the session with %s\n",
-				S_OR(ast_sorcery_object_get_id(session->endpoint), "outbound"));
+		ast_debug(5, "The state change pertains to the session with %s\n",
+				ast_sorcery_object_get_id(session->endpoint));
 	}
 	if (inv->invite_tsx) {
-		ast_debug(3, "The inv session still has an invite_tsx (%p)\n", inv->invite_tsx);
+		ast_debug(5, "The inv session still has an invite_tsx (%p)\n", inv->invite_tsx);
 	} else {
-		ast_debug(3, "The inv session does NOT have an invite_tsx\n");
+		ast_debug(5, "The inv session does NOT have an invite_tsx\n");
 	}
 	if (tsx) {
-		ast_debug(3, "The transaction involved in this state change is %p\n", tsx);
-		ast_debug(3, "The current transaction state is %s\n", pjsip_tsx_state_str(tsx->state));
-		ast_debug(3, "The transaction state change event is %s\n", pjsip_event_str(e->body.tsx_state.type));
+		ast_debug(5, "The transaction involved in this state change is %p\n", tsx);
+		ast_debug(5, "The current transaction state is %s\n", pjsip_tsx_state_str(tsx->state));
+		ast_debug(5, "The transaction state change event is %s\n", pjsip_event_str(e->body.tsx_state.type));
 	} else {
-		ast_debug(3, "There is no transaction involved in this state change\n");
-	}
-	ast_debug(3, "The current inv state is %s\n", pjsip_inv_state_name(inv->state));
-}
+		ast_debug(5, "There is no transaction involved in this state change\n");
+	}
+	ast_debug(5, "The current inv state is %s\n", pjsip_inv_state_name(inv->state));
+}
+
+#define print_debug_details(inv, tsx, e) __print_debug_details(__PRETTY_FUNCTION__, (inv), (tsx), (e))
 
 static void handle_incoming_request(struct ast_sip_session *session, pjsip_rx_data *rdata)
 {
@@ -1202,10 +1204,8 @@
 {
 	struct ast_sip_session *session = inv->mod_data[session_module.id];
 
-	print_debug_details(__PRETTY_FUNCTION__, inv, NULL, e);
-
-	ast_debug(3, "on_state_changed callback called. Event dump to follow\n");
-	ast_debug(3, "inv state is %s, event type is %s\n", pjsip_inv_state_name(inv->state), pjsip_event_str(e->type));
+	print_debug_details(inv, NULL, e);
+
 	switch(e->type) {
 	case PJSIP_EVENT_TX_MSG:
 		handle_outgoing(session, e->body.tx_msg.tdata);
@@ -1253,7 +1253,7 @@
 static void session_inv_on_tsx_state_changed(pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e)
 {
 	struct ast_sip_session *session = inv->mod_data[session_module.id];
-	print_debug_details(__PRETTY_FUNCTION__, inv, tsx, e);
+	print_debug_details(inv, tsx, e);
 	if (!session) {
 		/* Transaction likely timed out after the call was hung up. Just
 		 * ignore such transaction changes




More information about the asterisk-commits mailing list