[asterisk-commits] rmudgett: branch rmudgett/misdn_facility r183869 - in /team/rmudgett/misdn_fa...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 23 18:40:44 CDT 2009


Author: rmudgett
Date: Mon Mar 23 18:40:40 2009
New Revision: 183869

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=183869
Log:
Merged revisions 183830,183832 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/team/group/issue8824

................
  r183830 | mmichelson | 2009-03-23 17:32:29 -0500 (Mon, 23 Mar 2009) | 3 lines
  
  Take care of some locking issues in chan_sip as per Russell's comments.
................
  r183832 | rmudgett | 2009-03-23 17:41:04 -0500 (Mon, 23 Mar 2009) | 9 lines
  
  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/rmudgett/misdn_facility/   (props changed)
    team/rmudgett/misdn_facility/channels/chan_misdn.c
    team/rmudgett/misdn_facility/channels/chan_sip.c
    team/rmudgett/misdn_facility/channels/misdn/Makefile
    team/rmudgett/misdn_facility/channels/misdn/chan_misdn_config.h
    team/rmudgett/misdn_facility/channels/misdn/ie.c
    team/rmudgett/misdn_facility/channels/misdn/isdn_lib.c
    team/rmudgett/misdn_facility/channels/misdn/isdn_lib.h
    team/rmudgett/misdn_facility/channels/misdn/isdn_msg_parser.c
    team/rmudgett/misdn_facility/channels/misdn/portinfo.c
    team/rmudgett/misdn_facility/channels/misdn_config.c

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
--- misdn-facility (original)
+++ misdn-facility Mon Mar 23 18:40:40 2009
@@ -1,1 +1,1 @@
-/team/group/issue8824:1-183828
+/team/group/issue8824:1-183832

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Mar 23 18:40:40 2009
@@ -1,1 +1,1 @@
-/trunk:1-183783
+/trunk:1-183831

Modified: team/rmudgett/misdn_facility/channels/chan_misdn.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/channels/chan_misdn.c?view=diff&rev=183869&r1=183868&r2=183869
==============================================================================
--- team/rmudgett/misdn_facility/channels/chan_misdn.c (original)
+++ team/rmudgett/misdn_facility/channels/chan_misdn.c Mon Mar 23 18:40:40 2009
@@ -1,6 +1,6 @@
 /*
  * Asterisk -- An open source telephony toolkit.
- * 
+ *
  * Copyright (C) 2004 - 2006, Christian Richter
  *
  * Christian Richter <crich at beronet.com>
@@ -327,13 +327,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;
@@ -343,18 +343,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;
@@ -368,30 +368,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.
@@ -406,8 +406,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];
 
@@ -466,29 +466,29 @@
 	/*!
 	 * \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;
-  
+
 	/*!
 	 * \brief Associated B channel structure.
 	 */
@@ -507,13 +507,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.
 	 */
@@ -549,24 +549,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
@@ -629,7 +629,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;
@@ -740,26 +740,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;
 }
 
@@ -2146,7 +2146,7 @@
 	case 2:
 		str = "Unavailable";
 		break;
-	
+
 	default:
 		str = "Unknown";
 		break;
@@ -2247,7 +2247,7 @@
 	case 2:
 		str = "Failed Screen";
 		break;
-	
+
 	case 3:
 		str = "Network Number";
 		break;
@@ -3483,10 +3483,10 @@
 	}	/* end switch */
 }
 
-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");
@@ -3651,7 +3651,7 @@
 	default:
 		break;
 	}
-	
+
 	bc->AOCD_need_export = 0;
 }
 
@@ -3671,7 +3671,7 @@
 	sigemptyset(&sa.sa_mask);
 	sigaddset(&sa.sa_mask, SIGUSR1);
 	sigaction(SIGUSR1, &sa, NULL);
-	
+
 	sem_post((sem_t *)data);
 
 	while (1) {
@@ -3698,7 +3698,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);
 
@@ -3836,8 +3836,8 @@
 		"!941+1477/100,!0/100", /* # */
 /* *INDENT-ON* */
 	};
-	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') {
@@ -3895,7 +3895,7 @@
 					only = 1;
 				}
 			}
-	
+
 			for (i = 0; i <= max_ports; i++) {
 				misdn_debug[i] = level;
 				misdn_debug_only[i] = only;
@@ -4190,18 +4190,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);
@@ -4242,15 +4242,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;
@@ -4271,7 +4271,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();
@@ -4388,11 +4388,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) {
@@ -4456,13 +4456,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;
 			}
 		}
 	}
@@ -4573,7 +4573,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)" : "");
@@ -5316,14 +5316,14 @@
 
 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;
 	unsigned max_len;
- 
+
  	switch (cmd) {
 	case CLI_INIT:
 		e->command = "misdn send facility";
@@ -5341,7 +5341,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");
@@ -5354,7 +5354,7 @@
 		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 defined(AST_MISDN_ENHANCEMENTS)
@@ -5362,7 +5362,7 @@
 		if (max_len < strlen(nr)) {
 			ast_verbose("Sending CD with nr %s to %s failed: Number too long (up to %u digits are allowed).\n",
 				nr, channame, max_len);
-			return 0; 
+			return 0;
 		}
 		tmp->bc->fac_out.Function = Fac_CallDeflection;
 		tmp->bc->fac_out.u.CallDeflection.InvokeID = ++misdn_invoke_id;
@@ -5380,7 +5380,7 @@
 		if (max_len < strlen(nr)) {
 			ast_verbose("Sending CD with nr %s to %s failed: Number too long (up to %u digits are allowed).\n",
 				nr, channame, max_len);
-			return 0; 
+			return 0;
 		}
 		tmp->bc->fac_out.Function = Fac_CD;
 		tmp->bc->fac_out.u.CDeflection.PresentationAllowed = 0;
@@ -5441,7 +5441,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);
 
@@ -5572,8 +5572,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;
 
@@ -5602,7 +5602,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++) {
@@ -5640,9 +5640,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);
@@ -5692,7 +5692,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);
@@ -5851,13 +5851,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 {
@@ -5872,9 +5872,9 @@
 	struct misdn_bchannel *bc = ch->bc;
 	int len = ch->jb_len;
 	int 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;
@@ -5996,7 +5996,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");
 
@@ -6011,7 +6011,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;
@@ -6037,7 +6037,7 @@
 			bc->hdlc = 1;
 			break;
 		}
-		
+
 	}
 	/*Initialize new Jitterbuffer*/
 	misdn_cfg_get(port, MISDN_CFG_JITTERBUFFER, &ch->jb_len, sizeof(ch->jb_len));
@@ -6065,7 +6065,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];
 
@@ -6119,13 +6119,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) {
@@ -6486,7 +6486,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);
@@ -6570,10 +6570,10 @@
 
 		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));
-	
+
 		if (ast_strlen_zero(newbc->caller.name)	&& !ast_strlen_zero(ast->connected.id.name)) {
 			ast_copy_string(newbc->caller.name, ast->connected.id.name, sizeof(newbc->caller.name));
 			chan_misdn_log(3, port, " --> * set caller:\"%s\" <%s>\n", newbc->caller.name, newbc->caller.number);
@@ -6582,7 +6582,7 @@
 			ast_copy_string(newbc->caller.number, ast->connected.id.number, sizeof(newbc->caller.number));
 			chan_misdn_log(3, port, " --> * set caller:\"%s\" <%s>\n", newbc->caller.name, newbc->caller.number);
 		}
-	
+
 		misdn_cfg_get(port, MISDN_CFG_LOCALDIALPLAN, &number_type, sizeof(number_type));
 		if (number_type < 0) {
 			newbc->caller.number_type = ast_to_misdn_ton(ast->connected.id.number_type);
@@ -6593,19 +6593,19 @@
 			newbc->caller.number_plan = NUMPLAN_ISDN;
 		}
 		debug_numtype(port, newbc->caller.number_type, "LTON");
-	
+
 		newbc->capability = ast->transfercapability;
 		pbx_builtin_setvar_helper(ast, "TRANSFERCAPABILITY", ast_transfercapability2str(newbc->capability));
 		if (ast->transfercapability == INFO_CAPABILITY_DIGITAL_UNRESTRICTED) {
 			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 */
 		import_ch(ast, newbc, ch);
-	
+
 		/* Finally The Options Override Everything */
 		if (!ast_strlen_zero(args.opts)) {
 			misdn_set_opt_exec(ast, args.opts);
@@ -6615,7 +6615,7 @@
 		if (newbc->set_presentation) {
 			newbc->caller.presentation = newbc->presentation;
 		}
-	
+
 		misdn_copy_redirecting_from_ast(newbc, ast);
 #if defined(AST_MISDN_ENHANCEMENTS)
 		if (newbc->redirecting.from.number[0] && misdn_lib_is_ptp(port)) {
@@ -6685,8 +6685,8 @@
 	}
 
 	ch->state = MISDN_CALLING;
-	
-	return 0; 
+
+	return 0;
 }
 
 
@@ -6700,7 +6700,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);
@@ -6772,12 +6772,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) {
@@ -6834,15 +6834,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);
@@ -6937,7 +6937,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:
@@ -6956,7 +6956,7 @@
 		chan_misdn_log(1, p->bc->port, " --> * Unknown Indication:%d pid:%d\n", cond, p->bc->pid);
 		break;
 	}
-  
+
 	return 0;
 }
 
@@ -6995,16 +6995,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]);
@@ -7061,7 +7061,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");
@@ -7145,7 +7145,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);
@@ -7164,7 +7164,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);
@@ -7175,9 +7175,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) {
@@ -7226,7 +7226,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);
  	}
@@ -7328,7 +7328,7 @@
 {
 	struct chan_list *ch;
 	int i  = 0;
-	
+
 	if (!ast || !(ch = MISDN_ASTERISK_TECH_PVT(ast))) {
 		return -1;
 	}
@@ -7337,12 +7337,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;
@@ -7353,16 +7353,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));
 
@@ -7380,7 +7380,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;
@@ -7404,7 +7404,7 @@
 				"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);
@@ -7421,7 +7421,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);
@@ -7445,13 +7445,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;
 	}
@@ -7478,7 +7478,7 @@
 		ch1->bc->caller.number,
 		ch2->bc->caller.name,
 		ch2->bc->caller.number);
- 
+
 	if (!(flags & AST_BRIDGE_DTMF_CHANNEL_0)) {
 		ch1->ignore_dtmf = 1;
 	}
@@ -7510,7 +7510,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);
 
@@ -7518,11 +7518,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
@@ -7555,11 +7555,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;
@@ -7613,7 +7613,7 @@
 
 	cl->notxtone = 1;
 	cl->norxtone = 1;
-	
+
 	return 0;
 }
 
@@ -7627,7 +7627,7 @@
 		chan_misdn_log(-1, 0, "misdn_request: malloc failed!");
 		return NULL;
 	}
-	
+
 	cl->originator = orig;
 	cl->need_queue_hangup = 1;
 	cl->need_hangup = 1;
@@ -7770,7 +7770,7 @@
 					if (port >= port_start) {
 						next_chan = 1;
 					}
-					
+
 					if (port <= port_start && next_chan) {
 						int maxbchans = misdn_lib_get_maxchans(port);
 
@@ -7792,7 +7792,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);
 						}
@@ -7836,10 +7836,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",
@@ -7872,20 +7872,20 @@
 		return NULL;
 	}
 	cl->ast = ast;
-	
+
 #if defined(AST_MISDN_ENHANCEMENTS)
 	cl->record_id = record_id;
 #endif	/* defined(AST_MISDN_ENHANCEMENTS) */
-		
+
 	/* 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 ast;
 }
 
@@ -7893,7 +7893,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);
@@ -7901,7 +7901,7 @@
 		ast_log(LOG_WARNING, "No chan_list but send_text request?\n");
 		return -1;
 	}
-	
+
 	return 0;
 }
 
@@ -7913,7 +7913,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,
@@ -7945,7 +7945,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);
@@ -7955,7 +7955,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;
@@ -8001,7 +8001,7 @@
 		tmp->rawreadformat = format;
 		tmp->writeformat = format;
 		tmp->rawwriteformat = format;
-    
+
 		tmp->tech_pvt = chlist;
 
 		misdn_cfg_get(0, MISDN_GEN_BRIDGING, &bridging, sizeof(bridging));
@@ -8034,7 +8034,7 @@
 	} else {
 		chan_misdn_log(-1, 0, "Unable to allocate channel structure\n");
 	}
-	
+
 	return tmp;
 }
 
@@ -8087,7 +8087,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;
 		}
@@ -8102,7 +8102,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;
 
@@ -8119,20 +8119,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;
 
@@ -8148,13 +8148,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;
@@ -8162,7 +8162,7 @@
 			return;
 		}
 	}
-	
+
 	ast_mutex_unlock(&cl_te_lock);
 }
 
@@ -8171,7 +8171,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;
 
@@ -8333,9 +8333,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);
@@ -8343,8 +8343,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;
@@ -8396,7 +8396,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;
@@ -8411,11 +8411,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;
 	}
 }
@@ -8489,7 +8489,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]++;
 
@@ -8497,14 +8497,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]) {
@@ -8513,7 +8513,7 @@
 	}
 
 	misdn_out_calls[port]++;
-	
+
 	return 0;
 }
 
@@ -8877,7 +8877,7 @@
 			default:
 				break;
 			}	/* end switch */
-		} 
+		}
 		break;
 #if 0	/* We don't handle this yet */
 	case Fac_CallRerouteing:
@@ -8975,7 +8975,7 @@
 
 			/* This line is BUSY to further attempts by this dialing attempt. */
 			ast_queue_control(ch->ast, AST_CONTROL_BUSY);
-		} 
+		}
 		break;
 #endif	/* !defined(AST_MISDN_ENHANCEMENTS) */
 	case Fac_AOCDCurrency:
@@ -9454,7 +9454,7 @@
 	struct misdn_cc_record *cc_record;
 #endif	/* defined(AST_MISDN_ENHANCEMENTS) */
 	struct chan_list *ch = find_chan_by_bc(cl_te, bc);
-	
+
 	if (event != EVENT_BCHAN_DATA && event != EVENT_TONE_GENERATE) {
 		int debuglevel = 1;
 
@@ -9476,7 +9476,7 @@
 			chan_misdn_log(4, bc->port, " --> bc_state:%s\n", bc_state2str(bc->bc_state));
 		}
 	}
-	
+
 	if (!ch) {
 		switch(event) {
 		case EVENT_SETUP:
@@ -9499,7 +9499,7 @@
 			return -1;
 		}
 	}
-	
+
 	if (ch) {
 		switch (event) {
 		case EVENT_TONE_GENERATE:
@@ -9523,8 +9523,8 @@
 			break;
 		}
 	}
-	
-	
+
+
 	switch (event) {
 	case EVENT_PORT_ALARM:
 		{
@@ -9532,17 +9532,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;
@@ -9552,7 +9552,7 @@
 		if (!ch) {
 			ch = find_holded(cl_te,bc);
 		}
-		
+
 		if (!ch) {
 			ast_log(LOG_WARNING, "NEW_BC without chan_list?\n");
 			break;
@@ -9562,7 +9562,7 @@
 			ch->bc = (struct misdn_bchannel *) user_data;
 		}
 		break;
-		
+
 	case EVENT_DTMF_TONE:
 	{
 		/*  sending INFOS as DTMF-Frames :) */
@@ -9578,7 +9578,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);
@@ -9589,12 +9589,12 @@
 	}
 	case EVENT_STATUS:
 		break;
-    
+
 	case EVENT_INFORMATION:
 		if (ch->state != MISDN_CONNECTED) {
 			stop_indicate(ch);
 		}
-	
+
 		if (!ch->ast) {
 			break;
 		}
@@ -9620,7 +9620,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);
@@ -9650,7 +9650,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;
@@ -9683,7 +9683,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);
 			}
 		}
@@ -9736,7 +9736,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;
 		}
 
@@ -9882,8 +9882,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) {
@@ -9898,7 +9898,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.
 		 */
@@ -9907,8 +9907,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) {
@@ -9918,13 +9918,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))  {
@@ -10017,7 +10017,7 @@
 				misdn_inband_avail(bc)) {
 				start_bc_tones(ch);
 			}
-			
+
 			ch->state = MISDN_PROGRESS;
 
 			if (!ch->ast) {
@@ -10028,7 +10028,7 @@
 		break;
 	case EVENT_ALERTING:
 		ch->state = MISDN_ALERTING;
-		
+
 		if (!ch->ast) {
 			break;
 		}
@@ -10039,9 +10039,9 @@
 
 		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);
@@ -10141,7 +10141,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);
 
@@ -10224,7 +10224,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;
@@ -10232,7 +10232,7 @@
 		default:
 			break;
 		}
-		
+
 		hangup_chan(ch);
 		release_chan(bc);
 		break;
@@ -10265,7 +10265,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);
@@ -10308,12 +10308,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) {
@@ -10363,7 +10363,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:
@@ -10402,7 +10402,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);
@@ -10426,7 +10426,7 @@

[... 5562 lines stripped ...]



More information about the asterisk-commits mailing list