[svn-commits] rmudgett: branch group/CCSS r248487 - /team/group/CCSS/channels/sig_pri.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Feb 23 15:47:20 CST 2010


Author: rmudgett
Date: Tue Feb 23 15:47:17 2010
New Revision: 248487

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=248487
Log:
Take advantage of the printfiness of the CC API.

Modified:
    team/group/CCSS/channels/sig_pri.c

Modified: team/group/CCSS/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/sig_pri.c?view=diff&rev=248487&r1=248486&r2=248487
==============================================================================
--- team/group/CCSS/channels/sig_pri.c (original)
+++ team/group/CCSS/channels/sig_pri.c Tue Feb 23 15:47:17 2010
@@ -1909,7 +1909,8 @@
 		if (!agent) {
 			return;
 		}
-		ast_cc_failed(agent->core_id, "ISDN agent got canceled by link");
+		ast_cc_failed(agent->core_id, "%s agent got canceled by link",
+			sig_pri_cc_type_name);
 		ao2_ref(agent, -1);
 	} else {
 		struct sig_pri_cc_monitor_instance *monitor;
@@ -1920,7 +1921,7 @@
 		}
 		monitor->cc_id = -1;
 		ast_cc_monitor_failed(monitor->core_id, monitor->name,
-			"ISDN monitor got canceled by link");
+			"%s monitor got canceled by link", sig_pri_cc_type_name);
 		ao2_ref(monitor, -1);
 	}
 }
@@ -1992,20 +1993,22 @@
 					5/* queue_full */)) {
 					pri_cc_cancel(pri->pri, subcmd->u.cc_request.cc_id);
 				}
-				ast_cc_failed(agent->core_id, "System CC queue full");
+				ast_cc_failed(agent->core_id, "%s agent system CC queue full",
+					sig_pri_cc_type_name);
 				ao2_ref(agent, -1);
 				break;
 			}
 			agent_prv = agent->private_data;
 			agent_prv->cc_request_response_pending = 1;
 			if (ast_cc_agent_accept_request(agent->core_id,
-				"Caller accepted CC offer.")) {
+				"%s caller accepted CC offer.", sig_pri_cc_type_name)) {
 				agent_prv->cc_request_response_pending = 0;
 				if (pri_cc_req_rsp(pri->pri, subcmd->u.cc_request.cc_id,
 					2/* short_term_denial */)) {
 					pri_cc_cancel(pri->pri, subcmd->u.cc_request.cc_id);
 				}
-				ast_cc_failed(agent->core_id, "CC core request accept failed");
+				ast_cc_failed(agent->core_id, "%s agent CC core request accept failed",
+					sig_pri_cc_type_name);
 			}
 			ao2_ref(agent, -1);
 			break;
@@ -2021,34 +2024,34 @@
 			switch (subcmd->u.cc_request_rsp.status) {
 			case 0:/* success */
 				ast_cc_monitor_request_acked(monitor->core_id,
-					"ISDN far end accepted CC request");
+					"%s far end accepted CC request", sig_pri_cc_type_name);
 				break;
 			case 1:/* timeout */
 				ast_verb(2, "core_id:%d %s CC request timeout\n", monitor->core_id,
 					sig_pri_cc_type_name);
 				ast_cc_monitor_failed(monitor->core_id, monitor->name,
-					"ISDN CC request timeout");
+					"%s CC request timeout", sig_pri_cc_type_name);
 				break;
 			case 2:/* error */
 				ast_verb(2, "core_id:%d %s CC request error: %s\n", monitor->core_id,
 					sig_pri_cc_type_name,
 					pri_facility_error2str(subcmd->u.cc_request_rsp.fail_code));
 				ast_cc_monitor_failed(monitor->core_id, monitor->name,
-					"ISDN CC request error");
+					"%s CC request error", sig_pri_cc_type_name);
 				break;
 			case 3:/* reject */
 				ast_verb(2, "core_id:%d %s CC request reject: %s\n", monitor->core_id,
 					sig_pri_cc_type_name,
 					pri_facility_reject2str(subcmd->u.cc_request_rsp.fail_code));
 				ast_cc_monitor_failed(monitor->core_id, monitor->name,
-					"ISDN CC request reject");
+					"%s CC request reject", sig_pri_cc_type_name);
 				break;
 			default:
 				ast_verb(2, "core_id:%d %s CC request unknown status %d\n",
 					monitor->core_id, sig_pri_cc_type_name,
 					subcmd->u.cc_request_rsp.status);
 				ast_cc_monitor_failed(monitor->core_id, monitor->name,
-					"ISDN CC request unknown status");
+					"%s CC request unknown status", sig_pri_cc_type_name);
 				break;
 			}
 			ao2_ref(monitor, -1);
@@ -2062,7 +2065,8 @@
 				pri_cc_cancel(pri->pri, subcmd->u.cc_remote_user_free.cc_id);
 				break;
 			}
-			ast_cc_monitor_callee_available(monitor->core_id, "%s callee has become available", sig_pri_cc_type_name);
+			ast_cc_monitor_callee_available(monitor->core_id,
+				"%s callee has become available", sig_pri_cc_type_name);
 			ao2_ref(monitor, -1);
 			break;
 #endif	/* defined(HAVE_PRI_CCSS) */
@@ -2111,10 +2115,11 @@
 				break;
 			}
 			if (subcmd->u.cc_status.status) {
-				ast_cc_agent_caller_busy(agent->core_id, "ISDN agent caller is busy");
+				ast_cc_agent_caller_busy(agent->core_id, "%s agent caller is busy",
+					sig_pri_cc_type_name);
 			} else {
 				ast_cc_agent_caller_available(agent->core_id,
-					"ISDN agent caller is available");
+					"%s agent caller is available", sig_pri_cc_type_name);
 			}
 			ao2_ref(agent, -1);
 			break;
@@ -2360,7 +2365,7 @@
 					ast_setup_cc_recall_datastore(owner, agent->core_id);
 					ast_cc_agent_set_interfaces_chanvar(owner);
 					ast_cc_agent_recalling(agent->core_id,
-						"ISDN caller is attempting recall");
+						"%s caller is attempting recall", sig_pri_cc_type_name);
 					ao2_ref(agent, -1);
 				}
 
@@ -5172,7 +5177,8 @@
 	}
 	ast_mutex_unlock(&cc_pvt->pri->lock);
 	if (res) {
-		ast_cc_failed(agent->core_id, "Failed to send the CC request ack.");
+		ast_cc_failed(agent->core_id, "%s agent failed to send the CC request ack.",
+			sig_pri_cc_type_name);
 	}
 }
 #endif	/* defined(HAVE_PRI_CCSS) */




More information about the svn-commits mailing list