[svn-commits] oej: branch oej/roibos-cng-support-1.8 r373294 - in /team/oej/roibos-cng-supp...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Sep 21 08:17:48 CDT 2012


Author: oej
Date: Fri Sep 21 08:17:39 2012
New Revision: 373294

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=373294
Log:
Updating to latest stuff

Modified:
    team/oej/roibos-cng-support-1.8/   (props changed)
    team/oej/roibos-cng-support-1.8/apps/app_meetme.c
    team/oej/roibos-cng-support-1.8/apps/app_queue.c
    team/oej/roibos-cng-support-1.8/apps/app_voicemail.c
    team/oej/roibos-cng-support-1.8/channels/chan_iax2.c
    team/oej/roibos-cng-support-1.8/channels/chan_local.c
    team/oej/roibos-cng-support-1.8/channels/chan_sip.c
    team/oej/roibos-cng-support-1.8/channels/sig_ss7.c
    team/oej/roibos-cng-support-1.8/channels/sip/sdp_crypto.c
    team/oej/roibos-cng-support-1.8/funcs/func_math.c
    team/oej/roibos-cng-support-1.8/include/asterisk/astobj2.h
    team/oej/roibos-cng-support-1.8/include/asterisk/channel.h
    team/oej/roibos-cng-support-1.8/main/Makefile
    team/oej/roibos-cng-support-1.8/main/astmm.c
    team/oej/roibos-cng-support-1.8/main/astobj2.c
    team/oej/roibos-cng-support-1.8/main/channel.c
    team/oej/roibos-cng-support-1.8/main/features.c
    team/oej/roibos-cng-support-1.8/main/manager.c
    team/oej/roibos-cng-support-1.8/main/ssl.c
    team/oej/roibos-cng-support-1.8/main/tcptls.c
    team/oej/roibos-cng-support-1.8/res/res_rtp_asterisk.c

Propchange: team/oej/roibos-cng-support-1.8/
------------------------------------------------------------------------------
    automerge = Is-there-life-off-net?

Propchange: team/oej/roibos-cng-support-1.8/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Sep 21 08:17:39 2012
@@ -1,1 +1,1 @@
-/branches/1.8:1-372607
+/branches/1.8:1-373293

Modified: team/oej/roibos-cng-support-1.8/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/apps/app_meetme.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/apps/app_meetme.c (original)
+++ team/oej/roibos-cng-support-1.8/apps/app_meetme.c Fri Sep 21 08:17:39 2012
@@ -142,7 +142,8 @@
 					</option>
 					<option name="p" hasparams="optional">
 						<para>Allow user to exit the conference by pressing <literal>#</literal> (default)
-						or any of the defined keys.  The key used is set to channel variable
+						or any of the defined keys. Dial plan execution will continue at the next
+						priority following MeetMe. The key used is set to channel variable
 						<variable>MEETME_EXIT_KEY</variable>.</para>
 						<argument name="keys" required="true" />
 						<note>
@@ -4241,6 +4242,7 @@
 									}
 								}
 								AST_LIST_UNLOCK(&confs);
+								cnf = NULL;
 								if (!found) {
 									/* At this point, we have a confno_tmp (static conference) that is empty */
 									if ((empty_no_pin && ast_strlen_zero(stringp)) || (!empty_no_pin)) {

Modified: team/oej/roibos-cng-support-1.8/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/apps/app_queue.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/apps/app_queue.c (original)
+++ team/oej/roibos-cng-support-1.8/apps/app_queue.c Fri Sep 21 08:17:39 2012
@@ -4543,7 +4543,7 @@
 				callattempt_free(tmp);
 				ao2_ref(cur, -1);
 				ao2_iterator_destroy(&memi);
-				ao2_unlock(&qe->parent);
+				ao2_unlock(qe->parent);
 				goto out;
 			}
 			datastore->data = dialed_interfaces;

Modified: team/oej/roibos-cng-support-1.8/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/apps/app_voicemail.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/apps/app_voicemail.c (original)
+++ team/oej/roibos-cng-support-1.8/apps/app_voicemail.c Fri Sep 21 08:17:39 2012
@@ -648,7 +648,6 @@
 	char *emailbody;                 /*!< E-mail body */
 	char pager[80];                  /*!< E-mail address to pager (no attachment) */
 	char serveremail[80];            /*!< From: Mail address */
-	char mailcmd[160];               /*!< Configurable mail command */
 	char language[MAX_LANGUAGE];     /*!< Config: Language setting */
 	char zonetag[80];                /*!< Time zone */
 	char locale[20];                 /*!< The locale (for presentation of date/time) */
@@ -11327,7 +11326,6 @@
 		USER(ast_vm_user, emailbody, AST_DATA_STRING)			\
 		USER(ast_vm_user, pager, AST_DATA_STRING)			\
 		USER(ast_vm_user, serveremail, AST_DATA_STRING)			\
-		USER(ast_vm_user, mailcmd, AST_DATA_STRING)			\
 		USER(ast_vm_user, language, AST_DATA_STRING)			\
 		USER(ast_vm_user, zonetag, AST_DATA_STRING)			\
 		USER(ast_vm_user, callback, AST_DATA_STRING)			\
@@ -11355,7 +11353,6 @@
 		USER(ast_vm_user, emailbody, AST_DATA_STRING)			\
 		USER(ast_vm_user, pager, AST_DATA_STRING)			\
 		USER(ast_vm_user, serveremail, AST_DATA_STRING)			\
-		USER(ast_vm_user, mailcmd, AST_DATA_STRING)			\
 		USER(ast_vm_user, language, AST_DATA_STRING)			\
 		USER(ast_vm_user, zonetag, AST_DATA_STRING)			\
 		USER(ast_vm_user, callback, AST_DATA_STRING)			\
@@ -11731,8 +11728,8 @@
 			vmu->fullname,
 			vmu->email,
 			vmu->pager,
-			vmu->serveremail,
-			vmu->mailcmd,
+			ast_strlen_zero(vmu->serveremail) ? serveremail : vmu->serveremail,
+			mailcmd,
 			vmu->language,
 			vmu->zonetag,
 			vmu->callback,

Modified: team/oej/roibos-cng-support-1.8/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/channels/chan_iax2.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/channels/chan_iax2.c (original)
+++ team/oej/roibos-cng-support-1.8/channels/chan_iax2.c Fri Sep 21 08:17:39 2012
@@ -3346,12 +3346,10 @@
 		ast_debug(3, "Sending %d on %d/%d to %s:%d\n", f->ts, callno, iaxs[callno]->peercallno, ast_inet_ntoa(iaxs[callno]->addr.sin_addr), ntohs(iaxs[callno]->addr.sin_port));
 	
 	if (f->transfer) {
-		if (iaxdebug)
-			iax_showframe(f, NULL, 0, &iaxs[callno]->transfer, f->datalen - sizeof(struct ast_iax2_full_hdr));
+		iax_outputframe(f, NULL, 0, &iaxs[callno]->transfer, f->datalen - sizeof(struct ast_iax2_full_hdr));
 		res = sendto(iaxs[callno]->sockfd, f->data, f->datalen, 0,(struct sockaddr *)&iaxs[callno]->transfer, sizeof(iaxs[callno]->transfer));
 	} else {
-		if (iaxdebug)
-			iax_showframe(f, NULL, 0, &iaxs[callno]->addr, f->datalen - sizeof(struct ast_iax2_full_hdr));
+		iax_outputframe(f, NULL, 0, &iaxs[callno]->addr, f->datalen - sizeof(struct ast_iax2_full_hdr));
 		res = sendto(iaxs[callno]->sockfd, f->data, f->datalen, 0,(struct sockaddr *)&iaxs[callno]->addr, sizeof(iaxs[callno]->addr));
 	}
 	if (res < 0) {
@@ -4738,9 +4736,7 @@
 	data.f.type = AST_FRAME_IAX;
 	data.f.csub = compress_subclass(command);
 
-	if (iaxdebug) {
-		iax_outputframe(NULL, &data.f, 0, sin, size - sizeof(struct ast_iax2_full_hdr));
-	}
+	iax_outputframe(NULL, &data.f, 0, sin, size - sizeof(struct ast_iax2_full_hdr));
 
 	return sendto(sockfd, &data, size, 0, (struct sockaddr *)sin, sizeof(*sin));
 }

Modified: team/oej/roibos-cng-support-1.8/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/channels/chan_local.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/channels/chan_local.c (original)
+++ team/oej/roibos-cng-support-1.8/channels/chan_local.c Fri Sep 21 08:17:39 2012
@@ -83,6 +83,8 @@
 static const int BUCKET_SIZE = 1;
 
 static struct ao2_container *locals;
+
+static unsigned int name_sequence = 0;
 
 static struct ast_jb_conf g_jb_conf = {
 	.flags = 0,
@@ -1150,7 +1152,8 @@
 static struct ast_channel *local_new(struct local_pvt *p, int state, const char *linkedid)
 {
 	struct ast_channel *tmp = NULL, *tmp2 = NULL;
-	int randnum = ast_random() & 0xffff, fmt = 0;
+	int fmt = 0;
+	int generated_seqno = ast_atomic_fetchadd_int((int *)&name_sequence, +1);
 	const char *t;
 	int ama;
 
@@ -1168,8 +1171,8 @@
 
 	/* Make sure that the ;2 channel gets the same linkedid as ;1. You can't pass linkedid to both
 	 * allocations since if linkedid isn't set, then each channel will generate its own linkedid. */
-	if (!(tmp = ast_channel_alloc(1, state, 0, 0, t, p->exten, p->context, linkedid, ama, "Local/%s@%s-%04x;1", p->exten, p->context, randnum)) 
-		|| !(tmp2 = ast_channel_alloc(1, AST_STATE_RING, 0, 0, t, p->exten, p->context, tmp->linkedid, ama, "Local/%s@%s-%04x;2", p->exten, p->context, randnum))) {
+	if (!(tmp = ast_channel_alloc(1, state, 0, 0, t, p->exten, p->context, linkedid, ama, "Local/%s@%s-%08x;1", p->exten, p->context, generated_seqno))
+		|| !(tmp2 = ast_channel_alloc(1, AST_STATE_RING, 0, 0, t, p->exten, p->context, tmp->linkedid, ama, "Local/%s@%s-%08x;2", p->exten, p->context, generated_seqno))) {
 		if (tmp) {
 			tmp = ast_channel_release(tmp);
 		}

Modified: team/oej/roibos-cng-support-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/channels/chan_sip.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/channels/chan_sip.c (original)
+++ team/oej/roibos-cng-support-1.8/channels/chan_sip.c Fri Sep 21 08:17:39 2012
@@ -2357,6 +2357,8 @@
 		ast_free(args->tls_cfg->cipher);
 		ast_free(args->tls_cfg->cafile);
 		ast_free(args->tls_cfg->capath);
+
+		ast_ssl_teardown(args->tls_cfg);
 	}
 	ast_free(args->tls_cfg);
 	ast_free((char *) args->name);
@@ -3922,7 +3924,7 @@
 	 */
 	owner = sip_pvt_lock_full(p);
 	if (owner) {
-		ast_log(LOG_WARNING, "Autodestruct on dialog '%s' with owner in place (Method: %s). Rescheduling destruction for 10000 ms\n", p->callid, sip_methods[p->method].text);
+		ast_log(LOG_WARNING, "Autodestruct on dialog '%s' with owner %s in place (Method: %s). Rescheduling destruction for 10000 ms\n", p->callid, owner->name, sip_methods[p->method].text);
 		ast_queue_hangup_with_cause(owner, AST_CAUSE_PROTOCOL_ERROR);
 		ast_channel_unlock(owner);
 		ast_channel_unref(owner);
@@ -9141,6 +9143,7 @@
 				}
 
 				if (initialize_udptl(p)) {
+					ast_log(LOG_WARNING, "Rejecting offer with image stream due to UDPTL initialization failure\n");
 					return -1;
 				}
 
@@ -29253,7 +29256,8 @@
 
 	if (!(opp_chan = ast_bridged_channel(chan))) {
 		return NULL;
-	} else if ((opp_chan->tech != &sip_tech) || (!(opp = opp_chan->tech_pvt))) {
+	} else if (((opp_chan->tech != &sip_tech) && (opp_chan->tech != &sip_tech_info)) ||
+		   (!(opp = opp_chan->tech_pvt))) {
 		return NULL;
 	}
 

Modified: team/oej/roibos-cng-support-1.8/channels/sig_ss7.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/channels/sig_ss7.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/channels/sig_ss7.c (original)
+++ team/oej/roibos-cng-support-1.8/channels/sig_ss7.c Fri Sep 21 08:17:39 2012
@@ -528,6 +528,7 @@
 		p->call_level = SIG_SS7_CALL_LEVEL_SETUP;
 	}
 
+	/* Companding law is determined by SS7 signaling type. */
 	if (linkset->type == SS7_ITU) {
 		law = SIG_SS7_ALAW;
 	} else {
@@ -1778,6 +1779,13 @@
 {
 	struct ast_channel *ast;
 
+	/* Companding law is determined by SS7 signaling type. */
+	if (p->ss7->type == SS7_ITU) {
+		law = SIG_SS7_ALAW;
+	} else {
+		law = SIG_SS7_ULAW;
+	}
+
 	sig_ss7_set_outgoing(p, 1);
 	ast = sig_ss7_new_ast_channel(p, AST_STATE_RESERVED, law, transfercapability, p->exten, requestor);
 	if (!ast) {

Modified: team/oej/roibos-cng-support-1.8/channels/sip/sdp_crypto.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/channels/sip/sdp_crypto.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/channels/sip/sdp_crypto.c (original)
+++ team/oej/roibos-cng-support-1.8/channels/sip/sdp_crypto.c Fri Sep 21 08:17:39 2012
@@ -49,6 +49,8 @@
 	char *a_crypto;
 	unsigned char local_key[SRTP_MASTER_LEN];
 	char local_key64[SRTP_MASTER_LEN64];
+	unsigned char remote_key[SRTP_MASTER_LEN];
+	char suite[64];
 };
 
 static int set_crypto_policy(struct ast_srtp_policy *policy, int suite_val, const unsigned char *master_key, unsigned long ssrc, int inbound);
@@ -257,11 +259,19 @@
 		return -1;
 	}
 
-
 	if ((key_len = ast_base64decode(remote_key, key_salt, sizeof(remote_key))) != SRTP_MASTER_LEN) {
-		ast_log(LOG_WARNING, "SRTP sdescriptions key %d != %d\n", key_len, SRTP_MASTER_LEN);
-		return -1;
-	}
+		ast_log(LOG_WARNING, "SRTP descriptions key %d != %d\n", key_len, SRTP_MASTER_LEN);
+		return -1;
+	}
+
+	if (!memcmp(p->remote_key, remote_key, sizeof(p->remote_key))) {
+		ast_debug(1, "SRTP remote key unchanged; maintaining current policy\n");
+		return 0;
+	}
+
+	/* Set the accepted policy and remote key */
+	ast_copy_string(p->suite, suite, sizeof(p->suite));
+	memcpy(p->remote_key, remote_key, sizeof(p->remote_key));
 
 	if (sdp_crypto_activate(p, suite_val, remote_key, rtp) < 0) {
 		return -1;
@@ -280,13 +290,17 @@
 int sdp_crypto_offer(struct sdp_crypto *p)
 {
 	char crypto_buf[128];
-	const char *crypto_suite = "AES_CM_128_HMAC_SHA1_80"; /* Crypto offer */
+
+	if (ast_strlen_zero(p->suite)) {
+		/* Default crypto offer */
+		strcpy(p->suite, "AES_CM_128_HMAC_SHA1_80");
+	}
 
 	if (p->a_crypto) {
 		ast_free(p->a_crypto);
 	}
 
-	if (snprintf(crypto_buf, sizeof(crypto_buf), "a=crypto:1 %s inline:%s\r\n",  crypto_suite, p->local_key64) < 1) {
+	if (snprintf(crypto_buf, sizeof(crypto_buf), "a=crypto:1 %s inline:%s\r\n",  p->suite, p->local_key64) < 1) {
 		return -1;
 	}
 

Modified: team/oej/roibos-cng-support-1.8/funcs/func_math.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/funcs/func_math.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/funcs/func_math.c (original)
+++ team/oej/roibos-cng-support-1.8/funcs/func_math.c Fri Sep 21 08:17:39 2012
@@ -421,8 +421,6 @@
 		modify_orig = 1;
 	}
 
-	ast_log(LOG_NOTICE, "The value is now: %d\n", int_value);
-
 	if (snprintf(returnvar, sizeof(returnvar), "%d", int_value) > 0) {
 		pbx_builtin_setvar_helper(chan, data, returnvar);
 		if (modify_orig) {

Modified: team/oej/roibos-cng-support-1.8/include/asterisk/astobj2.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/include/asterisk/astobj2.h?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/include/asterisk/astobj2.h (original)
+++ team/oej/roibos-cng-support-1.8/include/asterisk/astobj2.h Fri Sep 21 08:17:39 2012
@@ -462,7 +462,7 @@
 
 #endif
 
-int __ao2_ref_debug(void *o, int delta, char *tag, char *file, int line, const char *funcname);
+int __ao2_ref_debug(void *o, int delta, const char *tag, const char *file, int line, const char *funcname);
 int __ao2_ref(void *o, int delta);
 
 /*! @} */

Modified: team/oej/roibos-cng-support-1.8/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/include/asterisk/channel.h?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/include/asterisk/channel.h (original)
+++ team/oej/roibos-cng-support-1.8/include/asterisk/channel.h Fri Sep 21 08:17:39 2012
@@ -1874,7 +1874,7 @@
 /*!
  * \brief Waits for a digit
  * \param c channel to wait for a digit on
- * \param ms how many milliseconds to wait
+ * \param ms how many milliseconds to wait (<0 for indefinite).
  * \return Returns <0 on error, 0 on no entry, and the digit on success.
  */
 int ast_waitfordigit(struct ast_channel *c, int ms);
@@ -1883,7 +1883,7 @@
  * \brief Wait for a digit
  * Same as ast_waitfordigit() with audio fd for outputting read audio and ctrlfd to monitor for reading.
  * \param c channel to wait for a digit on
- * \param ms how many milliseconds to wait
+ * \param ms how many milliseconds to wait (<0 for indefinite).
  * \param audiofd audio file descriptor to write to if audio frames are received
  * \param ctrlfd control file descriptor to monitor for reading
  * \return Returns 1 if ctrlfd becomes available

Modified: team/oej/roibos-cng-support-1.8/main/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/main/Makefile?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/main/Makefile (original)
+++ team/oej/roibos-cng-support-1.8/main/Makefile Fri Sep 21 08:17:39 2012
@@ -174,6 +174,10 @@
 endif
 
 $(OBJS): _ASTCFLAGS+=-DAST_MODULE=\"core\"
+
+ssl.o: _ASTCFLAGS+=$(OPENSSL_INCLUDE)
+
+tcptls.o: _ASTCFLAGS+=$(OPENSSL_INCLUDE)
 
 $(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS)
 	@$(CC) -c -o buildinfo.o $(_ASTCFLAGS) buildinfo.c $(ASTCFLAGS)

Modified: team/oej/roibos-cng-support-1.8/main/astmm.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/main/astmm.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/main/astmm.c (original)
+++ team/oej/roibos-cng-support-1.8/main/astmm.c Fri Sep 21 08:17:39 2012
@@ -272,16 +272,17 @@
 char *__ast_strndup(const char *s, size_t n, const char *file, int lineno, const char *func) 
 {
 	size_t len;
-	void *ptr;
-
-	if (!s)
-		return NULL;
-
-	len = strlen(s) + 1;
-	if (len > n)
-		len = n;
-	if ((ptr = __ast_alloc_region(len, FUNC_STRNDUP, file, lineno, func, 0)))
-		strcpy(ptr, s);
+	char *ptr;
+
+	if (!s) {
+		return NULL;
+	}
+
+	len = strnlen(s, n);
+	if ((ptr = __ast_alloc_region(len + 1, FUNC_STRNDUP, file, lineno, func, 0))) {
+		memcpy(ptr, s, len);
+		ptr[len] = '\0';
+	}
 
 	return ptr;
 }

Modified: team/oej/roibos-cng-support-1.8/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/main/astobj2.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/main/astobj2.c (original)
+++ team/oej/roibos-cng-support-1.8/main/astobj2.c Fri Sep 21 08:17:39 2012
@@ -207,7 +207,7 @@
  */
 
 
-int __ao2_ref_debug(void *user_data, const int delta, char *tag, char *file, int line, const char *funcname)
+int __ao2_ref_debug(void *user_data, const int delta, const char *tag, const char *file, int line, const char *funcname)
 {
 	struct astobj2 *obj = INTERNAL_OBJ(user_data);
 	

Modified: team/oej/roibos-cng-support-1.8/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/main/channel.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/main/channel.c (original)
+++ team/oej/roibos-cng-support-1.8/main/channel.c Fri Sep 21 08:17:39 2012
@@ -3515,7 +3515,6 @@
 	return ms;
 }
 
-/* XXX never to be called with ms = -1 */
 int ast_waitfordigit(struct ast_channel *c, int ms)
 {
 	return ast_waitfordigit_full(c, ms, -1, -1);
@@ -3564,8 +3563,10 @@
 	return res;
 }
 
-int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
-{
+int ast_waitfordigit_full(struct ast_channel *c, int timeout_ms, int audiofd, int cmdfd)
+{
+	struct timeval start = ast_tvnow();
+
 	/* Stop if we're a zombie or need a soft hangup */
 	if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
 		return -1;
@@ -3573,15 +3574,29 @@
 	/* Only look for the end of DTMF, don't bother with the beginning and don't emulate things */
 	ast_set_flag(c, AST_FLAG_END_DTMF_ONLY);
 
-	/* Wait for a digit, no more than ms milliseconds total. */
-	
-	while (ms) {
+	/* Wait for a digit, no more than timeout_ms milliseconds total.
+	 * Or, wait indefinitely if timeout_ms is <0.
+	 */
+	while (ast_tvdiff_ms(ast_tvnow(), start) < timeout_ms || timeout_ms < 0) {
 		struct ast_channel *rchan;
 		int outfd=-1;
+		int ms;
+
+		if (timeout_ms < 0) {
+			ms = timeout_ms;
+		} else {
+			ms = timeout_ms - ast_tvdiff_ms(ast_tvnow(), start);
+			if (ms < 0) {
+				ms = 0;
+			}
+		}
 
 		errno = 0;
+		/* While ast_waitfor_nandfds tries to help by reducing the timeout by how much was waited,
+		 * it is unhelpful if it waited less than a millisecond.
+		 */
 		rchan = ast_waitfor_nandfds(&c, 1, &cmdfd, (cmdfd > -1) ? 1 : 0, NULL, &outfd, &ms);
-		
+
 		if (!rchan && outfd < 0 && ms) {
 			if (errno == 0 || errno == EINTR)
 				continue;
@@ -6682,6 +6697,10 @@
 
 	/* Keep the same language.  */
 	ast_string_field_set(original, language, clonechan->language);
+
+	/* Keep the same parkinglot. */
+	ast_string_field_set(original, parkinglot, clonechan->parkinglot);
+
 	/* Copy the FD's other than the generator fd */
 	for (x = 0; x < AST_MAX_FDS; x++) {
 		if (x != AST_GENERATOR_FD)

Modified: team/oej/roibos-cng-support-1.8/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/main/features.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/main/features.c (original)
+++ team/oej/roibos-cng-support-1.8/main/features.c Fri Sep 21 08:17:39 2012
@@ -945,6 +945,33 @@
 	struct ast_channel *transferee, const char *type, format_t format, void *data,
 	int timeout, int *outstate, const char *language);
 
+static const struct ast_datastore_info channel_app_data_datastore = {
+	.type = "Channel appdata datastore",
+	.destroy = ast_free_ptr,
+};
+
+static int set_chan_app_data(struct ast_channel *chan, const char *src_app_data)
+{
+	struct ast_datastore *datastore;
+	char *dst_app_data;
+
+	datastore = ast_datastore_alloc(&channel_app_data_datastore, NULL);
+	if (!datastore) {
+		return -1;
+	}
+
+	dst_app_data = ast_malloc(strlen(src_app_data) + 1);
+	if (!dst_app_data) {
+		ast_datastore_free(datastore);
+		return -1;
+	}
+
+	chan->data = strcpy(dst_app_data, src_app_data);
+	datastore->data = dst_app_data;
+	ast_channel_datastore_add(chan, datastore);
+	return 0;
+}
+
 /*!
  * \brief bridge the call 
  * \param data thread bridge.
@@ -958,9 +985,13 @@
 	struct ast_bridge_thread_obj *tobj = data;
 
 	tobj->chan->appl = !tobj->return_to_pbx ? "Transferred Call" : "ManagerBridge";
-	tobj->chan->data = tobj->peer->name;
+	if (set_chan_app_data(tobj->chan, tobj->peer->name)) {
+		tobj->chan->data = "(Empty)";
+	}
 	tobj->peer->appl = !tobj->return_to_pbx ? "Transferred Call" : "ManagerBridge";
-	tobj->peer->data = tobj->chan->name;
+	if (set_chan_app_data(tobj->peer, tobj->chan->name)) {
+		tobj->peer->data = "(Empty)";
+	}
 
 	ast_bridge_call(tobj->peer, tobj->chan, &tobj->bconfig);
 

Modified: team/oej/roibos-cng-support-1.8/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/main/manager.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/main/manager.c (original)
+++ team/oej/roibos-cng-support-1.8/main/manager.c Fri Sep 21 08:17:39 2012
@@ -1790,6 +1790,10 @@
 	int x, l = strlen(var);
 	const char *result = "";
 
+	if (!m) {
+		return result;
+	}
+
 	for (x = 0; x < m->hdrcount; x++) {
 		const char *h = m->headers[x];
 		if (!strncasecmp(var, h, l) && h[l] == ':') {

Modified: team/oej/roibos-cng-support-1.8/main/ssl.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/main/ssl.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/main/ssl.c (original)
+++ team/oej/roibos-cng-support-1.8/main/ssl.c Fri Sep 21 08:17:39 2012
@@ -81,9 +81,7 @@
 
 	SSL_library_init();
 	SSL_load_error_strings();
-	ERR_load_crypto_strings();
 	ERR_load_BIO_strings();
-	OpenSSL_add_all_algorithms();
 
 	/* Make OpenSSL thread-safe. */
 

Modified: team/oej/roibos-cng-support-1.8/main/tcptls.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/main/tcptls.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/main/tcptls.c (original)
+++ team/oej/roibos-cng-support-1.8/main/tcptls.c Fri Sep 21 08:17:39 2012
@@ -82,6 +82,7 @@
 {
 	int cookie_fd = SSL_get_fd(cookie);
 	int ret;
+
 	if (cookie_fd > -1) {
 		/*
 		 * According to the TLS standard, it is acceptable for an application to only send its shutdown
@@ -91,6 +92,12 @@
 		if ((ret = SSL_shutdown(cookie)) < 0) {
 			ast_log(LOG_ERROR, "SSL_shutdown() failed: %d\n", SSL_get_error(cookie, ret));
 		}
+
+		if (!((SSL*)cookie)->server) {
+			/* For client threads, ensure that the error stack is cleared */
+			ERR_remove_state(0);
+		}
+
 		SSL_free(cookie);
 		/* adding shutdown(2) here has no added benefit */
 		if (close(cookie_fd)) {
@@ -313,9 +320,6 @@
 	if (!cfg->enabled)
 		return 0;
 
-	SSL_load_error_strings();
-	SSLeay_add_ssl_algorithms();
-
 	/* Get rid of an old SSL_CTX since we're about to
 	 * allocate a new one
 	 */
@@ -357,7 +361,6 @@
 			if (!client) {
 				/* Clients don't need a certificate, but if its setup we can use it */
 				ast_verb(0, "SSL error loading cert file. <%s>", cfg->certfile);
-				sleep(2);
 				cfg->enabled = 0;
 				SSL_CTX_free(cfg->ssl_ctx);
 				cfg->ssl_ctx = NULL;
@@ -368,7 +371,6 @@
 			if (!client) {
 				/* Clients don't need a private key, but if its setup we can use it */
 				ast_verb(0, "SSL error loading private key file. <%s>", tmpprivate);
-				sleep(2);
 				cfg->enabled = 0;
 				SSL_CTX_free(cfg->ssl_ctx);
 				cfg->ssl_ctx = NULL;
@@ -380,7 +382,6 @@
 		if (SSL_CTX_set_cipher_list(cfg->ssl_ctx, cfg->cipher) == 0 ) {
 			if (!client) {
 				ast_verb(0, "SSL cipher error <%s>", cfg->cipher);
-				sleep(2);
 				cfg->enabled = 0;
 				SSL_CTX_free(cfg->ssl_ctx);
 				cfg->ssl_ctx = NULL;

Modified: team/oej/roibos-cng-support-1.8/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/res/res_rtp_asterisk.c?view=diff&rev=373294&r1=373293&r2=373294
==============================================================================
--- team/oej/roibos-cng-support-1.8/res/res_rtp_asterisk.c (original)
+++ team/oej/roibos-cng-support-1.8/res/res_rtp_asterisk.c Fri Sep 21 08:17:39 2012
@@ -1587,8 +1587,9 @@
 		new_duration = (new_duration & ~0xFFFF) | samples;
 
 		if (event_end & 0x80) {
-			/* End event */
-			if ((rtp->last_seqno != seqno) && (timestamp > rtp->last_end_timestamp)) {
+			/* End event.  Absorb re-transmits, and account for some endpoints
+			 * that erroneously increment the timestamp during re-transmissions */
+			if ((seqno != rtp->last_seqno) && (timestamp > rtp->last_end_timestamp + 320)) {
 				rtp->last_end_timestamp = timestamp;
 				rtp->dtmf_duration = new_duration;
 				rtp->resp = resp;
@@ -1598,7 +1599,7 @@
 				rtp->dtmf_duration = rtp->dtmf_timeout = 0;
 				AST_LIST_INSERT_TAIL(frames, f, frame_list);
 			} else if (rtpdebug) {
-				ast_debug(1, "Dropping duplicate or out of order DTMF END frame (seqno: %d, ts %d, digit %c)\n",
+				ast_debug(1, "Dropping re-transmitted, duplicate, or out of order DTMF END frame (seqno: %d, ts %d, digit %c)\n",
 					seqno, timestamp, resp);
 			}
 		} else {




More information about the svn-commits mailing list