[svn-commits] oej: branch oej/bring-in-the-early-media-1.4 r334748 - in /team/oej/bring-in-...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Sep 7 10:16:12 CDT 2011


Author: oej
Date: Wed Sep  7 10:16:08 2011
New Revision: 334748

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=334748
Log:
Reset, fix, Be happy.

Modified:
    team/oej/bring-in-the-early-media-1.4/   (props changed)
    team/oej/bring-in-the-early-media-1.4/agi/   (props changed)
    team/oej/bring-in-the-early-media-1.4/apps/   (props changed)
    team/oej/bring-in-the-early-media-1.4/cdr/   (props changed)
    team/oej/bring-in-the-early-media-1.4/channels/   (props changed)
    team/oej/bring-in-the-early-media-1.4/channels/chan_iax2.c
    team/oej/bring-in-the-early-media-1.4/channels/chan_sip.c
    team/oej/bring-in-the-early-media-1.4/codecs/   (props changed)
    team/oej/bring-in-the-early-media-1.4/codecs/gsm/src/   (props changed)
    team/oej/bring-in-the-early-media-1.4/codecs/lpc10/   (props changed)
    team/oej/bring-in-the-early-media-1.4/contrib/realtime/mysql/iaxfriends.sql   (props changed)
    team/oej/bring-in-the-early-media-1.4/contrib/realtime/mysql/meetme.sql   (props changed)
    team/oej/bring-in-the-early-media-1.4/contrib/realtime/mysql/sipfriends.sql   (props changed)
    team/oej/bring-in-the-early-media-1.4/contrib/realtime/mysql/voicemail.sql   (props changed)
    team/oej/bring-in-the-early-media-1.4/contrib/realtime/postgresql/realtime.sql   (props changed)
    team/oej/bring-in-the-early-media-1.4/formats/   (props changed)
    team/oej/bring-in-the-early-media-1.4/funcs/   (props changed)
    team/oej/bring-in-the-early-media-1.4/main/   (props changed)
    team/oej/bring-in-the-early-media-1.4/main/db1-ast/btree/   (props changed)
    team/oej/bring-in-the-early-media-1.4/main/db1-ast/db/   (props changed)
    team/oej/bring-in-the-early-media-1.4/main/db1-ast/hash/   (props changed)
    team/oej/bring-in-the-early-media-1.4/main/db1-ast/mpool/   (props changed)
    team/oej/bring-in-the-early-media-1.4/main/db1-ast/recno/   (props changed)
    team/oej/bring-in-the-early-media-1.4/main/manager.c
    team/oej/bring-in-the-early-media-1.4/main/stdtime/   (props changed)
    team/oej/bring-in-the-early-media-1.4/pbx/   (props changed)
    team/oej/bring-in-the-early-media-1.4/pbx/ael/   (props changed)
    team/oej/bring-in-the-early-media-1.4/res/   (props changed)
    team/oej/bring-in-the-early-media-1.4/res/res_features.c
    team/oej/bring-in-the-early-media-1.4/utils/   (props changed)

Propchange: team/oej/bring-in-the-early-media-1.4/
------------------------------------------------------------------------------
    automerge = Is-there-life-off-net?

Propchange: team/oej/bring-in-the-early-media-1.4/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  7 10:16:08 2011
@@ -1,1 +1,2 @@
+/branches/1.4:322646-327251
 /trunk:228798

Propchange: team/oej/bring-in-the-early-media-1.4/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Sep  7 10:16:08 2011
@@ -1,1 +1,1 @@
-/branches/1.4:1-320407
+/branches/1.4:1-334745

Propchange: team/oej/bring-in-the-early-media-1.4/agi/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 eagi-test
 eagi-sphinx-test
 *.d

Propchange: team/oej/bring-in-the-early-media-1.4/apps/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 *.a
 *.d
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/cdr/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 *.a
 *.d
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/channels/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 *.a
 *.d
 *.i

Modified: team/oej/bring-in-the-early-media-1.4/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/bring-in-the-early-media-1.4/channels/chan_iax2.c?view=diff&rev=334748&r1=334747&r2=334748
==============================================================================
--- team/oej/bring-in-the-early-media-1.4/channels/chan_iax2.c (original)
+++ team/oej/bring-in-the-early-media-1.4/channels/chan_iax2.c Wed Sep  7 10:16:08 2011
@@ -4652,7 +4652,14 @@
 		/* these two cannot be sent, because they require a result */
 		errno = ENOSYS;
 		return -1;
-	default:
+ 	/* These options are sent to the other side across the network where
+ 	 * they will be passed to whatever channel is bridged there. Don't
+ 	 * do anything silly like pass an option that transmits pointers to
+ 	 * memory on this machine to a remote machine to use */
+ 	case AST_OPTION_TONE_VERIFY:
+ 	case AST_OPTION_TDD:
+ 	case AST_OPTION_RELAXDTMF:
+ 	case AST_OPTION_AUDIO_MODE:
 	{
 		unsigned short callno = PTR_TO_CALLNO(c->tech_pvt);
 		struct chan_iax2_pvt *pvt;
@@ -4680,7 +4687,12 @@
 		free(h);
 		return res;
 	}
-	}
+	default:
+		return -1;
+	}
+
+	/* Just in case someone does a break instead of a return */
+	return -1;
 }
 
 static struct ast_frame *iax2_read(struct ast_channel *c) 

Modified: team/oej/bring-in-the-early-media-1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/bring-in-the-early-media-1.4/channels/chan_sip.c?view=diff&rev=334748&r1=334747&r2=334748
==============================================================================
--- team/oej/bring-in-the-early-media-1.4/channels/chan_sip.c (original)
+++ team/oej/bring-in-the-early-media-1.4/channels/chan_sip.c Wed Sep  7 10:16:08 2011
@@ -4066,7 +4066,11 @@
 				break;
 			}
 			ast_mutex_lock(&p->lock);
-			if (p->rtp) {
+			if (p->t38.state == T38_ENABLED && !p->t38.direct) {
+				/* drop frame, can't sent VOICE frames while in T.38 mode */
+				ast_mutex_unlock(&p->lock);
+				break;
+			} else if (p->rtp) {
 				/* If channel is not up, activate early media session */
 				if ((ast->_state != AST_STATE_UP) &&
 				    !ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) &&
@@ -4077,7 +4081,7 @@
 						transmit_provisional_response(p, "183 Session Progress", &p->initreq, 1);
 						ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);
 					}
-				} 
+				}
 				p->lastrtptx = time(NULL);
 				res = ast_rtp_write(p->rtp, frame);
 			}
@@ -9793,14 +9797,14 @@
 	if (ast_test_flag(req, SIP_PKT_IGNORE) && !ast_strlen_zero(p->randdata) && ast_strlen_zero(authtoken)) {
 		/* This is a retransmitted invite/register/etc, don't reconstruct authentication
 		 * information */
-		transmit_response_with_auth(p, response, req, p->randdata, 0, respheader, 0);
+		transmit_response_with_auth(p, response, req, p->randdata, reliable, respheader, 0);
 		/* Schedule auto destroy in 32 seconds (according to RFC 3261) */
 		sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 		return;
 	} else if (ast_strlen_zero(p->randdata) || ast_strlen_zero(authtoken)) {
 		/* We have no auth, so issue challenge and request authentication */
 		set_nonce_randdata(p, 1);
-		transmit_response_with_auth(p, response, req, p->randdata, 0, respheader, 0);
+		transmit_response_with_auth(p, response, req, p->randdata, reliable, respheader, 0);
 		/* Schedule auto destroy in 32 seconds */
 		sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 		return;

Propchange: team/oej/bring-in-the-early-media-1.4/codecs/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 *.a
 *.d
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/codecs/gsm/src/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,1 +1,2 @@
+*.o
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/codecs/lpc10/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 *.d
 *.a
 *.s

Propchange: team/oej/bring-in-the-early-media-1.4/contrib/realtime/mysql/iaxfriends.sql
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  7 10:16:08 2011
@@ -1,0 +1,1 @@
+/branches/1.4/contrib/realtime/mysql/iaxfriends.sql:322646-327251

Propchange: team/oej/bring-in-the-early-media-1.4/contrib/realtime/mysql/meetme.sql
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  7 10:16:08 2011
@@ -1,0 +1,1 @@
+/branches/1.4/contrib/realtime/mysql/meetme.sql:322646-327251

Propchange: team/oej/bring-in-the-early-media-1.4/contrib/realtime/mysql/sipfriends.sql
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  7 10:16:08 2011
@@ -1,0 +1,1 @@
+/branches/1.4/contrib/realtime/mysql/sipfriends.sql:322646-327251

Propchange: team/oej/bring-in-the-early-media-1.4/contrib/realtime/mysql/voicemail.sql
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  7 10:16:08 2011
@@ -1,0 +1,1 @@
+/branches/1.4/contrib/realtime/mysql/voicemail.sql:322646-327251

Propchange: team/oej/bring-in-the-early-media-1.4/contrib/realtime/postgresql/realtime.sql
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  7 10:16:08 2011
@@ -1,0 +1,1 @@
+/branches/1.4/contrib/realtime/postgresql/realtime.sql:322646-327251

Propchange: team/oej/bring-in-the-early-media-1.4/formats/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 *.a
 *.d
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/funcs/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 *.a
 *.d
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/main/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,5 +1,5 @@
+*.o
 asterisk
 *.d
 *.s
 *.i
-

Propchange: team/oej/bring-in-the-early-media-1.4/main/db1-ast/btree/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,1 +1,2 @@
+*.o
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/main/db1-ast/db/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,1 +1,2 @@
+*.o
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/main/db1-ast/hash/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,1 +1,2 @@
+*.o
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/main/db1-ast/mpool/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,1 +1,2 @@
+*.o
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/main/db1-ast/recno/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,1 +1,2 @@
+*.o
 *.i

Modified: team/oej/bring-in-the-early-media-1.4/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/bring-in-the-early-media-1.4/main/manager.c?view=diff&rev=334748&r1=334747&r2=334748
==============================================================================
--- team/oej/bring-in-the-early-media-1.4/main/manager.c (original)
+++ team/oej/bring-in-the-early-media-1.4/main/manager.c Wed Sep  7 10:16:08 2011
@@ -2895,6 +2895,7 @@
 	char *c = workspace;
 	char *retval = NULL;
 	struct ast_variable *v;
+	char template[] = "/tmp/ast-http-XXXXXX";
 
 	for (v = params; v; v = v->next) {
 		if (!strcasecmp(v->name, "mansession_id")) {
@@ -2942,8 +2943,9 @@
 	ss.session = s;
 	ast_mutex_unlock(&s->__lock);
 
-	ss.f = tmpfile();
-	ss.fd = fileno(ss.f);
+	if ((ss.fd = mkstemp(template)) > -1) {
+		unlink(template);
+	}
 
 	if (s) {
 		struct message m = { 0 };
@@ -2989,13 +2991,21 @@
 		if (ss.fd > -1) {
 			char *buf;
 			size_t l;
-
-			if ((l = lseek(ss.fd, 0, SEEK_END)) > 0) {
-				if (MAP_FAILED == (buf = mmap(NULL, l + 1, PROT_READ | PROT_WRITE, MAP_SHARED, ss.fd, 0))) {
+			ssize_t res;
+
+			/* Make sure that our buffer is NULL terminated */
+			while ((res = write(ss.fd, "", 1)) < 1) {
+				if (res == -1) {
+					ast_log(LOG_ERROR, "Failed to terminate manager response output: %s\n", strerror(errno));
+					break;
+				}
+			}
+
+			if (res == 1 && (l = lseek(ss.fd, 0, SEEK_END)) > 0) {
+				if (MAP_FAILED == (buf = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_SHARED, ss.fd, 0))) {
 					ast_log(LOG_WARNING, "mmap failed.  Manager request output was not processed\n");
 				} else {
 					char *tmpbuf;
-					buf[l] = '\0';
 					if (format == FORMAT_XML)
 						tmpbuf = xml_translate(buf, params);
 					else if (format == FORMAT_HTML)
@@ -3016,11 +3026,10 @@
 						free(tmpbuf);
 					free(s->outputstr);
 					s->outputstr = NULL;
-					munmap(buf, l + 1);
+					munmap(buf, l);
 				}
 			}
-			fclose(ss.f);
-			ss.f = NULL;
+			close(ss.fd);
 			ss.fd = -1;
 		} else if (s->outputstr) {
 			char *tmp;

Propchange: team/oej/bring-in-the-early-media-1.4/main/stdtime/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 .depend
 *.a
 *.so

Propchange: team/oej/bring-in-the-early-media-1.4/pbx/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 *.a
 *.d
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/pbx/ael/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,2 +1,3 @@
+*.o
 ael.output
 *.i

Propchange: team/oej/bring-in-the-early-media-1.4/res/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 *.a
 *.d
 *.i

Modified: team/oej/bring-in-the-early-media-1.4/res/res_features.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/bring-in-the-early-media-1.4/res/res_features.c?view=diff&rev=334748&r1=334747&r2=334748
==============================================================================
--- team/oej/bring-in-the-early-media-1.4/res/res_features.c (original)
+++ team/oej/bring-in-the-early-media-1.4/res/res_features.c Wed Sep  7 10:16:08 2011
@@ -1653,8 +1653,12 @@
 
 /*! \brief Check if a feature exists */
 static int feature_check(struct ast_channel *chan, struct ast_flags *features, char *code) {
-
-	return feature_interpret_helper(chan, NULL, NULL, code, 0, NULL, features, FEATURE_INTERPRET_CHECK, NULL);
+	char *chan_dynamic_features;
+	ast_channel_lock(chan);
+	chan_dynamic_features = ast_strdupa(S_OR(pbx_builtin_getvar_helper(chan, "DYNAMIC_FEATURES"),""));
+	ast_channel_unlock(chan);
+
+	return feature_interpret_helper(chan, NULL, NULL, code, 0, chan_dynamic_features, features, FEATURE_INTERPRET_CHECK, NULL);
 }
 
 static void set_config_flags(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config)
@@ -2377,10 +2381,19 @@
 				break;
 			case AST_CONTROL_OPTION:
 				aoh = f->data;
-				/* Forward option Requests */
+ 				/* Forward option Requests, but only ones we know are safe
+ 				 * These are ONLY sent by chan_iax2 and I'm not convinced that
+ 				 * they are useful. I haven't deleted them entirely because I
+ 				 * just am not sure of the ramifications of removing them. */
 				if (aoh && aoh->flag == AST_OPTION_FLAG_REQUEST) {
-					ast_channel_setoption(other, ntohs(aoh->option), aoh->data, 
-						f->datalen - sizeof(struct ast_option_header), 0);
+ 				   	switch (ntohs(aoh->option)) {
+ 					case AST_OPTION_TONE_VERIFY:
+ 					case AST_OPTION_TDD:
+ 					case AST_OPTION_RELAXDTMF:
+ 					case AST_OPTION_AUDIO_MODE:
+						ast_channel_setoption(other, ntohs(aoh->option), aoh->data, 
+							f->datalen - sizeof(struct ast_option_header), 0);
+					}
 				}
 				break;
 			}

Propchange: team/oej/bring-in-the-early-media-1.4/utils/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Sep  7 10:16:08 2011
@@ -1,3 +1,4 @@
+*.o
 *.d
 *.s
 *.i




More information about the svn-commits mailing list