[asterisk-commits] jpeeler: branch group/multiparking r113295 - in /team/group/multiparking: cha...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 7 18:57:17 CDT 2008


Author: jpeeler
Date: Mon Apr  7 18:57:15 2008
New Revision: 113295

URL: http://svn.digium.com/view/asterisk?view=rev&rev=113295
Log:
set parkinglot on chan in setup_zap from zapata.conf so parked call can be connected

Modified:
    team/group/multiparking/channels/chan_zap.c
    team/group/multiparking/main/features.c
    team/group/multiparking/main/translate.c

Modified: team/group/multiparking/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/group/multiparking/channels/chan_zap.c?view=diff&rev=113295&r1=113294&r2=113295
==============================================================================
--- team/group/multiparking/channels/chan_zap.c (original)
+++ team/group/multiparking/channels/chan_zap.c Mon Apr  7 18:57:15 2008
@@ -5951,8 +5951,10 @@
 		tmp->callgroup = i->callgroup;
 		tmp->pickupgroup = i->pickupgroup;
 	}
-	if (!ast_strlen_zero(i->parkinglot))
+	if (!ast_strlen_zero(i->parkinglot)) {
 		ast_string_field_set(tmp, parkinglot, i->parkinglot);
+		ast_log(LOG_DEBUG, "******************************* Channel set to parkinglot=%s\n", i->parkinglot);
+	}
 	if (!ast_strlen_zero(i->language))
 		ast_string_field_set(tmp, language, i->language);
 	if (!i->owner)
@@ -8488,6 +8490,7 @@
 		ast_copy_string(tmp->context, conf.chan.context, sizeof(tmp->context));
 		ast_copy_string(tmp->cid_num, conf.chan.cid_num, sizeof(tmp->cid_num));
 		ast_copy_string(tmp->parkinglot, conf.chan.parkinglot, sizeof(tmp->parkinglot));
+		ast_log(LOG_DEBUG, "******************************* is it? parkinglot=%s\n", tmp->parkinglot);
 		tmp->cid_ton = 0;
 		ast_copy_string(tmp->cid_name, conf.chan.cid_name, sizeof(tmp->cid_name));
 		ast_copy_string(tmp->mailbox, conf.chan.mailbox, sizeof(tmp->mailbox));
@@ -13210,15 +13213,22 @@
 
 static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int reload, int options)
 {
+	/* TODO: jpeeler - get parkinglot in confp before build_channels is called */
 	struct zt_pvt *tmp;
 	const char *ringc; /* temporary string for parsing the dring number. */
 	int y;
 	int found_pseudo = 0;
-        char zapchan[MAX_CHANLIST_LEN] = {};
+	char zapchan[MAX_CHANLIST_LEN] = {};
 
 	for (; v; v = v->next) {
 		if (!ast_jb_read_conf(&global_jbconf, v->name, v->value))
 			continue;
+
+		/* TODO: jpeeler
+		if (!strcasecmp(v->name, "parkinglot")) {
+			ast_copy_string(confp->chan.parkinglot, v->value, sizeof(confp->chan.parkinglot));
+		}
+		*/
 
 		/* Create the interface list */
 		if (!strcasecmp(v->name, "channel")
@@ -13382,6 +13392,7 @@
 			ast_copy_string(confp->chan.mohsuggest, v->value, sizeof(confp->chan.mohsuggest));
 		} else if (!strcasecmp(v->name, "parkinglot")) {
 			ast_copy_string(parkinglot, v->value, sizeof(parkinglot));
+			ast_log(LOG_DEBUG, "******************************* parkinglot=%s\n", parkinglot);
 		} else if (!strcasecmp(v->name, "stripmsd")) {
 			ast_log(LOG_NOTICE, "Configuration option \"%s\" has been deprecated. Please use dialplan instead\n", v->name);
 			confp->chan.stripmsd = atoi(v->value);
@@ -14014,6 +14025,7 @@
 	struct ast_flags config_flags = { reload == 1 ? CONFIG_FLAG_FILEUNCHANGED : 0 };
 	const char *cat;
 	int res;
+	const char *parkinglot = NULL;
 
 #ifdef HAVE_PRI
 	char *c;
@@ -14109,6 +14121,11 @@
 
 	mwimonitornotify[0] = '\0';
 
+	/* TODO jpeeler: better placement? */
+	if ((parkinglot = ast_variable_retrieve(cfg, "channels", "parkinglot"))) {
+		ast_copy_string(base_conf.chan.parkinglot, parkinglot, sizeof(base_conf.chan.parkinglot));
+	}
+
 	v = ast_variable_browse(cfg, "channels");
 	if ((res = process_zap(&base_conf, v, reload, 0))) {
 		ast_mutex_unlock(&iflock);

Modified: team/group/multiparking/main/features.c
URL: http://svn.digium.com/view/asterisk/team/group/multiparking/main/features.c?view=diff&rev=113295&r1=113294&r2=113295
==============================================================================
--- team/group/multiparking/main/features.c (original)
+++ team/group/multiparking/main/features.c Mon Apr  7 18:57:15 2008
@@ -210,7 +210,7 @@
 static void parkinglot_unref(struct ast_parkinglot *parkinglot);
 static void parkinglot_destroy(struct ast_parkinglot *ruin);
 int manage_parkinglot(struct ast_parkinglot *curlot, fd_set *rfds, fd_set *efds, fd_set *nrfds, fd_set *nefds);
-int ast_park_call_full(struct ast_channel *chan, struct ast_channel *peer, int timeout, int *extout, struct ast_parkinglot *parkinglot);
+int ast_park_call_full(struct ast_channel *chan, struct ast_channel *peer, int timeout, int *extout, struct ast_parkinglot *parkinglot); /* TODO: this wasn't defined anywhere */
 struct ast_parkinglot *find_parkinglot(const char *name);
 
 static pthread_t parking_thread;
@@ -447,7 +447,7 @@
 
 	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)

Modified: team/group/multiparking/main/translate.c
URL: http://svn.digium.com/view/asterisk/team/group/multiparking/main/translate.c?view=diff&rev=113295&r1=113294&r2=113295
==============================================================================
--- team/group/multiparking/main/translate.c (original)
+++ team/group/multiparking/main/translate.c Mon Apr  7 18:57:15 2008
@@ -498,7 +498,7 @@
 					tr_matrix[x][z].step = tr_matrix[x][y].step;
 					tr_matrix[x][z].cost = newcost;
 					tr_matrix[x][z].multistep = 1;
-					ast_debug(3, "Discovered %d cost path from %s to %s, via %d\n", tr_matrix[x][z].cost, ast_getformatname(x), ast_getformatname(z), y);
+					//ast_debug(3, "Discovered %d cost path from %s to %s, via %d\n", tr_matrix[x][z].cost, ast_getformatname(x), ast_getformatname(z), y);
 					changed++;
 				}
 			}




More information about the asterisk-commits mailing list