[asterisk-commits] moy: branch moy/mfcr2 r157241 - in /team/moy/mfcr2: channels/ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 17 09:25:50 CST 2008


Author: moy
Date: Mon Nov 17 09:25:50 2008
New Revision: 157241

URL: http://svn.digium.com/view/asterisk?view=rev&rev=157241
Log:
removed extra white spaces here and there

Modified:
    team/moy/mfcr2/channels/chan_dahdi.c
    team/moy/mfcr2/configs/chan_dahdi.conf.sample

Modified: team/moy/mfcr2/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2/channels/chan_dahdi.c?view=diff&rev=157241&r1=157240&r2=157241
==============================================================================
--- team/moy/mfcr2/channels/chan_dahdi.c (original)
+++ team/moy/mfcr2/channels/chan_dahdi.c Mon Nov 17 09:25:50 2008
@@ -241,7 +241,7 @@
 #define SIG_BRI		(0x2000000 | DAHDI_SIG_CLEAR)
 #define SIG_BRI_PTMP	(0X4000000 | DAHDI_SIG_CLEAR)
 #define SIG_SS7		(0x1000000 | DAHDI_SIG_CLEAR)
-#define SIG_MFCR2   	DAHDI_SIG_CAS
+#define SIG_MFCR2 	DAHDI_SIG_CAS
 #define	SIG_SF		DAHDI_SIG_SF
 #define SIG_SFWINK 	(0x0100000 | DAHDI_SIG_SF)
 #define SIG_SF_FEATD	(0x0200000 | DAHDI_SIG_SF)
@@ -441,7 +441,7 @@
 #ifdef HAVE_OPENR2
 struct dahdi_mfcr2 {
 	pthread_t r2master;		       /*!< Thread of master */
-	openr2_context_t *protocol_context;    /*!< OpenR2 context handle */ 
+	openr2_context_t *protocol_context;    /*!< OpenR2 context handle */
 	struct dahdi_pvt *pvts[MAX_CHANNELS];     /*!< Member channel pvt structs */
 	int numchans;                          /*!< Number of channels in this R2 block */
 	int monitored_count;                   /*!< Number of channels being monitored */
@@ -1215,7 +1215,7 @@
 	const char *catstr = pbx_builtin_getvar_helper(c, "MFCR2_CATEGORY");
 	struct dahdi_pvt *p = c->tech_pvt;
 	if (ast_strlen_zero(catstr)) {
-		ast_log(LOG_DEBUG, "No MFC/R2 category specified for chan %s, using default %s\n", 
+		ast_log(LOG_DEBUG, "No MFC/R2 category specified for chan %s, using default %s\n",
 				c->name, openr2_proto_get_category_string(p->mfcr2_category));
 		return p->mfcr2_category;
 	}
@@ -1285,7 +1285,7 @@
 	if (p->owner) {
 		p->owner->hangupcause = AST_CAUSE_PROTOCOL_ERROR;
 		p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
-	} 
+	}
 	ast_mutex_lock(&p->lock);
 	p->mfcr2call = 0;
 	ast_mutex_unlock(&p->lock);
@@ -1294,8 +1294,8 @@
 static void dahdi_r2_on_call_offered(openr2_chan_t *r2chan, const char *ani, const char *dnis, openr2_calling_party_category_t category)
 {
 	struct dahdi_pvt *p;
-	ast_log(LOG_NOTICE, "MFC/R2 call offered on chan %d. ANI = %s, DNIS = %s, Category = %s\n", 
-			openr2_chan_get_number(r2chan), ani ? ani : "(restricted)", dnis, 
+	ast_log(LOG_NOTICE, "MFC/R2 call offered on chan %d. ANI = %s, DNIS = %s, Category = %s\n",
+			openr2_chan_get_number(r2chan), ani ? ani : "(restricted)", dnis,
 			openr2_proto_get_category_string(category));
 	p = openr2_chan_get_client_data(r2chan);
 	/* if collect calls are not allowed and this is a collect call, reject it! */
@@ -1317,7 +1317,7 @@
 		ast_log(LOG_DEBUG, "Setting exten => s because of immediate or 0 DNIS configured\n");
 		p->exten[0] = 's';
 		p->exten[1] = 0;
-	} 
+	}
 	ast_mutex_unlock(&p->lock);
 	if (!ast_exists_extension(NULL, p->context, p->exten, 1, p->cid_num)) {
 		ast_log(LOG_NOTICE, "MFC/R2 call on channel %d requested non-existent extension '%s' in context '%s'. Rejecting call.\n",
@@ -1329,7 +1329,7 @@
 		} else {
 			openr2_chan_accept_call(r2chan, OR2_CALL_NO_CHARGE);
 		}
-	}	
+	}
 }
 
 static void dahdi_r2_on_call_end(openr2_chan_t *r2chan)
@@ -1384,7 +1384,7 @@
 		p->dialing = 0;
 		/* chan_dahdi will take care of reading from now on, tell the library to forget about it */
 		openr2_chan_disable_read(r2chan);
-	}	
+	}
 }
 
 static void dahdi_r2_on_call_answered(openr2_chan_t *r2chan)
@@ -1417,7 +1417,7 @@
 	case OR2_CAUSE_UNSPECIFIED:
 	default:
 		return AST_CAUSE_NOTDEFINED;
-	}	
+	}
 }
 
 static void dahdi_r2_on_call_disconnect(openr2_chan_t *r2chan, openr2_call_disconnect_cause_t cause)
@@ -1454,7 +1454,7 @@
 			/* being the backward side and not UP yet, we only need to request hangup */
 			/* TODO: what about doing this same thing when were AST_STATE_UP? */
 			ast_queue_hangup_with_cause(p->owner, dahdi_r2_cause_to_ast_cause(cause));
-		}	
+		}
 	} else {
 		ast_mutex_unlock(&p->lock);
 		/* no owner, therefore we can't use dahdi_hangup to disconnect, do it right now */
@@ -1549,7 +1549,7 @@
 	ast_log(LOG_DEBUG, "ast_matchmore_extension(%s, %s, 1, %s) = %d\n", p->context, p->exten, p->cid_num, ret);
 	*/
 	/* if the DNIS is a match and cannot match more, stop requesting DNIS */
-	if ((p->mfcr2_dnis_matched || 
+	if ((p->mfcr2_dnis_matched ||
 	    (ast_exists_extension(NULL, p->context, p->exten, 1, p->cid_num) && (p->mfcr2_dnis_matched = 1))) &&
 	    !ast_matchmore_extension(NULL, p->context, p->exten, 1, p->cid_num)) {
 		return 0;
@@ -3876,9 +3876,9 @@
 				openr2_chan_disconnect_call(p->r2chan, OR2_CAUSE_FORCED_RELEASE);
 			} else {
 				openr2_chan_disconnect_call(p->r2chan, OR2_CAUSE_NORMAL_CLEARING);
-			}	
+			}
 			dahdi_r2_update_monitor_count(p->mfcr2, 1);
-		}	
+		}
 #endif
 #ifdef HAVE_PRI
 		if (p->pri) {
@@ -3933,8 +3933,8 @@
 			}
 		}
 #endif
-		if (p->sig && ((p->sig != SIG_PRI) && (p->sig != SIG_SS7) 
-			&& (p->sig != SIG_BRI) 
+		if (p->sig && ((p->sig != SIG_PRI) && (p->sig != SIG_SS7)
+			&& (p->sig != SIG_BRI)
 			&& (p->sig != SIG_BRI_PTMP))
 			&& (p->sig != SIG_MFCR2))
 			res = dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_ONHOOK);
@@ -6012,7 +6012,7 @@
 #ifdef HAVE_OPENR2
 	if (p->mfcr2) {
 		openr2_chan_process_event(p->r2chan);
-	}	
+	}
 #endif
 
 	if (p->subs[idx].needringing) {
@@ -8997,7 +8997,7 @@
 	r2links = NULL;
 	r2links_count = 0;
 	r2links_index = 0;
-}		
+}
 
 static struct dahdi_mfcr2 *dahdi_r2_get_link(void)
 {
@@ -9229,7 +9229,7 @@
 					ast_log(LOG_WARNING, "Cannot get another R2 DAHDI context!\n");
 					destroy_dahdi_pvt(&tmp);
 					return NULL;
-				} 
+				}
 				if (!r2_link->protocol_context && dahdi_r2_set_context(r2_link, conf)) {
 					ast_log(LOG_ERROR, "Cannot create OpenR2 protocol context.\n");
 					destroy_dahdi_pvt(&tmp);
@@ -9242,7 +9242,7 @@
 				}
 				r2_link->pvts[r2_link->numchans++] = tmp;
 				tmp->r2chan = openr2_chan_new_from_fd(r2_link->protocol_context, 
-						                      tmp->subs[SUB_REAL].dfd, 
+						                      tmp->subs[SUB_REAL].dfd,
 						                      NULL, NULL);
 				if (!tmp->r2chan) {
 					ast_log(LOG_ERROR, "Cannot create OpenR2 channel.\n");
@@ -9252,7 +9252,7 @@
 				tmp->mfcr2 = r2_link;
 				if (conf->mfcr2.call_files) {
 					openr2_chan_enable_call_files(tmp->r2chan);
-				} 
+				}
 				openr2_chan_set_client_data(tmp->r2chan, tmp);
 				/* cast seems to be needed to get rid of the annoying warning regarding format attribute  */
 				openr2_chan_set_logging_func(tmp->r2chan, (openr2_logging_func_t)dahdi_r2_on_chan_log);
@@ -9613,7 +9613,7 @@
 				ast_dsp_set_digitmode(tmp->dsp, DSP_DIGITMODE_DTMF | tmp->dtmfrelax);
 			update_conf(tmp);
 			if (!here) {
-				if ((chan_sig != SIG_BRI) && (chan_sig != SIG_BRI_PTMP) && (chan_sig != SIG_PRI) 
+				if ((chan_sig != SIG_BRI) && (chan_sig != SIG_BRI_PTMP) && (chan_sig != SIG_PRI)
 				    && (chan_sig != SIG_SS7) && (chan_sig != SIG_MFCR2))
 					/* Hang it up to be sure it's good */
 					dahdi_set_hook(tmp->subs[SUB_REAL].dfd, DAHDI_ONHOOK);
@@ -12855,7 +12855,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "mfcr2 show version";
-		e->usage = 
+		e->usage =
 			"Usage: mfcr2 show version\n"
 			"       Shows the version of the OpenR2 library being used.\n";
 		return NULL;
@@ -12864,7 +12864,7 @@
 	}
 	ast_cli(a->fd, "OpenR2 version: %s, revision: %s\n", openr2_get_version(), openr2_get_revision());
 	return CLI_SUCCESS;
-}	
+}
 
 static char *handle_mfcr2_show_variants(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
@@ -12875,7 +12875,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "mfcr2 show variants";
-		e->usage = 
+		e->usage =
 			"Usage: mfcr2 show variants\n"
 			"       Shows the list of MFC/R2 variants supported.\n";
 		return NULL;
@@ -12892,7 +12892,7 @@
 	}
 	return CLI_SUCCESS;
 #undef FORMAT
-}	
+}
 
 static char *handle_mfcr2_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
@@ -12908,7 +12908,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "mfcr2 show channels [group|context]";
-		e->usage = 
+		e->usage =
 			"Usage: mfcr2 show channels [group <group> | context <context>]\n"
 			"       Shows the DAHDI channels configured with MFC/R2 signaling.\n";
 		return NULL;
@@ -12962,9 +12962,9 @@
 		snprintf(channo, sizeof(channo), "%d", p->channel);
 		snprintf(anino, sizeof(anino), "%d", openr2_context_get_max_ani(r2context));
 		snprintf(dnisno, sizeof(dnisno), "%d", openr2_context_get_max_dnis(r2context));
-		ast_cli(a->fd, FORMAT, channo, openr2_proto_get_variant_string(r2variant), 
-				anino, dnisno, openr2_context_get_ani_first(r2context) ? "Yes" : "No",  
-				openr2_context_get_immediate_accept(r2context) ? "Yes" : "No",  
+		ast_cli(a->fd, FORMAT, channo, openr2_proto_get_variant_string(r2variant),
+				anino, dnisno, openr2_context_get_ani_first(r2context) ? "Yes" : "No",
+				openr2_context_get_immediate_accept(r2context) ? "Yes" : "No",
 				openr2_proto_get_tx_state_string(p->r2chan), openr2_proto_get_rx_state_string(p->r2chan));
 		p = p->next;
 	}
@@ -12985,7 +12985,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "mfcr2 set debug";
-		e->usage = 
+		e->usage =
 			"Usage: mfcr2 set debug <loglevel> <channel>\n"
 			"       Set a new logging level for the specified channel.\n"
 			"       If no channel is specified the logging level will be applied to all channels.\n";
@@ -13050,7 +13050,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "mfcr2 call files [on|off]";
-		e->usage = 
+		e->usage =
 			"Usage: mfcr2 call files [on|off] <channel>\n"
 			"       Enable call files creation on the specified channel.\n"
 			"       If no channel is specified call files creation policy will be applied to all channels.\n";
@@ -13097,11 +13097,11 @@
 			ast_cli(a->fd, "MFC/R2 Call files enabled for all channels.\n");
 		} else {
 			ast_cli(a->fd, "MFC/R2 Call files disabled for all channels.\n");
-		}	
+		}
 	}
 	ast_mutex_unlock(&iflock);
 	return CLI_SUCCESS;
-}	
+}
 
 static char *handle_mfcr2_set_idle(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
@@ -13110,7 +13110,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "mfcr2 set idle";
-		e->usage = 
+		e->usage =
 			"Usage: mfcr2 set idle <channel>\n"
 			"       DON'T USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING.\n"
 			"       Force the given channel into IDLE state.\n"
@@ -13155,7 +13155,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "mfcr2 set blocked";
-		e->usage = 
+		e->usage =
 			"Usage: mfcr2 set blocked <channel>\n"
 			"       DON'T USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING.\n"
 			"       Force the given channel into BLOCKED state.\n"

Modified: team/moy/mfcr2/configs/chan_dahdi.conf.sample
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2/configs/chan_dahdi.conf.sample?view=diff&rev=157241&r1=157240&r2=157241
==============================================================================
--- team/moy/mfcr2/configs/chan_dahdi.conf.sample (original)
+++ team/moy/mfcr2/configs/chan_dahdi.conf.sample Mon Nov 17 09:25:50 2008
@@ -1010,7 +1010,7 @@
 
 ; MFC/R2 valid logging values are: all,error,warning,debug,notice,cas,mf,stack,nothing
 ; error,warning,debug and notice are self-descriptive
-; 'cas' is for logging ABCD CAS tx and rx 
+; 'cas' is for logging ABCD CAS tx and rx
 ; 'mf' is for logging of the Multi Frequency tones
 ; 'stack' is for very verbose output of the channel and context call stack, only useful
 ; if you are debugging a crash or want to learn how the library works. The stack logging
@@ -1019,7 +1019,7 @@
 ; multi frequency messages
 ; 'all' is a special value to log all the activity
 ; 'nothing' is a clean-up value, in case you want to not log any activity for
-; a channel or group of channels 
+; a channel or group of channels
 ; BE AWARE that the level of output logged will ALSO depend on
 ; the value you have in logger.conf, if you disable output in logger.conf
 ; then it does not matter you specify 'all' here, nothing will be logged
@@ -1032,20 +1032,20 @@
 ; due to MF timeout try incrementing this value in 500ms steps
 ; mfcr2_mfback_timeout=-1
 
-; MFC/R2 value in milliseconds for the metering pulse timeout. 
+; MFC/R2 value in milliseconds for the metering pulse timeout.
 ; Metering pulses are sent by some telcos for some R2 variants
 ; during a call presumably for billing purposes to indicate costs,
 ; however this pulses use the same signal that is used to indicate
 ; call hangup, therefore a timeout is sometimes required to distinguish
 ; between a *real* hangup and a billing pulse that should not
-; last more than 500ms, If you experience call drops after some 
-; minutes of being stablished try setting a value of some ms here, 
+; last more than 500ms, If you experience call drops after some
+; minutes of being stablished try setting a value of some ms here,
 ; values greater than 500ms are not recommended.
 ; BE AWARE that choosing the proper protocol mfcr2_variant parameter
 ; implicitly sets a good recommended value for this timer, use this
 ; parameter only when you *really* want to override the default, otherwise
 ; just comment out this value or put a -1
-; Any negative value means 'default'. 
+; Any negative value means 'default'.
 ; mfcr2_metering_pulse_timeout=-1
 
 ; Brazil uses a special calling party category for collect calls (llamadas por cobrar)




More information about the asterisk-commits mailing list