[asterisk-commits] branch oej/test-this-branch r16236 - in /team/oej/test-this-branch: channels/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Mar 29 13:10:50 MST 2006


Author: oej
Date: Wed Mar 29 14:10:47 2006
New Revision: 16236

URL: http://svn.digium.com/view/asterisk?rev=16236&view=rev
Log:
Fix compilation after merge problems...

Modified:
    team/oej/test-this-branch/channels/chan_iax2.c
    team/oej/test-this-branch/channels/chan_sip.c
    team/oej/test-this-branch/channels/chan_zap.c
    team/oej/test-this-branch/funcs/func_channel.c
    team/oej/test-this-branch/include/asterisk/channel.h
    team/oej/test-this-branch/pbx/pbx_config.c
    team/oej/test-this-branch/res/res_features.c

Modified: team/oej/test-this-branch/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_iax2.c?rev=16236&r1=16235&r2=16236&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_iax2.c (original)
+++ team/oej/test-this-branch/channels/chan_iax2.c Wed Mar 29 14:10:47 2006
@@ -3589,7 +3589,7 @@
 		if (!ast_strlen_zero(i->accountcode))
 			ast_string_field_set(tmp, accountcode, i->accountcode);
 		if (!ast_strlen_zero(i->parkinglot))
-			ast_copy_string(tmp->parkinglot, i->parkinglot, sizeof(tmp->parkinglot));
+			ast_string_field_set(tmp, parkinglot, i->parkinglot);
 		if (i->amaflags)
 			tmp->amaflags = i->amaflags;
 		ast_copy_string(tmp->context, i->context, sizeof(tmp->context));

Modified: team/oej/test-this-branch/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_sip.c?rev=16236&r1=16235&r2=16236&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_sip.c (original)
+++ team/oej/test-this-branch/channels/chan_sip.c Wed Mar 29 14:10:47 2006
@@ -3141,7 +3141,7 @@
 	if (!ast_strlen_zero(i->musicclass))
 		ast_string_field_set(tmp, musicclass, i->musicclass);
 	if (!ast_strlen_zero(i->parkinglot))
-		ast_copy_string(tmp->parkinglot, i->parkinglot, sizeof(tmp->parkinglot));
+		ast_string_field_set(tmp, parkinglot, i->parkinglot);
 	i->owner = tmp;
 	ast_mutex_lock(&usecnt_lock);
 	usecnt++;

Modified: team/oej/test-this-branch/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_zap.c?rev=16236&r1=16235&r2=16236&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_zap.c (original)
+++ team/oej/test-this-branch/channels/chan_zap.c Wed Mar 29 14:10:47 2006
@@ -5326,7 +5326,7 @@
 		if (!ast_strlen_zero(i->musicclass))
 			ast_string_field_set(tmp, musicclass, i->musicclass);
 		if (!ast_strlen_zero(i->parkinglot))
-			ast_copy_string(tmp->parkinglot, i->parkinglot, sizeof(tmp->parkinglot));
+			ast_string_field_set(tmp, parkinglot, i->parkinglot);
 		if (!i->owner)
 			i->owner = tmp;
 		if (!ast_strlen_zero(i->accountcode))

Modified: team/oej/test-this-branch/funcs/func_channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/funcs/func_channel.c?rev=16236&r1=16235&r2=16236&view=diff
==============================================================================
--- team/oej/test-this-branch/funcs/func_channel.c (original)
+++ team/oej/test-this-branch/funcs/func_channel.c Wed Mar 29 14:10:47 2006
@@ -74,6 +74,8 @@
 		locked_copy_string(chan, buf, chan->language, len);
 	else if (!strcasecmp(data, "musicclass"))
 		locked_copy_string(chan, buf, chan->musicclass, len);
+	else if (!strcasecmp(data, "parkinglot"))
+		locked_copy_string(chan, buf, chan->parkinglot, len);
 	else if (!strcasecmp(data, "state"))
 		locked_copy_string(chan, buf, ast_state2str(chan->_state), len);
 	else if (!strcasecmp(data, "channeltype"))
@@ -98,6 +100,8 @@
 
 	if (!strcasecmp(data, "language"))
 		locked_string_field_set(chan, language, value);
+	else if (!strcasecmp(data, "parkinglot"))
+		locked_string_field_set(chan, parkinglot, value);
 	else if (!strcasecmp(data, "musicclass"))
 		locked_string_field_set(chan, musicclass, value);
 	else if (!strcasecmp(data, "callgroup"))
@@ -131,6 +135,7 @@
 		"R/O	channeltype		technology used for channel\n"
 		"R/W	language 		language for sounds played\n"
 		"R/W	musicclass 		class (from musiconhold.conf) for hold music\n"
+		"R/W	parkinglot 		which parkinglot this channel parks in\n"
 		"R/W	rxgain			set rxgain level on channel drivers that support it\n"
 		"R/O	state			state for channel\n"
 		"R/O	tonezone 		zone for indications played\n"

Modified: team/oej/test-this-branch/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/include/asterisk/channel.h?rev=16236&r1=16235&r2=16236&view=diff
==============================================================================
--- team/oej/test-this-branch/include/asterisk/channel.h (original)
+++ team/oej/test-this-branch/include/asterisk/channel.h Wed Mar 29 14:10:47 2006
@@ -288,14 +288,11 @@
 		AST_STRING_FIELD(accountcode);		/*! Account code for billing */
 		AST_STRING_FIELD(call_forward);		/*! Where to forward to if asked to dial on this interface */
 		AST_STRING_FIELD(uniqueid);		/*! Unique Channel Identifier */
+		AST_STRING_FIELD(parkinglot);		/*! Default parking lot, if empty, default parking lot  */
 	);
 	
 	/*! File descriptor for channel -- Drivers will poll on these file descriptors, so at least one must be non -1.  */
 	int fds[AST_MAX_FDS];			
-
-
-	/*! Default parking lot, if empty, default parking lot  */
-	char parkinglot[AST_MAX_EXTENSION];
 
 	/*! Music State*/
 	void *music_state;

Modified: team/oej/test-this-branch/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/pbx/pbx_config.c?rev=16236&r1=16235&r2=16236&view=diff
==============================================================================
--- team/oej/test-this-branch/pbx/pbx_config.c (original)
+++ team/oej/test-this-branch/pbx/pbx_config.c Wed Mar 29 14:10:47 2006
@@ -1404,135 +1404,133 @@
 			if (con == NULL)
 				continue;
 
-				/* XXX indentation should be fixed for this block */
-				for (v = ast_variable_browse(cfg, cxt); v; v = v->next) {
-					if (!strcasecmp(v->name, "exten")) {
-						char *ext, *pri, *appl, *data, *cidmatch;
-						char *stringp=NULL;
-						int ipri = -2;
-						char realext[256]="";
-						char *plus, *firstp, *firstc;
-						char *tc = strdup(v->value);
-						if (tc == NULL)
-							fprintf(stderr,"Error strdup returned NULL in %s\n",__PRETTY_FUNCTION__);
-						else {
-							stringp=tc;
-							ext = strsep(&stringp, ",");
-							if (!ext)
-								ext="";
-							pbx_substitute_variables_helper(NULL, ext, realext, sizeof(realext) - 1);
-							cidmatch = strchr(realext, '/');
-							if (cidmatch) {
-								*cidmatch++ = '\0';
-								ast_shrink_phone_number(cidmatch);
-							}
-							pri = strsep(&stringp, ",");
-							if (!pri)
-								pri="";
-							label = strchr(pri, '(');
-							if (label) {
-								*label++ = '\0';
-								end = strchr(label, ')');
-								if (end)
-									*end = '\0';
-								else
-									ast_log(LOG_WARNING, "Label missing trailing ')' at line %d\n", v->lineno);
-							}
-							plus = strchr(pri, '+');
-							if (plus)
-								*plus++ = '\0';
-							if (!strcmp(pri,"hint"))
-								ipri=PRIORITY_HINT;
-							else if (!strcmp(pri, "next") || !strcmp(pri, "n")) {
-								if (lastpri > -2)
-									ipri = lastpri + 1;
-								else
-									ast_log(LOG_WARNING, "Can't use 'next' priority on the first entry!\n");
-							} else if (!strcmp(pri, "same") || !strcmp(pri, "s")) {
-								if (lastpri > -2)
-									ipri = lastpri;
-								else
-									ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n");
-							} else  {
-								if (sscanf(pri, "%d", &ipri) != 1) {
-									if ((ipri = ast_findlabel_extension2(NULL, con, realext, pri, cidmatch)) < 1) {
-										ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, v->lineno);
-										ipri = 0;
-									}
+			for (v = ast_variable_browse(cfg, cxt); v; v = v->next) {
+				if (!strcasecmp(v->name, "exten")) {
+					char *ext, *pri, *appl, *data, *cidmatch;
+					char *stringp=NULL;
+					int ipri = -2;
+					char realext[256]="";
+					char *plus, *firstp, *firstc;
+					char *tc = strdup(v->value);
+					if (tc == NULL)
+						fprintf(stderr,"Error strdup returned NULL in %s\n",__PRETTY_FUNCTION__);
+					else {
+						stringp=tc;
+						ext = strsep(&stringp, ",");
+						if (!ext)
+							ext="";
+						pbx_substitute_variables_helper(NULL, ext, realext, sizeof(realext) - 1);
+						cidmatch = strchr(realext, '/');
+						if (cidmatch) {
+							*cidmatch++ = '\0';
+							ast_shrink_phone_number(cidmatch);
+						}
+						pri = strsep(&stringp, ",");
+						if (!pri)
+							pri="";
+						label = strchr(pri, '(');
+						if (label) {
+							*label++ = '\0';
+							end = strchr(label, ')');
+							if (end)
+								*end = '\0';
+							else
+								ast_log(LOG_WARNING, "Label missing trailing ')' at line %d\n", v->lineno);
+						}
+						plus = strchr(pri, '+');
+						if (plus)
+							*plus++ = '\0';
+						if (!strcmp(pri,"hint"))
+							ipri=PRIORITY_HINT;
+						else if (!strcmp(pri, "next") || !strcmp(pri, "n")) {
+							if (lastpri > -2)
+								ipri = lastpri + 1;
+							else
+								ast_log(LOG_WARNING, "Can't use 'next' priority on the first entry!\n");
+						} else if (!strcmp(pri, "same") || !strcmp(pri, "s")) {
+							if (lastpri > -2)
+								ipri = lastpri;
+							else
+								ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n");
+						} else  {
+							if (sscanf(pri, "%d", &ipri) != 1) {
+								if ((ipri = ast_findlabel_extension2(NULL, con, realext, pri, cidmatch)) < 1) {
+									ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, v->lineno);
+									ipri = 0;
 								}
 							}
 						}
-						appl = stringp;
-						if (!appl)
-							appl="";
-						/* Find the first occurrence of either '(' or ',' */
-						firstc = strchr(appl, ',');
-						firstp = strchr(appl, '(');
-						if (firstc && ((!firstp) || (firstc < firstp))) {
-							/* comma found, no parenthesis */
-							/* or both found, but comma found first */
-							appl = strsep(&stringp, ",");
-							data = stringp;
-						} else if ((!firstc) && (!firstp)) {
-							/* Neither found */
-							data = "";
+					}
+					appl = stringp;
+					if (!appl)
+						appl="";
+					/* Find the first occurrence of either '(' or ',' */
+					firstc = strchr(appl, ',');
+					firstp = strchr(appl, '(');
+					if (firstc && ((!firstp) || (firstc < firstp))) {
+						/* comma found, no parenthesis */
+						/* or both found, but comma found first */
+						appl = strsep(&stringp, ",");
+						data = stringp;
+					} else if ((!firstc) && (!firstp)) {
+						/* Neither found */
+						data = "";
+					} else {
+						/* Final remaining case is parenthesis found first */
+						appl = strsep(&stringp, "(");
+						data = stringp;
+						end = strrchr(data, ')');
+						if ((end = strrchr(data, ')'))) {
+							*end = '\0';
 						} else {
-							/* Final remaining case is parenthesis found first */
-							appl = strsep(&stringp, "(");
-							data = stringp;
-							end = strrchr(data, ')');
-							if ((end = strrchr(data, ')'))) {
-								*end = '\0';
-							} else {
-								ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
-							}
-							ast_process_quotes_and_slashes(data, ',', '|');
+							ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
 						}
-
-							if (!data)
-								data="";
-							appl = ast_skip_blanks(appl);
-							if (ipri) {
-								if (plus)
-									ipri += atoi(plus);
-								lastpri = ipri;
-								if (!ast_opt_dont_warn) {
-									if (!strcmp(realext, "_."))
-										ast_log(LOG_WARNING, "The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line %d\n", v->lineno);
-								}
-								if (ast_add_extension2(con, 0, realext, ipri, label, cidmatch, appl, strdup(data), free, registrar)) {
-									ast_log(LOG_WARNING, "Unable to register extension at line %d\n", v->lineno);
-								}
-							}
-							free(tc);
+						ast_process_quotes_and_slashes(data, ',', '|');
+					}
+
+					if (!data)
+						data="";
+					appl = ast_skip_blanks(appl);
+					if (ipri) {
+						if (plus)
+							ipri += atoi(plus);
+						lastpri = ipri;
+						if (!ast_opt_dont_warn) {
+							if (!strcmp(realext, "_."))
+							ast_log(LOG_WARNING, "The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line %d\n", v->lineno);
 						}
-					} else if(!strcasecmp(v->name, "include")) {
-						memset(realvalue, 0, sizeof(realvalue));
+						if (ast_add_extension2(con, 0, realext, ipri, label, cidmatch, appl, strdup(data), free, registrar)) {
+							ast_log(LOG_WARNING, "Unable to register extension at line %d\n", v->lineno);
+						}
+					}
+					free(tc);
+				} else if(!strcasecmp(v->name, "include")) {
+					memset(realvalue, 0, sizeof(realvalue));
+					pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
+					if (ast_context_add_include2(con, realvalue, registrar))
+						ast_log(LOG_WARNING, "Unable to include context '%s' in context '%s'\n", v->value, cxt);
+				} else if(!strcasecmp(v->name, "ignorepat")) {
+					memset(realvalue, 0, sizeof(realvalue));
+					pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
+					if (ast_context_add_ignorepat2(con, realvalue, registrar))
+						ast_log(LOG_WARNING, "Unable to include ignorepat '%s' in context '%s'\n", v->value, cxt);
+				} else if (!strcasecmp(v->name, "switch") || !strcasecmp(v->name, "lswitch") || !strcasecmp(v->name, "eswitch")) {
+					char *stringp= realvalue;
+					char *appl, *data;
+
+					memset(realvalue, 0, sizeof(realvalue));
+					if (!strcasecmp(v->name, "switch"))
 						pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
-						if (ast_context_add_include2(con, realvalue, registrar))
-							ast_log(LOG_WARNING, "Unable to include context '%s' in context '%s'\n", v->value, cxt);
-					} else if(!strcasecmp(v->name, "ignorepat")) {
-						memset(realvalue, 0, sizeof(realvalue));
-						pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
-						if (ast_context_add_ignorepat2(con, realvalue, registrar))
-							ast_log(LOG_WARNING, "Unable to include ignorepat '%s' in context '%s'\n", v->value, cxt);
-					} else if (!strcasecmp(v->name, "switch") || !strcasecmp(v->name, "lswitch") || !strcasecmp(v->name, "eswitch")) {
-						char *stringp= realvalue;
-						char *appl, *data;
-
-						memset(realvalue, 0, sizeof(realvalue));
-						if (!strcasecmp(v->name, "switch"))
-							pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
-						else
-							ast_copy_string(realvalue, v->value, sizeof(realvalue));
-						appl = strsep(&stringp, "/");
-						data = strsep(&stringp, ""); /* XXX what for ? */
-						if (!data)
-							data = "";
-						if (ast_context_add_switch2(con, appl, data, !strcasecmp(v->name, "eswitch"), registrar))
-							ast_log(LOG_WARNING, "Unable to include switch '%s' in context '%s'\n", v->value, cxt);
-					}
+					else
+						ast_copy_string(realvalue, v->value, sizeof(realvalue));
+					appl = strsep(&stringp, "/");
+					data = strsep(&stringp, ""); /* XXX what for ? */
+					if (!data)
+						data = "";
+					if (ast_context_add_switch2(con, appl, data, !strcasecmp(v->name, "eswitch"), registrar))
+						ast_log(LOG_WARNING, "Unable to include switch '%s' in context '%s'\n", v->value, cxt);
 				}
+			}
 		}
 		ast_config_destroy(cfg);
 	}

Modified: team/oej/test-this-branch/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/res/res_features.c?rev=16236&r1=16235&r2=16236&view=diff
==============================================================================
--- team/oej/test-this-branch/res/res_features.c (original)
+++ team/oej/test-this-branch/res/res_features.c Wed Mar 29 14:10:47 2006
@@ -404,14 +404,14 @@
 
 	if (parkinglotname) {
 		if (option_debug)
-			ast_log(LOG_DEBUG, "---------**--------- Found chanvar Parkinglot: %s\n", parkinglotname);
+			ast_log(LOG_DEBUG, "Found chanvar Parkinglot: %s\n", parkinglotname);
 		parkinglot = find_parkinglot(parkinglotname);	
 	}
 	if (!parkinglot)
 		parkinglot = default_parkinglot;
 
 	if (option_debug)
-		ast_log(LOG_DEBUG, "---------**--------- Parkinglot: %s\n", parkinglot->name);
+		ast_log(LOG_DEBUG, "Parkinglot: %s\n", parkinglot->name);
 
 	
 	if (!(pu = ast_calloc(1, sizeof(*pu)))) {
@@ -1817,7 +1817,7 @@
 	AST_LIST_TRAVERSE(&parkinglots, parkinglot, list) {
 		if (!strcasecmp(parkinglot->name, name)) {
 			if (option_debug)
-				ast_log(LOG_DEBUG, "---------**--------- Found Parkinglot: %s\n", parkinglot->name);
+				ast_log(LOG_DEBUG, "Found Parkinglot: %s\n", parkinglot->name);
 			return(parkinglot);
 		}
 	}
@@ -1826,7 +1826,7 @@
 	return parkinglot;
 }
 
-/*--- park_call_exec: Park a call */
+/*! \brief Park a call */
 static int park_call_exec(struct ast_channel *chan, void *data)
 {
 	/* Data is unused at the moment but could contain a parking
@@ -1842,7 +1842,7 @@
 	parkinglotname = findparkinglotname(chan);
 
 	if (parkinglotname) {
-		ast_log(LOG_DEBUG, "---------**--------- Found chanvar Parkinglot: %s\n", parkinglotname);
+		ast_log(LOG_DEBUG, "Found chanvar Parkinglot: %s\n", parkinglotname);
 		parkinglot = find_parkinglot(parkinglotname);	
 	}
 	/* Setup the exten/priority to be s/1 since we don't know
@@ -1861,7 +1861,7 @@
 	return res;
 }
 
-/*--- park_exec: Pick up parked call in dial plan */
+/*! \brief Pick up parked call in dial plan */
 static int park_exec_full(struct ast_channel *chan, void *data, struct ast_parkinglot *parkinglot)
 {
 	int res=0;
@@ -1885,7 +1885,8 @@
 
 	parkinglotname = findparkinglotname(chan);
 	if (parkinglotname) {
-		ast_log(LOG_DEBUG, "---------**--------- Using parking lot: %s\n", parkinglotname);
+		if (option_debug)
+			ast_log(LOG_DEBUG, "Using parking lot: %s\n", parkinglotname);
 		parkinglot = find_parkinglot(parkinglotname);	
 	}
 	pu = parkinglot->occupiedlots;



More information about the asterisk-commits mailing list