[asterisk-commits] rmudgett: branch group/issue8824 r183832 - in /team/group/issue8824: ./ chann...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 23 17:41:08 CDT 2009


Author: rmudgett
Date: Mon Mar 23 17:41:04 2009
New Revision: 183832

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=183832
Log:
Merged revisions 183831 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r183831 | rmudgett | 2009-03-23 17:35:02 -0500 (Mon, 23 Mar 2009) | 1 line
  
  Removed trailing whitespace in chan_misdn files.
........

Modified:
    team/group/issue8824/   (props changed)
    team/group/issue8824/channels/chan_misdn.c
    team/group/issue8824/channels/misdn/Makefile
    team/group/issue8824/channels/misdn/chan_misdn_config.h
    team/group/issue8824/channels/misdn/ie.c
    team/group/issue8824/channels/misdn/isdn_lib.c
    team/group/issue8824/channels/misdn/isdn_msg_parser.c
    team/group/issue8824/channels/misdn/portinfo.c
    team/group/issue8824/channels/misdn_config.c

Propchange: team/group/issue8824/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Mar 23 17:41:04 2009
@@ -1,1 +1,1 @@
-/trunk:1-183783
+/trunk:1-183831

Modified: team/group/issue8824/channels/chan_misdn.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/channels/chan_misdn.c?view=diff&rev=183832&r1=183831&r2=183832
==============================================================================
--- team/group/issue8824/channels/chan_misdn.c (original)
+++ team/group/issue8824/channels/chan_misdn.c Mon Mar 23 17:41:04 2009
@@ -1,6 +1,6 @@
 /*
  * Asterisk -- An open source telephony toolkit.
- * 
+ *
  * Copyright (C) 2004 - 2006, Christian Richter
  *
  * Christian Richter <crich at beronet.com>
@@ -143,13 +143,13 @@
 
 struct hold_info {
 	/*!
-	 * \brief Logical port the channel call record is HOLDED on 
-	 * because the B channel is no longer associated. 
+	 * \brief Logical port the channel call record is HOLDED on
+	 * because the B channel is no longer associated.
 	 */
 	int port;
 
 	/*!
-	 * \brief Original B channel number the HOLDED call was using. 
+	 * \brief Original B channel number the HOLDED call was using.
 	 * \note Used only for debug display messages.
 	 */
 	int channel;
@@ -159,18 +159,18 @@
  * \brief Channel call record structure
  */
 struct chan_list {
-	/*! 
+	/*!
 	 * \brief The "allowed_bearers" string read in from /etc/asterisk/misdn.conf
 	 */
 	char allowed_bearers[BUFFERSIZE + 1];
-	
-	/*! 
+
+	/*!
 	 * \brief State of the channel
 	 */
 	enum misdn_chan_state state;
 
-	/*! 
-	 * \brief TRUE if a hangup needs to be queued 
+	/*!
+	 * \brief TRUE if a hangup needs to be queued
 	 * \note This is a debug flag only used to catch calls to hangup_chan() that are already hungup.
 	 */
 	int need_queue_hangup;
@@ -184,30 +184,30 @@
 	 * \brief TRUE if we could send an AST_CONTROL_BUSY if needed.
 	 */
 	int need_busy;
-	
+
 	/*!
 	 * \brief Who originally created this channel. ORG_AST or ORG_MISDN
 	 */
 	int originator;
 
-	/*! 
+	/*!
 	 * \brief TRUE of we are not to respond immediately to a SETUP message.  Check the dialplan first.
 	 * \note The "noautorespond_on_setup" boolean read in from /etc/asterisk/misdn.conf
 	 */
 	int noautorespond_on_setup;
-	
+
 	int norxtone;	/*!< Boolean assigned values but the value is not used. */
 
 	/*!
 	 * \brief TRUE if we are not to generate tones (Playtones)
 	 */
-	int notxtone; 
+	int notxtone;
 
 	/*!
 	 * \brief TRUE if echo canceller is enabled.  Value is toggled.
 	 */
 	int toggle_ec;
-	
+
 	/*!
 	 * \brief TRUE if you want to send Tone Indications to an incoming
 	 * ISDN channel on a TE Port.
@@ -222,8 +222,8 @@
 	int ignore_dtmf;
 
 	/*!
-	 * \brief Pipe file descriptor handles array. 
-	 * Read from pipe[0], write to pipe[1] 
+	 * \brief Pipe file descriptor handles array.
+	 * Read from pipe[0], write to pipe[1]
 	 */
 	int pipe[2];
 
@@ -282,31 +282,31 @@
 	/*!
 	 * \brief Allocated jitterbuffer controller
 	 * \note misdn_jb_init() creates the jitterbuffer.
-	 * \note Must use misdn_jb_destroy() to clean up. 
+	 * \note Must use misdn_jb_destroy() to clean up.
 	 */
 	struct misdn_jb *jb;
-	
+
 	/*!
 	 * \brief Allocated DSP controller
 	 * \note ast_dsp_new() creates the DSP controller.
-	 * \note Must use ast_dsp_free() to clean up. 
+	 * \note Must use ast_dsp_free() to clean up.
 	 */
 	struct ast_dsp *dsp;
 
 	/*!
 	 * \brief Allocated audio frame sample translator
 	 * \note ast_translator_build_path() creates the translator path.
-	 * \note Must use ast_translator_free_path() to clean up. 
+	 * \note Must use ast_translator_free_path() to clean up.
 	 */
 	struct ast_trans_pvt *trans;
-  
+
 	/*!
 	 * \brief Associated Asterisk channel structure.
 	 */
 	struct ast_channel * ast;
 
 	//int dummy;	/* Not used */
-  
+
 	/*!
 	 * \brief Associated B channel structure.
 	 */
@@ -317,13 +317,13 @@
 	 */
 	struct hold_info hold_info;
 
-	/*! 
-	 * \brief From associated B channel: Layer 3 process ID 
-	 * \note Used to find the HOLDED channel call record when retrieving a call. 
+	/*!
+	 * \brief From associated B channel: Layer 3 process ID
+	 * \note Used to find the HOLDED channel call record when retrieving a call.
 	 */
 	unsigned int l3id;
 
-	/*! 
+	/*!
 	 * \brief From associated B channel: B Channel mISDN driver layer ID from mISDN_get_layerid()
 	 * \note Used only for debug display messages.
 	 */
@@ -359,24 +359,24 @@
 	int nttimeout;
 
 	/*!
-	 * \brief Other channel call record PID 
-	 * \note Value imported from Asterisk environment variable MISDN_PID 
+	 * \brief Other channel call record PID
+	 * \note Value imported from Asterisk environment variable MISDN_PID
 	 */
 	int other_pid;
 
 	/*!
 	 * \brief Bridged other channel call record
-	 * \note Pointer set when other_pid imported from Asterisk environment 
+	 * \note Pointer set when other_pid imported from Asterisk environment
 	 * variable MISDN_PID by either side.
 	 */
 	struct chan_list *other_ch;
 
 	/*!
 	 * \brief Tone zone sound used for dialtone generation.
-	 * \note Used as a boolean.  Non-NULL to prod generation if enabled. 
+	 * \note Used as a boolean.  Non-NULL to prod generation if enabled.
 	 */
 	struct ast_tone_zone_sound *ts;
-	
+
 	/*!
 	 * \brief Enables overlap dialing for the set amount of seconds.  (0 = Disabled)
 	 * \note The "overlapdial" value read in from /etc/asterisk/misdn.conf
@@ -439,7 +439,7 @@
 	robin = NULL;
 }
 
-static struct robin_list* get_robin_position(char *group) 
+static struct robin_list* get_robin_position(char *group)
 {
 	struct robin_list *new;
 	struct robin_list *iter = robin;
@@ -547,26 +547,26 @@
 static struct chan_list * get_chan_by_ast(struct ast_channel *ast)
 {
 	struct chan_list *tmp;
-  
+
 	for (tmp = cl_te; tmp; tmp = tmp->next) {
 		if (tmp->ast == ast) {
 			return tmp;
 		}
 	}
-  
+
 	return NULL;
 }
 
 static struct chan_list * get_chan_by_ast_name(char *name)
 {
 	struct chan_list *tmp;
-  
+
 	for (tmp = cl_te; tmp; tmp = tmp->next) {
 		if (tmp->ast && strcmp(tmp->ast->name, name) == 0) {
 			return tmp;
 		}
 	}
-  
+
 	return NULL;
 }
 
@@ -874,7 +874,7 @@
 	case 2:
 		str = "Unavailable";
 		break;
-	
+
 	default:
 		str = "Unknown";
 		break;
@@ -975,7 +975,7 @@
 	case 2:
 		str = "Failed Screen";
 		break;
-	
+
 	case 3:
 		str = "Network Number";
 		break;
@@ -1242,10 +1242,10 @@
 	}
 }
 
-static void print_bearer(struct misdn_bchannel *bc) 
+static void print_bearer(struct misdn_bchannel *bc)
 {
 	chan_misdn_log(2, bc->port, " --> Bearer: %s\n", bearer2str(bc->capability));
-	
+
 	switch(bc->law) {
 	case INFO_CODEC_ALAW:
 		chan_misdn_log(2, bc->port, " --> Codec: Alaw\n");
@@ -1410,7 +1410,7 @@
 	default:
 		break;
 	}
-	
+
 	bc->AOCD_need_export = 0;
 }
 
@@ -1430,7 +1430,7 @@
 	sigemptyset(&sa.sa_mask);
 	sigaddset(&sa.sa_mask, SIGUSR1);
 	sigaction(SIGUSR1, &sa, NULL);
-	
+
 	sem_post((sem_t *)data);
 
 	while (1) {
@@ -1457,7 +1457,7 @@
 	}
 
 	chan_misdn_log(4, 0, "Starting misdn_tasks thread\n");
-	
+
 	misdn_tasks = sched_context_create();
 	pthread_create(&misdn_tasks_thread, NULL, misdn_tasks_thread_func, &blocker);
 
@@ -1592,8 +1592,8 @@
 		"!941+1209/100,!0/100",	/* * */
 		"!941+1477/100,!0/100", /* # */
 	};
-	struct ast_channel *chan = cl->ast; 
-  
+	struct ast_channel *chan = cl->ast;
+
 	if (digit >= '0' && digit <='9') {
 		ast_playtones_start(chan, 0, dtmf_tones[digit - '0'], 0);
 	} else if (digit >= 'A' && digit <= 'D') {
@@ -1651,7 +1651,7 @@
 					only = 1;
 				}
 			}
-	
+
 			for (i = 0; i <= max_ports; i++) {
 				misdn_debug[i] = level;
 				misdn_debug_only[i] = only;
@@ -1943,18 +1943,18 @@
 			for (elem = MISDN_CFG_FIRST + 1, linebreak = 1; elem < MISDN_CFG_LAST; elem++, linebreak++) {
 				misdn_cfg_get_config_string(port, elem, buffer, sizeof(buffer));
 				ast_cli(a->fd, "%-36s%s", buffer, !(linebreak % 2) ? "\n" : "");
-			}	
+			}
 			ast_cli(a->fd, "\n");
 		}
 	}
-	
+
 	if (onlyport > 0) {
 		if (misdn_cfg_is_port_valid(onlyport)) {
 			ast_cli(a->fd, "[PORT %d]\n", onlyport);
 			for (elem = MISDN_CFG_FIRST + 1, linebreak = 1; elem < MISDN_CFG_LAST; elem++, linebreak++) {
 				misdn_cfg_get_config_string(onlyport, elem, buffer, sizeof(buffer));
 				ast_cli(a->fd, "%-36s%s", buffer, !(linebreak % 2) ? "\n" : "");
-			}	
+			}
 			ast_cli(a->fd, "\n");
 		} else {
 			ast_cli(a->fd, "Port %d is not active!\n", onlyport);
@@ -1995,15 +1995,15 @@
 /* *INDENT-ON* */
 };
 
-static const char *misdn_get_ch_state(struct chan_list *p) 
+static const char *misdn_get_ch_state(struct chan_list *p)
 {
 	int i;
 	static char state[8];
-	
+
 	if (!p) {
 		return NULL;
 	}
-  
+
 	for (i = 0; i < ARRAY_LEN(state_array); i++) {
 		if (state_array[i].state == p->state) {
 			return state_array[i].txt;
@@ -2024,7 +2024,7 @@
 		ast_log(LOG_WARNING, "chan_misdn is not initialized properly, still reloading ?\n");
 		return ;
 	}
-	
+
 	free_robin_list();
 	misdn_cfg_reload();
 	misdn_cfg_update_ptp();
@@ -2138,11 +2138,11 @@
 	}
 
 	help = cl_te;
-  
+
 	ast_cli(a->fd, "Channel List: %p\n", cl_te);
 
 	for (; help; help = help->next) {
-		struct misdn_bchannel *bc = help->bc;   
+		struct misdn_bchannel *bc = help->bc;
 		struct ast_channel *ast = help->ast;
 		if (!ast) {
 			if (!bc) {
@@ -2206,13 +2206,13 @@
 	help = cl_te;
 
 	for (; help; help = help->next) {
-		struct misdn_bchannel *bc = help->bc;   
+		struct misdn_bchannel *bc = help->bc;
 		struct ast_channel *ast = help->ast;
-    
+
 		if (bc && ast) {
 			if (!strcasecmp(ast->name, a->argv[3])) {
 				print_bc_info(a->fd, help, bc);
-				break; 
+				break;
 			}
 		}
 	}
@@ -2322,7 +2322,7 @@
 	}
 
 	port = atoi(a->argv[3]);
-  
+
 	ast_cli(a->fd, "BEGIN STACK_LIST:\n");
 	get_show_stack_details(port, buf);
 	ast_cli(a->fd, "  %s  Debug:%d%s\n", buf, misdn_debug[port], misdn_debug_only[port] ? "(only)" : "");
@@ -2332,13 +2332,13 @@
 
 static char *handle_cli_misdn_send_facility(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
-	char *channame; 
+	char *channame;
 	char *nr;
 	struct chan_list *tmp;
-	int port; 
+	int port;
 	char *served_nr;
 	struct misdn_bchannel dummy, *bc=&dummy;
- 
+
  	switch (cmd) {
 	case CLI_INIT:
 		e->command = "misdn send facility";
@@ -2356,7 +2356,7 @@
 	if (a->argc < 5) {
 		return CLI_SHOWUSAGE;
 	}
- 
+
 	if (strstr(a->argv[3], "calldeflect")) {
 		if (a->argc < 6) {
 			ast_verbose("calldeflect requires 1 arg: ToNumber\n\n");
@@ -2369,12 +2369,12 @@
 		tmp = get_chan_by_ast_name(channame);
 		if (!tmp) {
 			ast_verbose("Sending CD with nr %s to %s failed: Channel does not exist.\n", nr, channame);
-			return 0; 
+			return 0;
 		}
 
 		if (strlen(nr) >= 15) {
 			ast_verbose("Sending CD with nr %s to %s failed: Number too long (up to 15 digits are allowed).\n", nr, channame);
-			return 0; 
+			return 0;
 		}
 		tmp->bc->fac_out.Function = Fac_CD;
 		ast_copy_string((char *) tmp->bc->fac_out.u.CDeflection.DeflectedToNumber, nr, sizeof(tmp->bc->fac_out.u.CDeflection.DeflectedToNumber));
@@ -2407,7 +2407,7 @@
 		}
 		port = atoi(a->argv[4]);
 		served_nr = a->argv[5];
-		
+
 		misdn_make_dummy(bc, port, 0, misdn_lib_port_is_nt(port), 0);
 		ast_verbose("Sending CFDeactivate  Port:(%d) FromNr. (%s)\n", port, served_nr);
 
@@ -2456,8 +2456,8 @@
 
 static char *handle_cli_misdn_send_digit(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
-	char *channame; 
-	char *msg; 
+	char *channame;
+	char *msg;
 	struct chan_list *tmp;
 	int i, msglen;
 
@@ -2486,7 +2486,7 @@
 	tmp = get_chan_by_ast_name(channame);
 	if (!tmp) {
 		ast_cli(a->fd, "Sending %s to %s failed Channel does not exist\n", msg, channame);
-		return CLI_SUCCESS; 
+		return CLI_SUCCESS;
 	}
 #if 1
 	for (i = 0; i < msglen; i++) {
@@ -2524,9 +2524,9 @@
 	}
 
 	channame = a->argv[3];
-  
+
 	ast_cli(a->fd, "Toggling EchoCancel on %s\n", channame);
-  
+
 	tmp = get_chan_by_ast_name(channame);
 	if (!tmp) {
 		ast_cli(a->fd, "Toggling EchoCancel %s failed Channel does not exist\n", channame);
@@ -2576,7 +2576,7 @@
 
 	ast_cli(a->fd, "Sending %s to %s\n", msg, channame);
 	tmp = get_chan_by_ast_name(channame);
-    
+
 	if (tmp && tmp->bc) {
 		ast_copy_string(tmp->bc->display, msg, sizeof(tmp->bc->display));
 		misdn_lib_send_event(tmp->bc, EVENT_INFORMATION);
@@ -2733,13 +2733,13 @@
 	misdn_cfg_get(port, MISDN_CFG_PRES, &pres, sizeof(pres));
 	misdn_cfg_get(port, MISDN_CFG_SCREEN, &screen, sizeof(screen));
 	chan_misdn_log(2, port, " --> pres: %d screen: %d\n", pres, screen);
-		
+
 	if (pres < 0 || screen < 0) {
 		chan_misdn_log(2, port, " --> pres: %x\n", ast->connected.id.number_presentation);
-			
+
 		bc->caller.presentation = ast_to_misdn_pres(ast->connected.id.number_presentation);
 		chan_misdn_log(2, port, " --> PRES: %s(%d)\n", misdn_to_str_pres(bc->caller.presentation), bc->caller.presentation);
-			
+
 		bc->caller.screening = ast_to_misdn_screen(ast->connected.id.number_presentation);
 		chan_misdn_log(2, port, " --> SCREEN: %s(%d)\n", misdn_to_str_screen(bc->caller.screening), bc->caller.screening);
 	} else {
@@ -2753,9 +2753,9 @@
 {
 	struct misdn_bchannel *bc = ch->bc;
 	int len = ch->jb_len, threshold = ch->jb_upper_threshold;
-	
+
 	chan_misdn_log(5, bc->port, "config_jb: Called\n");
-	
+
 	if (! len) {
 		chan_misdn_log(1, bc->port, "config_jb: Deactivating Jitterbuffer\n");
 		bc->nojitter=1;
@@ -2877,7 +2877,7 @@
 		ast_log(LOG_WARNING, "Cannot configure without ast || bc\n");
 		return -1;
 	}
-	
+
 	port = bc->port;
 	chan_misdn_log(1, port, "read_config: Getting Config\n");
 
@@ -2892,7 +2892,7 @@
 	misdn_cfg_get(port, MISDN_CFG_INCOMING_EARLY_AUDIO, &ch->incoming_early_audio, sizeof(ch->incoming_early_audio));
 
 	misdn_cfg_get(port, MISDN_CFG_SENDDTMF, &bc->send_dtmf, sizeof(bc->send_dtmf));
-	
+
 	misdn_cfg_get(port, MISDN_CFG_ASTDTMF, &ch->ast_dsp, sizeof(int));
 	if (ch->ast_dsp) {
 		ch->ignore_dtmf = 1;
@@ -2918,7 +2918,7 @@
 			bc->hdlc = 1;
 			break;
 		}
-		
+
 	}
 	/*Initialize new Jitterbuffer*/
 	misdn_cfg_get(port, MISDN_CFG_JITTERBUFFER, &ch->jb_len, sizeof(ch->jb_len));
@@ -2946,7 +2946,7 @@
 	chan_misdn_log(5, port, " --> * CallGrp:%s PickupGrp:%s\n", ast_print_group(buf, sizeof(buf), cg), ast_print_group(buf2, sizeof(buf2), pg));
 	ast->pickupgroup = pg;
 	ast->callgroup = cg;
-	
+
 	if (ch->originator == ORG_AST) {
 		char callerid[BUFFERSIZE + 1];
 
@@ -3000,13 +3000,13 @@
 		misdn_add_number_prefix(bc->port, bc->dialed.number_type, bc->dialed.number, sizeof(bc->dialed.number));
 
 		ast_copy_string(ast->exten, bc->dialed.number, sizeof(ast->exten));
-	
+
 		misdn_cfg_get(bc->port, MISDN_CFG_OVERLAP_DIAL, &ch->overlap_dial, sizeof(ch->overlap_dial));
 		ast_mutex_init(&ch->overlap_tv_lock);
 	} /* ORIG MISDN END */
 
 	ch->overlap_dial_task = -1;
-	
+
 	if (ch->faxdetect  || ch->ast_dsp) {
 		misdn_cfg_get(port, MISDN_CFG_FAXDETECT_TIMEOUT, &ch->faxdetect_timeout, sizeof(ch->faxdetect_timeout));
 		if (!ch->dsp) {
@@ -3148,7 +3148,7 @@
 		ast_setstate(ast, AST_STATE_DOWN);
 		return -1;
 	}
-	
+
 	newbc = ch->bc;
 	if (!newbc) {
 		ast_log(LOG_WARNING, " --> ! misdn_call called on %s, newbc==NULL\n", ast->name);
@@ -3170,7 +3170,7 @@
 	if (!args.ext) {
 		args.ext = "";
 	}
-	
+
 	port = newbc->port;
 
 	exceed = add_out_calls(port);
@@ -3182,11 +3182,11 @@
 		ast_setstate(ast, AST_STATE_DOWN);
 		return -1;
 	}
-	
+
 	chan_misdn_log(1, port, "* CALL: %s\n", dest);
-	
+
 	chan_misdn_log(2, port, " --> * dialed:%s tech:%s context:%s\n", args.ext, ast->name, ast->context);
-	
+
 	ast_copy_string(ast->exten, args.ext, sizeof(ast->exten));
 	ast_copy_string(newbc->dialed.number, args.ext, sizeof(newbc->dialed.number));
 
@@ -3216,7 +3216,7 @@
 		chan_misdn_log(2, port, " --> * Call with flag Digital\n");
 	}
 
-	/* update caller screening and presentation */ 
+	/* update caller screening and presentation */
 	update_config(ch);
 
 	/* fill in some ies from channel dialplan variables */
@@ -3271,8 +3271,8 @@
 	}
 
 	ch->state = MISDN_CALLING;
-	
-	return 0; 
+
+	return 0;
 }
 
 
@@ -3286,7 +3286,7 @@
 	}
 
 	chan_misdn_log(1, p ? (p->bc ? p->bc->port : 0) : 0, "* ANSWER:\n");
-	
+
 	if (!p) {
 		ast_log(LOG_WARNING, " --> Channel not connected ??\n");
 		ast_queue_hangup_with_cause(ast, AST_CAUSE_NETWORK_OUT_OF_ORDER);
@@ -3358,12 +3358,12 @@
 
 	bc = p->bc;
 	chan_misdn_log(1, bc ? bc->port : 0, "* IND : Digit %c\n", digit);
-	
+
 	if (!bc) {
 		ast_log(LOG_WARNING, " --> !! Got Digit Event without having bchannel Object\n");
 		return -1;
 	}
-	
+
 	switch (p->state ) {
 	case MISDN_CALLING:
 		if (strlen(bc->infos_pending) < sizeof(bc->infos_pending) - 1) {
@@ -3420,15 +3420,15 @@
 		ast_log(LOG_WARNING, "Returned -1 in misdn_indication\n");
 		return -1;
 	}
-	
+
 	if (!p->bc ) {
 		chan_misdn_log(1, 0, "* IND : Indication from %s\n", ast->exten);
 		ast_log(LOG_WARNING, "Private Pointer but no bc ?\n");
 		return -1;
 	}
-	
+
 	chan_misdn_log(5, p->bc->port, "* IND : Indication [%d] from %s\n", cond, ast->exten);
-	
+
 	switch (cond) {
 	case AST_CONTROL_BUSY:
 		chan_misdn_log(1, p->bc->port, "* IND :\tbusy pid:%d\n", p->bc->pid);
@@ -3523,7 +3523,7 @@
 		}
 		break;
 	case AST_CONTROL_HOLD:
-		ast_moh_start(ast, data, p->mohinterpret); 
+		ast_moh_start(ast, data, p->mohinterpret);
 		chan_misdn_log(1, p->bc->port, " --> *\tHOLD pid:%d\n", p->bc->pid);
 		break;
 	case AST_CONTROL_UNHOLD:
@@ -3542,7 +3542,7 @@
 		chan_misdn_log(1, p->bc->port, " --> * Unknown Indication:%d pid:%d\n", cond, p->bc->pid);
 		break;
 	}
-  
+
 	return 0;
 }
 
@@ -3581,16 +3581,16 @@
 	MISDN_ASTERISK_TECH_PVT(ast) = NULL;
 	p->ast = NULL;
 
-	if (ast->_state == AST_STATE_RESERVED || 
-		p->state == MISDN_NOTHING || 
-		p->state == MISDN_HOLDED || 
+	if (ast->_state == AST_STATE_RESERVED ||
+		p->state == MISDN_NOTHING ||
+		p->state == MISDN_HOLDED ||
 		p->state == MISDN_HOLD_DISCONNECT ) {
 
 		CLEAN_CH:
 		/* between request and call */
 		ast_debug(1, "State Reserved (or nothing) => chanIsAvail\n");
 		MISDN_ASTERISK_TECH_PVT(ast) = NULL;
-	
+
 		ast_mutex_lock(&release_lock);
 		cl_dequeue_chan(&cl_te, p);
 		close(p->pipe[0]);
@@ -3646,7 +3646,7 @@
 	case MISDN_INCOMING_SETUP:
 	case MISDN_CALLING:
 		p->state = MISDN_CLEANING;
-		/* This is the only place in misdn_hangup, where we 
+		/* This is the only place in misdn_hangup, where we
 		 * can call release_chan, else it might create lot's of trouble
 		 * */
 		ast_log(LOG_NOTICE, "release channel, in CALLING/INCOMING_SETUP state.. no other events happened\n");
@@ -3730,7 +3730,7 @@
 			if (bc->need_release) {
 				misdn_lib_send_event(bc, EVENT_RELEASE);
 			}
-			p->state = MISDN_CLEANING; 
+			p->state = MISDN_CLEANING;
 		} else {
 			if (bc->need_disconnect) {
 				misdn_lib_send_event(bc, EVENT_DISCONNECT);
@@ -3749,7 +3749,7 @@
 static struct ast_frame *process_ast_dsp(struct chan_list *tmp, struct ast_frame *frame)
 {
 	struct ast_frame *f,*f2;
- 
+
  	if (tmp->trans) {
  		f2 = ast_translate(tmp->trans, frame, 0);
  		f = ast_dsp_process(tmp->ast, tmp->dsp, f2);
@@ -3760,9 +3760,9 @@
 
  	if (!f || (f->frametype != AST_FRAME_DTMF))
  		return frame;
- 
+
 	ast_debug(1, "Detected inband DTMF digit: %c\n", f->subclass);
- 
+
  	if (tmp->faxdetect && (f->subclass == 'f')) {
  		/* Fax tone -- Handle and return NULL */
  		if (!tmp->faxhandled) {
@@ -3809,7 +3809,7 @@
 			ast_debug(1, "Fax already handled\n");
 		}
   	}
- 	
+
  	if (tmp->ast_dsp && (f->subclass != 'f')) {
  		chan_misdn_log(2, tmp->bc->port, " --> * SEND: DTMF (AST_DSP) :%c\n", f->subclass);
  	}
@@ -3912,7 +3912,7 @@
 {
 	struct chan_list *ch;
 	int i  = 0;
-	
+
 	if (!ast || !(ch = MISDN_ASTERISK_TECH_PVT(ast))) {
 		return -1;
 	}
@@ -3921,12 +3921,12 @@
 		chan_misdn_log(7, 0, "misdn_write: Returning because holded\n");
 		return 0;
 	}
-	
+
 	if (!ch->bc ) {
 		ast_log(LOG_WARNING, "private but no bc\n");
 		return -1;
 	}
-	
+
 	if (ch->notxtone) {
 		chan_misdn_log(7, ch->bc->port, "misdn_write: Returning because notxtone\n");
 		return 0;
@@ -3937,16 +3937,16 @@
 		chan_misdn_log(4, ch->bc->port, "misdn_write: * prods us\n");
 		return 0;
 	}
-	
+
 	if (!(frame->subclass & prefformat)) {
 		chan_misdn_log(-1, ch->bc->port, "Got Unsupported Frame with Format:%d\n", frame->subclass);
 		return 0;
 	}
-	
+
 
 	if (!frame->samples ) {
 		chan_misdn_log(4, ch->bc->port, "misdn_write: zero write\n");
-		
+
 		if (!strcmp(frame->src,"ast_prod")) {
 			chan_misdn_log(1, ch->bc->port, "misdn_write: state (%s) prodded.\n", misdn_get_ch_state(ch));
 
@@ -3964,7 +3964,7 @@
 		chan_misdn_log(8, ch->bc->port, "misdn_write: no addr for bc dropping:%d\n", frame->samples);
 		return 0;
 	}
-	
+
 #ifdef MISDN_DEBUG
 	{
 		int i, max = 5 > frame->samples ? frame->samples : 5;
@@ -3985,7 +3985,7 @@
 		if (!ch->dropped_frame_cnt) {
 			chan_misdn_log(5, ch->bc->port, "BC not active (nor bridged) dropping: %d frames addr:%x exten:%s cid:%s ch->state:%s bc_state:%d l3id:%x\n", frame->samples, ch->bc->addr, ast->exten, ast->cid.cid_num, misdn_get_ch_state( ch), ch->bc->bc_state, ch->bc->l3_id);
 		}
-		
+
 		if (++ch->dropped_frame_cnt > 100) {
 			ch->dropped_frame_cnt = 0;
 			chan_misdn_log(5, ch->bc->port, "BC not active (nor bridged) dropping: %d frames addr:%x  dropped > 100 frames!\n", frame->samples, ch->bc->addr);
@@ -4002,7 +4002,7 @@
 				cb_log(0, ch->bc->port, "Misdn Jitterbuffer Overflow.\n");
 			}
 		}
-		
+
 	} else {
 		/*transmit without jitterbuffer*/
 		i = misdn_lib_tx2misdn_frm(ch->bc, frame->data.ptr, frame->samples);
@@ -4026,13 +4026,13 @@
 	struct ast_frame *f;
 	int p1_b, p2_b;
 	int bridging;
-  
+
 	ch1 = get_chan_by_ast(c0);
 	ch2 = get_chan_by_ast(c1);
 
 	carr[0] = c0;
 	carr[1] = c1;
-  
+
 	if (!(ch1 && ch2)) {
 		return -1;
 	}
@@ -4059,7 +4059,7 @@
 		ch1->bc->caller.number,
 		ch2->bc->caller.name,
 		ch2->bc->caller.number);
- 
+
 	if (! (flags & AST_BRIDGE_DTMF_CHANNEL_0) ) {
 		ch1->ignore_dtmf = 1;
 	}
@@ -4081,7 +4081,7 @@
 		if (!f || f->frametype == AST_FRAME_CONTROL) {
 			/* got hangup .. */
 
-			if (!f) 
+			if (!f)
 				chan_misdn_log(4, ch1->bc->port, "Read Null Frame\n");
 			else
 				chan_misdn_log(4, ch1->bc->port, "Read Frame Control class:%d\n", f->subclass);
@@ -4090,7 +4090,7 @@
 			*rc = who;
 			break;
 		}
-		
+
 		if ( f->frametype == AST_FRAME_DTMF ) {
 			chan_misdn_log(1, 0, "Read DTMF %d from %s\n", f->subclass, who->exten);
 
@@ -4098,11 +4098,11 @@
 			*rc = who;
 			break;
 		}
-	
+
 #if 0
 		if (f->frametype == AST_FRAME_VOICE) {
 			chan_misdn_log(1, ch1->bc->port, "I SEND: Splitting conference with Number:%d\n", ch1->bc->pid +1);
-	
+
 			continue;
 		}
 #endif
@@ -4135,11 +4135,11 @@
 		chan_misdn_log(1, cl->bc->port, "Not sending Dialtone, because config wants it\n");
 		return 0;
 	}
-	
+
 	chan_misdn_log(3, cl->bc->port, " --> Dial\n");
 
 	cl->ts = ast_get_indication_tone(ast->zone, "dial");
-	
+
 	if (cl->ts) {
 		cl->notxtone = 0;
 		cl->norxtone = 0;
@@ -4193,7 +4193,7 @@
 
 	cl->notxtone = 1;
 	cl->norxtone = 1;
-	
+
 	return 0;
 }
 
@@ -4207,7 +4207,7 @@
 		chan_misdn_log(-1, 0, "misdn_request: malloc failed!");
 		return NULL;
 	}
-	
+
 	cl->originator = orig;
 	cl->need_queue_hangup = 1;
 	cl->need_hangup = 1;
@@ -4305,7 +4305,7 @@
 					if (port >= port_start) {
 						next_chan = 1;
 					}
-					
+
 					if (port <= port_start && next_chan) {
 						int maxbchans=misdn_lib_get_maxchans(port);
 						if (++robin_channel >= maxbchans) {
@@ -4325,7 +4325,7 @@
 						if (check && !port_up) {
 							chan_misdn_log(1, port, "L1 is not Up on this Port\n");
 						}
-						
+
 						if (check && port_up < 0) {
 							ast_log(LOG_WARNING, "This port (%d) is blocked\n", port);
 						}
@@ -4345,7 +4345,7 @@
 					}
 				}
 			} while (!newbc && robin_channel != rr->channel);
-		} else {		
+		} else {
 			for (port = misdn_cfg_get_next_port(0); port > 0;
 				 port = misdn_cfg_get_next_port(port)) {
 
@@ -4369,10 +4369,10 @@
 				}
 			}
 		}
-		
+
 		/* Group dial failed ?*/
 		if (!newbc) {
-			ast_log(LOG_WARNING, 
+			ast_log(LOG_WARNING,
 					"Could not Dial out on group '%s'.\n"
 					"\tEither the L2 and L1 on all of these ports where DOWN (see 'show application misdn_check_l2l1')\n"
 					"\tOr there was no free channel on none of the ports\n\n"
@@ -4390,7 +4390,7 @@
 			return NULL;
 		}
 	}
-	
+
 
 	/* create ast_channel and link all the objects together */
 	cl = init_chan_list(ORG_AST);
@@ -4399,7 +4399,7 @@
 		return NULL;
 	}
 	cl->bc = newbc;
-	
+
 	tmp = misdn_new(cl, AST_STATE_RESERVED, args.ext, NULL, format, port, channel);
 	if (!tmp) {
 		ast_log(LOG_ERROR, "Could not create Asterisk object\n");
@@ -4407,16 +4407,16 @@
 	}
 
 	cl->ast = tmp;
-	
+
 	/* register chan in local list */
 	cl_queue_chan(&cl_te, cl);
-	
+
 	/* fill in the config into the objects */
 	read_config(cl);
 
 	/* important */
 	cl->need_hangup = 0;
-	
+
 	return tmp;
 }
 
@@ -4424,7 +4424,7 @@
 static int misdn_send_text(struct ast_channel *chan, const char *text)
 {
 	struct chan_list *tmp = chan->tech_pvt;
-	
+
 	if (tmp && tmp->bc) {
 		ast_copy_string(tmp->bc->display, text, sizeof(tmp->bc->display));
 		misdn_lib_send_event(tmp->bc, EVENT_INFORMATION);
@@ -4432,7 +4432,7 @@
 		ast_log(LOG_WARNING, "No chan_list but send_text request?\n");
 		return -1;
 	}
-	
+
 	return 0;
 }
 
@@ -4444,7 +4444,7 @@
 	.send_digit_begin = misdn_digit_begin,
 	.send_digit_end = misdn_digit_end,
 	.call = misdn_call,
-	.bridge = misdn_bridge, 
+	.bridge = misdn_bridge,
 	.hangup = misdn_hangup,
 	.answer = misdn_answer,
 	.read = misdn_read,
@@ -4476,7 +4476,7 @@
 
 static int glob_channel = 0;
 
-static void update_name(struct ast_channel *tmp, int port, int c) 
+static void update_name(struct ast_channel *tmp, int port, int c)
 {
 	int chan_offset = 0;
 	int tmp_port = misdn_cfg_get_next_port(0);
@@ -4485,7 +4485,7 @@
 		if (tmp_port == port) {
 			break;
 		}
-		chan_offset += misdn_lib_port_is_pri(tmp_port) ? 30 : 2;	
+		chan_offset += misdn_lib_port_is_pri(tmp_port) ? 30 : 2;
 	}
 	if (c < 0) {
 		c = 0;
@@ -4531,7 +4531,7 @@
 		tmp->rawreadformat = format;
 		tmp->writeformat = format;
 		tmp->rawwriteformat = format;
-    
+
 		tmp->tech_pvt = chlist;
 
 		misdn_cfg_get(0, MISDN_GEN_BRIDGING, &bridging, sizeof(bridging));
@@ -4565,7 +4565,7 @@
 	} else {
 		chan_misdn_log(-1, 0, "Unable to allocate channel structure\n");
 	}
-	
+
 	return tmp;
 }
 
@@ -4616,7 +4616,7 @@
 		bc->caller.number);
 	for (; help; help = help->next) {
 		chan_misdn_log(4, bc->port, "$$$ find_holded: --> holded:%d channel:%d\n", help->state == MISDN_HOLDED, help->hold_info.channel);
-		if ((help->state == MISDN_HOLDED) && 
+		if ((help->state == MISDN_HOLDED) &&
 			(help->hold_info.port == bc->port)) {
 			return help;
 		}
@@ -4631,7 +4631,7 @@
 }
 
 
-static struct chan_list *find_holded_l3(struct chan_list *list, unsigned long l3_id, int w) 
+static struct chan_list *find_holded_l3(struct chan_list *list, unsigned long l3_id, int w)
 {
 	struct chan_list *help = list;
 
@@ -4648,20 +4648,20 @@
 static void cl_queue_chan(struct chan_list **list, struct chan_list *chan)
 {
 	chan_misdn_log(4, chan->bc ? chan->bc->port : 0, "* Queuing chan %p\n", chan);
-  
+
 	ast_mutex_lock(&cl_te_lock);
 	if (!*list) {
 		*list = chan;
 	} else {
 		struct chan_list *help = *list;
-		for (; help->next; help = help->next); 
+		for (; help->next; help = help->next);
 		help->next = chan;
 	}
 	chan->next = NULL;
 	ast_mutex_unlock(&cl_te_lock);
 }
 
-static void cl_dequeue_chan(struct chan_list **list, struct chan_list *chan) 
+static void cl_dequeue_chan(struct chan_list **list, struct chan_list *chan)
 {
 	struct chan_list *help;
 
@@ -4677,13 +4677,13 @@
 		ast_mutex_unlock(&cl_te_lock);
 		return;
 	}
-  
+
 	if (*list == chan) {
 		*list = (*list)->next;
 		ast_mutex_unlock(&cl_te_lock);
 		return;
 	}
-  
+
 	for (help = *list; help->next; help = help->next) {
 		if (help->next == chan) {
 			help->next = help->next->next;
@@ -4691,7 +4691,7 @@
 			return;
 		}
 	}
-	
+
 	ast_mutex_unlock(&cl_te_lock);
 }
 
@@ -4700,7 +4700,7 @@
 
 static int pbx_start_chan(struct chan_list *ch)
 {
-	int ret = ast_pbx_start(ch->ast);	
+	int ret = ast_pbx_start(ch->ast);
 
 	ch->need_hangup = (ret >= 0) ? 0 : 1;
 
@@ -4761,7 +4761,7 @@
 
 	if (ch->ast) {
 		ast = ch->ast;
-	} 
+	}
 
 	chan_misdn_log(5, bc->port, "release_chan: bc with l3id: %x\n", bc->l3_id);
 
@@ -4847,7 +4847,7 @@
 
 	if (!ch->noautorespond_on_setup) {
 		if (bc->nt) {
-			int ret; 
+			int ret;
 			ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
 		} else {
 			int ret;
@@ -4867,9 +4867,9 @@
 		ast->exten,
 		ast->cid.cid_name ? ast->cid.cid_name : "",
 		ast->cid.cid_num ? ast->cid.cid_num : "");
-  
+
 	strcpy(ast->exten, "s");
-  
+
 	if (pbx_start_chan(ch) < 0) {
 		ast = NULL;
 		hangup_chan(ch);
@@ -4877,8 +4877,8 @@
 
 		misdn_lib_send_event(bc, bc->nt ? EVENT_RELEASE_COMPLETE : EVENT_DISCONNECT);
 	}
-  
-  
+
+
 	while (!ast_strlen_zero(predial) ) {
 		fr.frametype = AST_FRAME_DTMF;
 		fr.subclass = *predial;
@@ -4930,7 +4930,7 @@
 		 *
 		chan_misdn_log(1, bc ? bc->port : 0, " --> * SEND: Queue Congestion pid:%d\n", bc ? bc->pid : -1);
 		ch->state = MISDN_BUSY;
-		
+
 		ast_queue_control(ast, AST_CONTROL_CONGESTION);
 		*/
 		break;
@@ -4945,11 +4945,11 @@
 		}
 
 		chan_misdn_log(1, bc ? bc->port : 0, " --> * SEND: Queue Busy pid:%d\n", bc ? bc->pid : -1);
-		
+
 		ast_queue_control(ast, AST_CONTROL_BUSY);
-		
+
 		ch->need_busy = 0;
-		
+
 		break;
 	}
 }
@@ -5023,7 +5023,7 @@
 int add_in_calls(int port)
 {
 	int max_in_calls;
-	
+
 	misdn_cfg_get(port, MISDN_CFG_MAX_IN, &max_in_calls, sizeof(max_in_calls));
 	misdn_in_calls[port]++;
 
@@ -5031,14 +5031,14 @@
 		ast_log(LOG_NOTICE, "Marking Incoming Call on port[%d]\n", port);
 		return misdn_in_calls[port] - max_in_calls;
 	}
-	
+
 	return 0;
 }
 
 int add_out_calls(int port)
 {
 	int max_out_calls;
-	
+
 	misdn_cfg_get(port, MISDN_CFG_MAX_OUT, &max_out_calls, sizeof(max_out_calls));
 
 	if (max_out_calls >= 0 && max_out_calls <= misdn_out_calls[port]) {
@@ -5047,7 +5047,7 @@
 	}
 
 	misdn_out_calls[port]++;
-	
+
 	return 0;
 }
 
@@ -5082,7 +5082,7 @@
 cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
 {
 	struct chan_list *ch = find_chan_by_bc(cl_te, bc);
-	
+
 	if (event != EVENT_BCHAN_DATA && event != EVENT_TONE_GENERATE) { /*  Debug Only Non-Bchan */
 		int debuglevel = 1;
 		if ( event == EVENT_CLEANUP && !user_data) {
@@ -5102,7 +5102,7 @@
 			chan_misdn_log(4, bc->port, " --> bc_state:%s\n", bc_state2str(bc->bc_state));
 		}
 	}
-	
+
 	if (!ch) {
 		switch(event) {
 		case EVENT_SETUP:
@@ -5124,7 +5124,7 @@
 			return -1;
 		}
 	}
-	
+
 	if (ch) {
 		switch (event) {
 		case EVENT_TONE_GENERATE:
@@ -5147,8 +5147,8 @@
 			}
 		}
 	}
-	
-	
+
+
 	switch (event) {
 	case EVENT_PORT_ALARM:
 		{
@@ -5156,17 +5156,17 @@
 			misdn_cfg_get(bc->port, MISDN_CFG_ALARM_BLOCK, &boa, sizeof(boa));
 			if (boa) {
 				cb_log(1, bc->port, " --> blocking\n");
-				misdn_lib_port_block(bc->port); 
+				misdn_lib_port_block(bc->port);
 			}
 		}
 		break;
 	case EVENT_BCHAN_ACTIVATED:
 		break;
-		
+
 	case EVENT_NEW_CHANNEL:
 		update_name(ch->ast,bc->port,bc->channel);
 		break;
-		
+
 	case EVENT_NEW_L3ID:
 		ch->l3id=bc->l3_id;
 		ch->addr=bc->addr;
@@ -5176,7 +5176,7 @@
 		if (!ch) {
 			ch = find_holded(cl_te,bc);
 		}
-		
+
 		if (!ch) {
 			ast_log(LOG_WARNING, "NEW_BC without chan_list?\n");
 			break;
@@ -5186,7 +5186,7 @@
 			ch->bc = (struct misdn_bchannel *)user_data;
 		}
 		break;
-		
+
 	case EVENT_DTMF_TONE:
 	{
 		/*  sending INFOS as DTMF-Frames :) */
@@ -5202,7 +5202,7 @@
 		fr.mallocd = 0;
 		fr.offset = 0;
 		fr.delivery = ast_tv(0,0);
-		
+
 		if (!ch->ignore_dtmf) {
 			chan_misdn_log(2, bc->port, " --> DTMF:%c\n", bc->dtmf);
 			ast_queue_frame(ch->ast, &fr);
@@ -5213,12 +5213,12 @@
 		break;
 	case EVENT_STATUS:
 		break;
-    
+
 	case EVENT_INFORMATION:
 		if (ch->state != MISDN_CONNECTED) {
 			stop_indicate(ch);
 		}
-	
+
 		if (!ch->ast) {
 			break;
 		}
@@ -5244,7 +5244,7 @@
 					break;
 				}
 			}
-			
+
 			if (!ast_canmatch_extension(ch->ast, ch->context, bc->dialed.number, 1, bc->caller.number)) {
 				if (ast_exists_extension(ch->ast, ch->context, "i", 1, bc->caller.number)) {
 					ast_log(LOG_WARNING, "Extension can never match, So jumping to 'i' extension. port(%d)\n", bc->port);
@@ -5274,7 +5274,7 @@
 				ch->overlap_tv = ast_tvnow();
 				ast_mutex_unlock(&ch->overlap_tv_lock);
 				if (ch->overlap_dial_task == -1) {
-					ch->overlap_dial_task = 
+					ch->overlap_dial_task =
 						misdn_tasks_add_variable(ch->overlap_dial, misdn_overlap_dial_task, ch);
 				}
 				break;
@@ -5307,7 +5307,7 @@
 					ast_copy_string(ch->ast->exten, bc->dialed.number, sizeof(ch->ast->exten));
 					ast_cdr_update(ch->ast);
 				}
-				
+
 				ast_queue_frame(ch->ast, &fr);
 			}
 		}
@@ -5361,7 +5361,7 @@
 		chan = misdn_new(ch, AST_STATE_RESERVED, bc->dialed.number, bc->caller.number, AST_FORMAT_ALAW, bc->port, bc->channel);
 		if (!chan) {
 			misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
-			ast_log(LOG_ERROR, "cb_events: misdn_new failed !\n"); 
+			ast_log(LOG_ERROR, "cb_events: misdn_new failed !\n");
 			return 0;
 		}
 
@@ -5514,8 +5514,8 @@
 			break;
 		}
 
-		/* Whatever happens, when sending_complete is set or we are PTMP TE, we will definitely 
-		 * jump into the dialplan, when the dialed extension does not exist, the 's' extension 
+		/* Whatever happens, when sending_complete is set or we are PTMP TE, we will definitely
+		 * jump into the dialplan, when the dialed extension does not exist, the 's' extension
 		 * will be used by Asterisk automatically. */
 		if (bc->sending_complete || (!bc->nt && !misdn_lib_is_ptp(bc->port))) {
 			if (!ch->noautorespond_on_setup) {
@@ -5530,7 +5530,7 @@
 
 
 		/*
-		 * When we are NT and overlapdial is set and if 
+		 * When we are NT and overlapdial is set and if
 		 * the number is empty, we wait for the ISDN timeout
 		 * instead of our own timer.
 		 */
@@ -5539,8 +5539,8 @@
 			break;
 		}
 
-		/* 
-		 * If overlapdial we will definitely send a SETUP_ACKNOWLEDGE and wait for more 
+		/*
+		 * If overlapdial we will definitely send a SETUP_ACKNOWLEDGE and wait for more
 		 * Infos with a Interdigit Timeout.
 		 * */
 		if (ch->overlap_dial) {
@@ -5550,13 +5550,13 @@
 
 			wait_for_digits(ch, bc, chan);
 			if (ch->overlap_dial_task == -1) {
-				ch->overlap_dial_task = 
+				ch->overlap_dial_task =
 					misdn_tasks_add_variable(ch->overlap_dial, misdn_overlap_dial_task, ch);
 			}
 			break;
 		}
 
-		/* If the extension does not exist and we're not TE_PTMP we wait for more digits 
+		/* If the extension does not exist and we're not TE_PTMP we wait for more digits
 		 * without interdigit timeout.
 		 * */
 		if (!ast_exists_extension(ch->ast, ch->context, bc->dialed.number, 1, bc->caller.number))  {
@@ -5604,7 +5604,7 @@
 		}
 
 		ch->state = MISDN_PROCEEDING;
-		
+
 		if (!ch->ast) {
 			break;
 		}
@@ -5621,7 +5621,7 @@
 				misdn_inband_avail(bc)) {
 				start_bc_tones(ch);
 			}
-			
+
 			ch->state = MISDN_PROGRESS;
 
 			if (!ch->ast) {
@@ -5632,16 +5632,16 @@
 		break;
 	case EVENT_ALERTING:
 		ch->state = MISDN_ALERTING;
-		
+
 		if (!ch->ast) {
 			break;
 		}
 
 		ast_queue_control(ch->ast, AST_CONTROL_RINGING);
 		ast_setstate(ch->ast, AST_STATE_RINGING);
-		
+
 		cb_log(7, bc->port, " --> Set State Ringing\n");
-		
+
 		if (misdn_cap_is_speech(bc->capability) && misdn_inband_avail(bc)) {
 			cb_log(1, bc->port, "Starting Tones, we have inband Data\n");
 			start_bc_tones(ch);
@@ -5711,7 +5711,7 @@
 				   alternative number, then play it instead of
 				   immediately releasing the call */
 				chan_misdn_log(1, bc->port, " --> Inband Info Avail, not sending RELEASE\n");
-		
+
 				ch->state = MISDN_DISCONNECTED;
 				start_bc_tones(ch);
 
@@ -5772,7 +5772,7 @@
 	case EVENT_BCHAN_ERROR:
 	case EVENT_CLEANUP:
 		stop_bc_tones(ch);
-		
+
 		switch (ch->state) {
 		case MISDN_CALLING:
 			bc->cause = AST_CAUSE_DESTINATION_OUT_OF_ORDER;
@@ -5780,7 +5780,7 @@
 		default:
 			break;
 		}
-		
+
 		hangup_chan(ch);
 		release_chan(bc);
 		break;
@@ -5813,7 +5813,7 @@
 
 		res = generate(ast, tmp, tone_len, tone_len);
 		ast->generatordata = tmp;
-		
+
 		if (res) {
 			ast_log(LOG_WARNING, "Auto-deactivating generator\n");
 			ast_deactivate_generator(ast);
@@ -5857,12 +5857,12 @@
 				chan_misdn_log(9, bc->port, "Select Timed out\n");
 				break;
 			}
-			
+
 			if (t < 0) {
 				chan_misdn_log(-1, bc->port, "Select Error (err=%s)\n", strerror(errno));
 				break;
 			}
-			
+
 			if (FD_ISSET(ch->pipe[1], &wrfs)) {
 				chan_misdn_log(9, bc->port, "writing %d bytes to asterisk\n", bc->bframe_len);
 				if (write(ch->pipe[1], bc->bframe, bc->bframe_len) <= 0) {
@@ -5912,7 +5912,7 @@
 				misdn_lib_send_event(bc, EVENT_RELEASE);
 			}
 			break;
-		case MISDN_CLEANING: 
+		case MISDN_CLEANING:
 			chan_misdn_log(1, bc->port, " --> in state cleaning .. so ignoring, the stack should clean it for us\n");
 			break;
 		default:
@@ -5951,7 +5951,7 @@
 		if (hold_ast) {
 			ast_moh_stop(hold_ast);
 		}
-	
+
 		if (misdn_lib_send_event(bc, EVENT_RETRIEVE_ACKNOWLEDGE) < 0) {
 			chan_misdn_log(4, bc->port, " --> RETRIEVE_ACK failed\n");
 			misdn_lib_send_event(bc, EVENT_RETRIEVE_REJECT);
@@ -5975,7 +5975,7 @@
 			chan_misdn_log(2, bc->port, "Bridge Partner is of type: %s\n", bridged->tech->type);
 			ch->state = MISDN_HOLDED;
 			ch->l3id = bc->l3_id;
-			
+
 			misdn_lib_send_event(bc, EVENT_HOLD_ACKNOWLEDGE);
 
 			/* XXX This should queue an AST_CONTROL_HOLD frame on this channel
@@ -5991,10 +5991,10 @@
 			chan_misdn_log(0, bc->port, "We aren't bridged to anybody\n");
 		}
 		break;
-	} 
+	}
 	case EVENT_FACILITY:
 		print_facility(&(bc->fac_in), bc);
-		
+
 		switch (bc->fac_in.Function) {
 #ifdef HAVE_MISDN_FAC_RESULT
 		case Fac_RESULT:
@@ -6017,7 +6017,7 @@
 					}
 				}
 				misdn_lib_send_event(bc, EVENT_DISCONNECT);
-			} 
+			}
 			break;
 		case Fac_AOCDCurrency:
 			if (ch) {
@@ -6043,7 +6043,7 @@
 		default:
 			chan_misdn_log(0, bc->port," --> not yet handled: facility type:%d\n", bc->fac_in.Function);
 		}
-		
+
 		break;
 	case EVENT_RESTART:
 		if (!bc->dummy) {
@@ -6055,7 +6055,7 @@
 		chan_misdn_log(1, 0, "Got Unknown Event\n");
 		break;
 	}
-	
+
 	return RESPONSE_OK;
 }
 
@@ -6076,7 +6076,7 @@
 	ast_log(LOG_VERBOSE, "-- Unregistering mISDN Channel Driver --\n");
 
 	misdn_tasks_destroy();
-	
+
 	if (!g_config_initialized) {
 		return 0;
 	}
@@ -6093,7 +6093,7 @@
 	free_robin_list();
 	misdn_cfg_destroy();
 	misdn_lib_destroy();
-  
+
 	if (misdn_debug) {
 		ast_free(misdn_debug);
 	}
@@ -6101,7 +6101,7 @@
 		ast_free(misdn_debug_only);
 	}
  	ast_free(misdn_ports);
- 	
+
 	return 0;
 }
 
@@ -6119,18 +6119,18 @@
 	};
 
 	max_ports = misdn_lib_maxports_get();
-	
+
 	if (max_ports <= 0) {
 		ast_log(LOG_ERROR, "Unable to initialize mISDN\n");
 		return AST_MODULE_LOAD_DECLINE;
 	}
-	
+
 	if (misdn_cfg_init(max_ports, 0)) {
 		ast_log(LOG_ERROR, "Unable to initialize misdn_config.\n");
 		return AST_MODULE_LOAD_DECLINE;
 	}

[... 5890 lines stripped ...]



More information about the asterisk-commits mailing list