[svn-commits] mmichelson: branch mmichelson/udptl-v6 r278500 - in /team/mmichelson/udptl-v6...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jul 21 11:31:57 CDT 2010


Author: mmichelson
Date: Wed Jul 21 11:31:53 2010
New Revision: 278500

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=278500
Log:
resolve conflict and reset automerge.


Modified:
    team/mmichelson/udptl-v6/   (props changed)
    team/mmichelson/udptl-v6/apps/app_meetme.c
    team/mmichelson/udptl-v6/channels/chan_sip.c
    team/mmichelson/udptl-v6/res/res_fax_spandsp.c
    team/mmichelson/udptl-v6/res/res_timing_pthread.c

Propchange: team/mmichelson/udptl-v6/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/mmichelson/udptl-v6/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jul 21 11:31:53 2010
@@ -1,1 +1,1 @@
-/trunk:1-278438
+/trunk:1-278499

Modified: team/mmichelson/udptl-v6/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/udptl-v6/apps/app_meetme.c?view=diff&rev=278500&r1=278499&r2=278500
==============================================================================
--- team/mmichelson/udptl-v6/apps/app_meetme.c (original)
+++ team/mmichelson/udptl-v6/apps/app_meetme.c Wed Jul 21 11:31:53 2010
@@ -3749,7 +3749,7 @@
 }
 
 static struct ast_conference *find_conf_realtime(struct ast_channel *chan, char *confno, int make, int dynamic,
-				char *dynamic_pin, size_t pin_buf_len, int refcount, struct ast_flags64 *confflags, int *too_early)
+				char *dynamic_pin, size_t pin_buf_len, int refcount, struct ast_flags64 *confflags, int *too_early, char **optargs)
 {
 	struct ast_variable *var, *origvar;
 	struct ast_conference *cnf;
@@ -3759,8 +3759,9 @@
 	/* Check first in the conference list */
 	AST_LIST_LOCK(&confs);
 	AST_LIST_TRAVERSE(&confs, cnf, list) {
-		if (!strcmp(confno, cnf->confno)) 
+		if (!strcmp(confno, cnf->confno)) {
 			break;
+		}
 	}
 	if (cnf) {
 		cnf->refcount += refcount;
@@ -3823,13 +3824,15 @@
 			 var = ast_load_realtime("meetme", "confno", confno, NULL);
 		}
 
-		if (!var)
+		if (!var) {
 			return NULL;
+		}
 
 		if (rt_schedule && *too_early) {
 			/* Announce that the caller is early and exit */
-			if (!ast_streamfile(chan, "conf-has-not-started", chan->language))
+			if (!ast_streamfile(chan, "conf-has-not-started", chan->language)) {
 				ast_waitstream(chan, "");
+			}
 			ast_variables_destroy(var);
 			return NULL;
 		}
@@ -3863,6 +3866,8 @@
 		cnf = build_conf(confno, pin ? pin : "", pinadmin ? pinadmin : "", make, dynamic, refcount, chan, NULL);
 
 		if (cnf) {
+			struct ast_flags64 tmp_flags;
+
 			cnf->maxusers = maxusers;
 			cnf->endalert = endalert;
 			cnf->endtime = endtime.tv_sec;
@@ -3871,6 +3876,11 @@
 			cnf->bookid = ast_strdup(bookid);
 			cnf->recordingfilename = ast_strdup(recordingfilename);
 			cnf->recordingformat = ast_strdup(recordingformat);
+
+			/* Parse the other options into confflags -- need to do this in two
+			 * steps, because the parse_options routine zeroes the buffer. */
+			ast_app_parse_options64(meetme_opts, &tmp_flags, optargs, useropts);
+			ast_copy_flags64(confflags, &tmp_flags, tmp_flags.flags);
 
 			if (strchr(cnf->useropts, 'r')) {
 				if (ast_strlen_zero(recordingfilename)) { /* If the recordingfilename in the database is empty, use the channel definition or use the default. */
@@ -3910,7 +3920,7 @@
 			ast_log(LOG_WARNING, "No DAHDI channel available for conference, user introduction disabled (is chan_dahdi loaded?)\n");
 			ast_clear_flag64(confflags, CONFFLAG_INTROUSER | CONFFLAG_INTROUSERNOREVIEW);
 		}
-		
+
 		if (confflags && !cnf->chan &&
 		    ast_test_flag64(confflags, CONFFLAG_RECORDCONF)) {
 			ast_log(LOG_WARNING, "No DAHDI channel available for conference, conference recording disabled (is chan_dahdi loaded?)\n");
@@ -4168,12 +4178,47 @@
 										 */
 										ast_copy_string(confno, confno_tmp, sizeof(confno));
 										break;
-										/* XXX the map is not complete (but we do have a confno) */
 									}
 								}
 							}
 						}
 						var = var->next;
+					}
+					ast_config_destroy(cfg);
+				}
+
+				if (ast_strlen_zero(confno) && (cfg = ast_load_realtime_multientry("meetme", "confno LIKE", "%", SENTINEL))) {
+					const char *catg;
+					for (catg = ast_category_browse(cfg, NULL); catg; catg = ast_category_browse(cfg, catg)) {
+						const char *confno_tmp = ast_variable_retrieve(cfg, catg, "confno");
+						const char *pin_tmp = ast_variable_retrieve(cfg, catg, "pin");
+						if (ast_strlen_zero(confno_tmp)) {
+							continue;
+						}
+						if (!dynamic) {
+							int found = 0;
+							/* For static:  run through the list and see if this conference is empty */
+							AST_LIST_LOCK(&confs);
+							AST_LIST_TRAVERSE(&confs, cnf, list) {
+								if (!strcmp(confno_tmp, cnf->confno)) {
+									/* The conference exists, therefore it's not empty */
+									found = 1;
+									break;
+								}
+							}
+							AST_LIST_UNLOCK(&confs);
+							if (!found) {
+								/* At this point, we have a confno_tmp (realtime conference) that is empty */
+								if ((empty_no_pin && ast_strlen_zero(pin_tmp)) || (!empty_no_pin)) {
+									/* Case 1:  empty_no_pin and pin is nonexistent (NULL)
+									 * Case 2:  empty_no_pin and pin is blank (but not NULL)
+									 * Case 3:  not empty_no_pin
+									 */
+									ast_copy_string(confno, confno_tmp, sizeof(confno));
+									break;
+								}
+							}
+						}
 					}
 					ast_config_destroy(cfg);
 				}
@@ -4230,7 +4275,7 @@
 				int too_early = 0;
 
 				cnf = find_conf_realtime(chan, confno, 1, dynamic, 
-					the_pin, sizeof(the_pin), 1, &confflags,&too_early);
+					the_pin, sizeof(the_pin), 1, &confflags, &too_early, optargs);
 				if (rt_schedule && too_early)
 					allowretry = 0;
 			}

Modified: team/mmichelson/udptl-v6/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/udptl-v6/channels/chan_sip.c?view=diff&rev=278500&r1=278499&r2=278500
==============================================================================
--- team/mmichelson/udptl-v6/channels/chan_sip.c (original)
+++ team/mmichelson/udptl-v6/channels/chan_sip.c Wed Jul 21 11:31:53 2010
@@ -8259,9 +8259,9 @@
 	/* Setup image address and port */
 	if (p->udptl) {
 		if (udptlportno > 0) {
+			ast_sockaddr_set_port(isa, udptlportno);
 			if (ast_test_flag(&p->flags[1], SIP_PAGE2_SYMMETRICRTP) && ast_test_flag(&p->flags[1], SIP_PAGE2_UDPTL_DESTINATION)) {
-				ast_rtp_instance_get_remote_address(p->rtp,
-								    isa);
+				ast_rtp_instance_get_remote_address(p->rtp, isa);
 				if (!ast_sockaddr_isnull(isa)) {
 					if (debug) {
 						ast_log(LOG_DEBUG, "Peer T.38 UDPTL is set behind NAT and with destination, destination address now %s\n", ast_sockaddr_stringify(isa));

Modified: team/mmichelson/udptl-v6/res/res_fax_spandsp.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/udptl-v6/res/res_fax_spandsp.c?view=diff&rev=278500&r1=278499&r2=278500
==============================================================================
--- team/mmichelson/udptl-v6/res/res_fax_spandsp.c (original)
+++ team/mmichelson/udptl-v6/res/res_fax_spandsp.c Wed Jul 21 11:31:53 2010
@@ -675,9 +675,9 @@
 		ast_cli(fd, "%-22s : %d\n", "Data Rate", stats.bit_rate);
 		ast_cli(fd, "%-22s : %dx%d\n", "Image Resolution", stats.x_resolution, stats.y_resolution);
 #if SPANDSP_RELEASE_DATE >= 20090220
-		ast_cli(fd, "%-22s : %d\n", "Page Number", (s->details->caps & AST_FAX_TECH_RECEIVE) ? stats.pages_rx : stats.pages_tx);
+		ast_cli(fd, "%-22s : %d\n", "Page Number", ((s->details->caps & AST_FAX_TECH_RECEIVE) ? stats.pages_rx : stats.pages_tx) + 1);
 #else
-		ast_cli(fd, "%-22s : %d\n", "Page Number", stats.pages_transferred);
+		ast_cli(fd, "%-22s : %d\n", "Page Number", stats.pages_transferred + 1);
 #endif
 		ast_cli(fd, "%-22s : %s\n", "File Name", s->details->caps & AST_FAX_TECH_RECEIVE ? p->t30_state->rx_file : p->t30_state->tx_file);
 

Modified: team/mmichelson/udptl-v6/res/res_timing_pthread.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/udptl-v6/res/res_timing_pthread.c?view=diff&rev=278500&r1=278499&r2=278500
==============================================================================
--- team/mmichelson/udptl-v6/res/res_timing_pthread.c (original)
+++ team/mmichelson/udptl-v6/res/res_timing_pthread.c Wed Jul 21 11:31:53 2010
@@ -36,6 +36,7 @@
 #include "asterisk/astobj2.h"
 #include "asterisk/time.h"
 #include "asterisk/lock.h"
+#include "asterisk/poll-compat.h"
 
 static void *timing_funcs_handle;
 
@@ -376,16 +377,12 @@
 	do {
 		unsigned char buf[1024];
 		ssize_t res;
-		fd_set rfds;
-		struct timeval timeout = {
-			.tv_sec = 0,
+		struct pollfd pfd = {
+			.fd = rd_fd,
+			.events = POLLIN,
 		};
 
-		/* Make sure there is data to read */
-		FD_ZERO(&rfds);
-		FD_SET(rd_fd, &rfds);
-
-		if (select(rd_fd + 1, &rfds, NULL, NULL, &timeout) != 1) {
+		if (ast_poll(&pfd, 1, 0) != 1) {
 			ast_debug(1, "Reading not available on timing pipe, "
 					"quantity: %u\n", quantity);
 			break;




More information about the svn-commits mailing list