[asterisk-commits] rmudgett: branch 1.6.2 r207315 - in /branches/1.6.2/channels: ./ misdn/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 17 22:50:32 CDT 2009


Author: rmudgett
Date: Fri Jul 17 22:50:28 2009
New Revision: 207315

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=207315
Log:
Merged revisions 145293,158010 from
https://origsvn.digium.com/svn/asterisk/branches/1.4
to make merging easier.  These changes are already on trunk.

................
  r145293 | rmudgett | 2008-09-30 18:55:24 -0500 (Tue, 30 Sep 2008) | 54 lines

  channels/chan_misdn.c
  channels/misdn/isdn_lib.c
  *  Miscellaneous other fixes from trunk to make merging easier later.

  ........
  r145200 | rmudgett | 2008-09-30 16:00:54 -0500 (Tue, 30 Sep 2008) | 7 lines

  *  Miscellaneous formatting changes to make v1.4 and trunk
  more merge compatible in the mISDN area.

  channels/chan_misdn.c
  *  Eliminated redundant code in cb_events() EVENT_SETUP

  ........
  r144257 | crichter | 2008-09-24 03:42:55 -0500 (Wed, 24 Sep 2008) | 9 lines

  improved helptext of misdn_set_opt.
  ........
  r142181 | rmudgett | 2008-09-09 12:30:52 -0500 (Tue, 09 Sep 2008) | 1 line

  Cleaned up comment

  ........
  r138738 | rmudgett | 2008-08-18 16:07:28 -0500 (Mon, 18 Aug 2008) | 30 lines

  channels/chan_misdn.c
  *  Made bearer2str() use allowed_bearers_array[]
  *  Made use the causes.h defines instead of hardcoded numbers.
  *  Made use Asterisk presentation indicator values if either of the
  mISDN presentation or screen options are negative.
  *  Updated the misdn_set_opt application option descriptions.
  *  Renamed the awkward Caller ID presentation misdn_set_opt
  application option value not_screened to restricted.
  Deprecated the not_screened option value.

  channels/misdn/isdn_lib.c
  *  Made use the causes.h defines instead of hardcoded numbers.
  *  Fixed some spelling errors and typos.
  *  Added all defined facility code strings to fac2str().

  channels/misdn/isdn_lib.h
  *  Added doxygen comments to struct misdn_bchannel.

  channels/misdn/isdn_lib_intern.h
  *  Added doxygen comments to struct misdn_stack.

  channels/misdn_config.c
  configs/misdn.conf.sample
  *  Updated the mISDN presentation and screen parameter descriptions.

  doc/misdn.txt (doc/tex/misdn.tex)
  *  Updated the misdn_set_opt application option descriptions.
  *  Fixed some spelling errors and typos.
................
  r158010 | rmudgett | 2008-11-19 19:46:09 -0600 (Wed, 19 Nov 2008) | 9 lines

  Merged revision 157977 from
  https://origsvn.digium.com/svn/asterisk/team/group/issue8824

  ........
  Fixes JIRA ABE-1726

  The dial extension could be empty if you are using MISDN_KEYPAD
  to control ISDN provider features.
................

Modified:
    branches/1.6.2/channels/chan_misdn.c
    branches/1.6.2/channels/misdn/isdn_lib.c

Modified: branches/1.6.2/channels/chan_misdn.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/channels/chan_misdn.c?view=diff&rev=207315&r1=207314&r2=207315
==============================================================================
--- branches/1.6.2/channels/chan_misdn.c (original)
+++ branches/1.6.2/channels/chan_misdn.c Fri Jul 17 22:50:28 2009
@@ -614,7 +614,7 @@
 		if (allowed_bearers_array[index].cap == cap) {
 			return allowed_bearers_array[index].display;
 		}
-	}	/* end for */
+	}
 
 	return "Unknown Bearer";
 }
@@ -1636,7 +1636,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)" : "");
@@ -1714,9 +1714,8 @@
 
 		misdn_lib_send_event(bc, EVENT_FACILITY);
 	} else if (strstr(a->argv[3], "CFDeactivate")) {
-
 		if (a->argc < 6) {
-			ast_verbose("CFActivate requires 1 arg: FromNumber\n\n");
+			ast_verbose("CFDeactivate requires 1 arg: FromNumber\n\n");
 			return 0;
 		}
 		port = atoi(a->argv[4]);
@@ -1762,7 +1761,7 @@
 		channel = atoi(a->argv[4]);
 		misdn_lib_send_restart(port, channel);
 	} else {
- 		misdn_lib_send_restart(port, -1);
+		misdn_lib_send_restart(port, -1);
 	}
 
 	return CLI_SUCCESS;
@@ -2042,7 +2041,6 @@
 		}
 	}
 
-
 	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);
@@ -2230,7 +2228,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) {
@@ -2409,7 +2407,7 @@
 	int r;
 	int exceed;
 	int bridging;
-	struct chan_list *ch = MISDN_ASTERISK_TECH_PVT(ast);
+	struct chan_list *ch;
 	struct misdn_bchannel *newbc;
 	char *dest_cp = ast_strdupa(dest);
 	AST_DECLARE_APP_ARGS(args,
@@ -2418,6 +2416,14 @@
 		AST_APP_ARG(opts);
 	);
 
+	/*
+	 * dest is ---v
+	 * Dial(mISDN/g:group_name[/extension[/options]])
+	 * Dial(mISDN/port[:preselected_channel][/extension[/options]])
+	 *
+	 * The dial extension could be empty if you are using MISDN_KEYPAD
+	 * to control ISDN provider features.
+	 */
 	AST_NONSTANDARD_APP_ARGS(args, dest_cp, '/');
 
 	if (ast_strlen_zero(args.ext)) {
@@ -2437,6 +2443,7 @@
 		return -1;
 	}
 
+	ch = MISDN_ASTERISK_TECH_PVT(ast);
 	if (!ch) {
 		ast_log(LOG_WARNING, " --> ! misdn_call called on %s, neither down nor reserved (or dest==NULL)\n", ast->name);
 		ast->hangupcause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
@@ -2445,7 +2452,6 @@
 	}
 	
 	newbc = ch->bc;
-	
 	if (!newbc) {
 		ast_log(LOG_WARNING, " --> ! misdn_call called on %s, neither down nor reserved (or dest==NULL)\n", ast->name);
 		ast->hangupcause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
@@ -3438,20 +3444,28 @@
 	struct ast_channel *tmp = NULL;
 	char group[BUFFERSIZE + 1] = "";
 	char dial_str[128];
-	char *buf2 = ast_strdupa(data), *ext = NULL, *port_str;
-	char *tokb = NULL, *p = NULL;
-	int channel = 0, port = 0;
+	char *buf2 = ast_strdupa(data);
+	char *ext;
+	char *port_str;
+	char *p = NULL;
+	int channel = 0;
+	int port = 0;
 	struct misdn_bchannel *newbc = NULL;
 	int dec = 0;
 	struct chan_list *cl;
 
-	snprintf(dial_str, sizeof(dial_str), "%s/%s", misdn_type, (char*)data);
-
-	port_str = strtok_r(buf2, "/", &tokb);
-
-	ext = strtok_r(NULL, "/", &tokb);
-
-	if (port_str) {
+	snprintf(dial_str, sizeof(dial_str), "%s/%s", misdn_type, (char *) data);
+
+	/*
+	 * data is ---v
+	 * Dial(mISDN/g:group_name[/extension[/options]])
+	 * Dial(mISDN/port[:preselected_channel][/extension[/options]])
+	 *
+	 * The dial extension could be empty if you are using MISDN_KEYPAD
+	 * to control ISDN provider features.
+	 */
+	port_str = strsep(&buf2, "/");
+	if (!ast_strlen_zero(port_str)) {
 		if (port_str[0] == 'g' && port_str[1] == ':' ) {
 			/* We make a group call lets checkout which ports are in my group */
 			port_str += 2;
@@ -3467,8 +3481,13 @@
 			port = atoi(port_str);
 		}
 	} else {
-		ast_log(LOG_WARNING, " --> ! IND : CALL dad:%s WITHOUT PORT/Group, check extensions.conf\n", ext);
+		ast_log(LOG_WARNING, " --> ! IND : Dial(%s) WITHOUT Port or Group, check extensions.conf\n", dial_str);
 		return NULL;
+	}
+
+	ext = strsep(&buf2, "/");
+	if (!ext) {
+		ext = "";
 	}
 
 	if (misdn_cfg_is_group_method(group, METHOD_STANDARD_DEC)) {
@@ -4167,7 +4186,7 @@
 
 	chan_misdn_log(1, bc->port, "* Starting Ast ctx:%s dad:%s oad:%s with 's' extension\n", ast->context, ast->exten, ast->cid.cid_num);
   
-	strncpy(ast->exten, "s", 2);
+	strcpy(ast->exten, "s");
   
 	if (!ast_canmatch_extension(ast, ast->context, ast->exten, 1, bc->oad) || pbx_start_chan(ch) < 0) {
 		ast = NULL;
@@ -4378,6 +4397,7 @@
 static enum event_response_e
 cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
 {
+	int msn_valid;
 	struct chan_list *held_ch;
 	struct chan_list *ch = find_chan_by_bc(cl_te, bc);
 	
@@ -4610,7 +4630,6 @@
 	case EVENT_SETUP:
 	{
 		struct chan_list *ch = find_chan_by_bc(cl_te, bc);
-		int msn_valid = misdn_cfg_is_msn_valid(bc->port, bc->dad);
 		struct ast_channel *chan;
 		int exceed;
 		int pres, screen;
@@ -4628,6 +4647,7 @@
 			}
 		}
 
+		msn_valid = misdn_cfg_is_msn_valid(bc->port, bc->dad);
 		if (!bc->nt && ! msn_valid) {
 			chan_misdn_log(1, bc->port, " --> Ignoring Call, its not in our MSN List\n");
 			return RESPONSE_IGNORE_SETUP; /*  Ignore MSNs which are not in our List */
@@ -4656,7 +4676,6 @@
 		ch->originator = ORG_MISDN;
 
 		chan = misdn_new(ch, AST_STATE_RESERVED, bc->dad, bc->oad, AST_FORMAT_ALAW, bc->port, bc->channel);
-
 		if (!chan) {
 			ast_free(ch);
 			misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);

Modified: branches/1.6.2/channels/misdn/isdn_lib.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/channels/misdn/isdn_lib.c?view=diff&rev=207315&r1=207314&r2=207315
==============================================================================
--- branches/1.6.2/channels/misdn/isdn_lib.c (original)
+++ branches/1.6.2/channels/misdn/isdn_lib.c Fri Jul 17 22:50:28 2009
@@ -3301,10 +3301,6 @@
 	return NULL;
 }
 
-
-
-
-/* ******************************************************************* */
 /*!
  * \internal
  * \brief Convert the facility function enum value into a string.
@@ -3339,10 +3335,10 @@
 		if (arr[index].facility == facility) {
 			return arr[index].name;
 		}
-	}	/* end for */
+	}
 
 	return "unknown";
-}	/* end fac2str() */
+}
 
 void misdn_lib_log_ies(struct misdn_bchannel *bc)
 {




More information about the asterisk-commits mailing list