[svn-commits] moy: branch moy/mfcr2-1.4 r179288 - /team/moy/mfcr2-1.4/channels/chan_dahdi.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Mar 1 21:36:15 CST 2009


Author: moy
Date: Sun Mar  1 21:35:52 2009
New Revision: 179288

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=179288
Log:
add support to skip category request

Modified:
    team/moy/mfcr2-1.4/channels/chan_dahdi.c

Modified: team/moy/mfcr2-1.4/channels/chan_dahdi.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2-1.4/channels/chan_dahdi.c?view=diff&rev=179288&r1=179287&r2=179288
==============================================================================
--- team/moy/mfcr2-1.4/channels/chan_dahdi.c (original)
+++ team/moy/mfcr2-1.4/channels/chan_dahdi.c Sun Mar  1 21:35:52 2009
@@ -317,6 +317,7 @@
 static int mfcr2_cur_max_ani = 10;
 static int mfcr2_cur_max_dnis = 4;
 static int mfcr2_cur_get_ani_first = -1;
+static int mfcr2_cur_skip_category = -1;
 static int mfcr2_cur_context_index = 0;
 static int mfcr2_cur_call_files = 0;
 static int mfcr2_cur_allow_collect_calls = 0;
@@ -935,6 +936,7 @@
 	mfcr2_cur_max_ani = 10;
 	mfcr2_cur_max_dnis = 4;
 	mfcr2_cur_get_ani_first = -1;
+	mfcr2_cur_skip_category = -1;
 	mfcr2_cur_call_files = 0;
 	mfcr2_cur_allow_collect_calls = 0;
 	mfcr2_cur_forced_release = 0;
@@ -8215,6 +8217,7 @@
 					} 
 					openr2_context_set_log_level(dahdi_r2->protocol_context, mfcr2_cur_loglevel);
 					openr2_context_set_ani_first(dahdi_r2->protocol_context, mfcr2_cur_get_ani_first);
+					openr2_context_set_skip_category_request(dahdi_r2->protocol_context, mfcr2_cur_skip_category);
 					openr2_context_set_mf_threshold(dahdi_r2->protocol_context, threshold);
 					openr2_context_set_mf_back_timeout(dahdi_r2->protocol_context, mfcr2_cur_mfback_timeout);
 					openr2_context_set_metering_pulse_timeout(dahdi_r2->protocol_context, mfcr2_cur_metering_pulse_timeout);
@@ -8249,9 +8252,11 @@
 				if (dahdi_r2) {
 					/* TODO: should we check numchans overflow, or is it already done by DAHDI? */
 					dahdi_r2->pvts[dahdi_r2->numchans++] = tmp;
-					tmp->r2chan = openr2_chan_new_from_fd(dahdi_r2->protocol_context, tmp->subs[SUB_REAL].dfd, NULL, NULL);
+					tmp->r2chan = openr2_chan_new_from_fd(dahdi_r2->protocol_context,
+							tmp->subs[SUB_REAL].dfd, NULL, NULL);
 					if (!tmp->r2chan) {
-						ast_log(LOG_ERROR, "Cannot create OpenR2 channel.\n");
+						openr2_liberr_t err = openr2_context_get_last_error(dahdi_r2->protocol_context);
+						ast_log(LOG_ERROR, "Cannot create OpenR2 channel: %s\n", openr2_context_error_string(err));
 						destroy_dahdi_pvt(&tmp);
 						return NULL;
 					}
@@ -11539,6 +11544,7 @@
 				ast_cli(fd, "MFC/R2 Max ANI: %d\n", openr2_context_get_max_ani(r2context));
 				ast_cli(fd, "MFC/R2 Max DNIS: %d\n", openr2_context_get_max_dnis(r2context));
 				ast_cli(fd, "MFC/R2 Get ANI First: %s\n", openr2_context_get_ani_first(r2context) ? "Yes" : "No");
+				ast_cli(fd, "MFC/R2 Skip Category: %s\n", openr2_context_get_skip_category_request(r2context) ? "Yes" : "No");
 				ast_cli(fd, "MFC/R2 Immediate Accept: %s\n", openr2_context_get_immediate_accept(r2context) ? "Yes" : "No");
 				ast_cli(fd, "MFC/R2 Accept On Offer: %s\n", tmp->mfcr2_accept_on_offer ? "Yes" : "No");
 				ast_cli(fd, "MFC/R2 Charge Calls: %s\n", tmp->mfcr2_charge_calls ? "Yes" : "No");
@@ -12781,6 +12787,8 @@
 				}
 			} else if (!strcasecmp(v->name, "mfcr2_get_ani_first")) {
 				mfcr2_cur_get_ani_first = ast_true(v->value);
+			} else if (!strcasecmp(v->name, "mfcr2_skip_category")) {
+				mfcr2_cur_skip_category = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "mfcr2_double_answer")) {
 				mfcr2_cur_double_answer = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "mfcr2_accept_on_offer")) {




More information about the svn-commits mailing list