[asterisk-commits] branch oej/multiparking r16194 - in /team/oej/multiparking: ./ channels/ func...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Mar 29 12:33:48 MST 2006


Author: oej
Date: Wed Mar 29 13:33:45 2006
New Revision: 16194

URL: http://svn.digium.com/view/asterisk?rev=16194&view=rev
Log:
- Move to stringfields
- Implement support in the CHANNEL function

Modified:
    team/oej/multiparking/Makefile
    team/oej/multiparking/channels/chan_iax2.c
    team/oej/multiparking/channels/chan_sip.c
    team/oej/multiparking/channels/chan_zap.c
    team/oej/multiparking/funcs/func_channel.c
    team/oej/multiparking/include/asterisk/channel.h
    team/oej/multiparking/res/res_features.c

Modified: team/oej/multiparking/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/Makefile?rev=16194&r1=16193&r2=16194&view=diff
==============================================================================
--- team/oej/multiparking/Makefile (original)
+++ team/oej/multiparking/Makefile Wed Mar 29 13:33:45 2006
@@ -46,7 +46,7 @@
 #K6OPT  = -DK6OPT
 
 #Tell gcc to optimize the code
-OPTIMIZE+=#-O6
+OPTIMIZE+=-O6
 else
   # Stack backtraces, while useful for debugging, are incompatible with optimizations
   ifeq (${OSARCH},Linux)

Modified: team/oej/multiparking/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_iax2.c?rev=16194&r1=16193&r2=16194&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_iax2.c (original)
+++ team/oej/multiparking/channels/chan_iax2.c Wed Mar 29 13:33:45 2006
@@ -3585,7 +3585,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/multiparking/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_sip.c?rev=16194&r1=16193&r2=16194&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_sip.c (original)
+++ team/oej/multiparking/channels/chan_sip.c Wed Mar 29 13:33:45 2006
@@ -2992,7 +2992,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/multiparking/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_zap.c?rev=16194&r1=16193&r2=16194&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_zap.c (original)
+++ team/oej/multiparking/channels/chan_zap.c Wed Mar 29 13:33:45 2006
@@ -5203,7 +5203,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/multiparking/funcs/func_channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/funcs/func_channel.c?rev=16194&r1=16193&r2=16194&view=diff
==============================================================================
--- team/oej/multiparking/funcs/func_channel.c (original)
+++ team/oej/multiparking/funcs/func_channel.c Wed Mar 29 13:33:45 2006
@@ -73,6 +73,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"))
@@ -96,6 +98,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"))
@@ -123,6 +127,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 		parkinglot for parking\n"
 		"R/O	state			state for channel\n"
 		"R/O	tonezone 		zone for indications played\n"
 		"R/O	videonativeformat 	format used natively for video\n"

Modified: team/oej/multiparking/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/include/asterisk/channel.h?rev=16194&r1=16193&r2=16194&view=diff
==============================================================================
--- team/oej/multiparking/include/asterisk/channel.h (original)
+++ team/oej/multiparking/include/asterisk/channel.h Wed Mar 29 13:33:45 2006
@@ -284,14 +284,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/multiparking/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/res/res_features.c?rev=16194&r1=16193&r2=16194&view=diff
==============================================================================
--- team/oej/multiparking/res/res_features.c (original)
+++ team/oej/multiparking/res/res_features.c Wed Mar 29 13:33:45 2006
@@ -14,22 +14,6 @@
  * This program is free software, distributed under the terms of
  * the GNU General Public License Version 2. See the LICENSE file
  * at the top of the source tree.
- */
-
-/*----------------- BRANCH NOTE *------------------------------ 
- * This code is under development 
- *
- * Input is appreciated, e-mail to oej at edvina.net
- *
- *	Goal:
- *	 To implement multiple parking lots, so that if you
- *	 run a virtual PBX with many customers in the same
- * 	 Asterisk, you can set up multiple parking lots
- *	 Or one for each group in your company
- * 	 And maybe a special VIP parking lot for the boss :-)
- *
- *	Plase add test reviews to the bug tracker
- *	http://bugs.digium.com/view.php?id=6113
  */
 
 /*! \file
@@ -325,14 +309,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)))) {
@@ -1732,7 +1716,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);
 		}
 	}
@@ -1741,7 +1725,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
@@ -1757,7 +1741,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
@@ -1776,7 +1760,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;
@@ -1800,7 +1784,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