[asterisk-commits] bebuild: tag 12.2.0-rc2 r412325 - in /tags/12.2.0-rc2: ./ main/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 14 13:57:42 CDT 2014


Author: bebuild
Date: Mon Apr 14 13:57:34 2014
New Revision: 412325

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=412325
Log:
Merge changes for 12.2.0-rc2; remove old summaries; update ChangeLog

Removed:
    tags/12.2.0-rc2/asterisk-12.2.0-rc1-summary.html
    tags/12.2.0-rc2/asterisk-12.2.0-rc1-summary.txt
Modified:
    tags/12.2.0-rc2/   (props changed)
    tags/12.2.0-rc2/ChangeLog
    tags/12.2.0-rc2/main/autoservice.c
    tags/12.2.0-rc2/main/http.c
    tags/12.2.0-rc2/res/res_hep.c
    tags/12.2.0-rc2/res/res_hep_pjsip.c
    tags/12.2.0-rc2/res/res_pjsip_pubsub.c
    tags/12.2.0-rc2/res/res_stasis.c

Propchange: tags/12.2.0-rc2/
------------------------------------------------------------------------------
    svn:mergeinfo = /branches/12:411668,411687,411804,412074,412088,412306

Modified: tags/12.2.0-rc2/ChangeLog
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc2/ChangeLog?view=diff&rev=412325&r1=412324&r2=412325
==============================================================================
--- tags/12.2.0-rc2/ChangeLog (original)
+++ tags/12.2.0-rc2/ChangeLog Mon Apr 14 13:57:34 2014
@@ -1,3 +1,60 @@
+2014-04-14  Asterisk Development Team <asteriskteam at digium.com>
+
+	* Asterisk 12.2.0-rc2 Released.
+
+	* autoservice: fix reference leak of logger callid.
+
+	  autoservice acquires a local reference to the logger callid of each
+	  channel in a loop. This local reference was not released, causing the
+	  callid of every channel in autoservice to leak. This change moves the
+	  callid unref inside the loop.
+
+	  ASTERISK-23616 #close
+	  Reported by: ibercom
+
+	* res_hep_pjsip: Use the channel name instead of the call ID when it is
+	  available
+
+	  During discussions with Alexandr Dubovikov at Kamailio World, it
+	  became apparent that while the SIP call ID is a useful identifier
+	  prior to an Asterisk channel being created, it is far more preferable
+	  to use the channel name (or some channel based identifier) when the
+	  channel is available. Homer is smart enough to tie the various
+	  messages together. This patch opts to use the channel name when it
+	  is available, falling back to the call ID otherwise.
+
+	* res_pjsip_pubsub: Set the body generation result to 0 for a valid
+	  path
+
+	  The result of the "ast_sip_pubsub_generate_body_content" was not
+	  set/initialized.  Consequently, the nominal path potentially returned
+	  an invalid value, thus not sending mwi notifications.
+
+	* Stasis: Fix Stasis() bridge refcount issue
+
+	  The Stasis() dialplan application monitors what bridge a channel is
+	  in and so necessarily holds on to a bridge pointer. This change
+	  ensures that it also holds on to a reference for that bridge to
+	  prevent the bridge pointer from becoming a dangling pointer.
+
+	* http: Fix spurious ERROR message in responses with no content
+
+	  When a response has a content length of 0, fwrite would be called
+	  to write a buffer with no data in it. This resulted in the following
+	  classic error message:
+
+	   [Apr  3 11:49:17] ERROR[26421] http.c: fwrite() failed: Success
+
+	  This patch makes it so that we only attempt to write out the content
+	  if the calculated content_length is non-zero.
+
+	* res_hep: Fix crash when hep.conf not available
+
+	  Parts of res_hep properly checked for a valid configuration object
+	  before attempting to access the configuration. A check, however,
+	  was missed when a packet is sent. This patch fixes the crash caused
+	  by not checking if the configuration object is valid.
+
 2014-03-28  Asterisk Development Team <asteriskteam at digium.com>
 
 	* Asterisk 12.2.0-rc1 Released.

Modified: tags/12.2.0-rc2/main/autoservice.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc2/main/autoservice.c?view=diff&rev=412325&r1=412324&r2=412325
==============================================================================
--- tags/12.2.0-rc2/main/autoservice.c (original)
+++ tags/12.2.0-rc2/main/autoservice.c Mon Apr 14 13:57:34 2014
@@ -131,6 +131,9 @@
 
 		callid = ast_channel_callid(chan);
 		ast_callid_threadassoc_change(callid);
+		if (callid) {
+			callid = ast_callid_unref(callid);
+		}
 
 		f = ast_read(chan);
 
@@ -180,11 +183,6 @@
 		 * If we did, we'd need to ast_frfree(f) if (f). */
 	}
 
-	if (callid) {
-		ast_callid_threadassoc_remove();
-		callid = ast_callid_unref(callid);
-	}
-
 	asthread = AST_PTHREADT_NULL;
 
 	return NULL;

Modified: tags/12.2.0-rc2/main/http.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc2/main/http.c?view=diff&rev=412325&r1=412324&r2=412325
==============================================================================
--- tags/12.2.0-rc2/main/http.c (original)
+++ tags/12.2.0-rc2/main/http.c Mon Apr 14 13:57:34 2014
@@ -416,7 +416,7 @@
 
 	/* calc content length */
 	if (out) {
-		content_length += strlen(ast_str_buffer(out));
+		content_length += ast_str_strlen(out);
 	}
 
 	if (fd) {
@@ -443,7 +443,7 @@
 
 	/* send content */
 	if (method != AST_HTTP_HEAD || status_code >= 400) {
-		if (out) {
+		if (content_length) {
 			if (fwrite(ast_str_buffer(out), content_length, 1, ser->f) != 1) {
 				ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno));
 			}

Modified: tags/12.2.0-rc2/res/res_hep.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc2/res/res_hep.c?view=diff&rev=412325&r1=412324&r2=412325
==============================================================================
--- tags/12.2.0-rc2/res/res_hep.c (original)
+++ tags/12.2.0-rc2/res/res_hep.c Mon Apr 14 13:57:34 2014
@@ -532,7 +532,7 @@
 	RAII_VAR(struct module_config *, config, ao2_global_obj_ref(global_config), ao2_cleanup);
 	int res;
 
-	if (!config->general->enabled) {
+	if (!config || !config->general->enabled) {
 		return 0;
 	}
 

Modified: tags/12.2.0-rc2/res/res_hep_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc2/res/res_hep_pjsip.c?view=diff&rev=412325&r1=412324&r2=412325
==============================================================================
--- tags/12.2.0-rc2/res/res_hep_pjsip.c (original)
+++ tags/12.2.0-rc2/res/res_hep_pjsip.c Mon Apr 14 13:57:34 2014
@@ -27,6 +27,7 @@
 /*** MODULEINFO
 	<depend>pjproject</depend>
 	<depend>res_pjsip</depend>
+	<depend>res_pjsip_session</depend>
 	<depend>res_hep</depend>
 	<defaultenabled>no</defaultenabled>
 	<support_level>extended</support_level>
@@ -37,11 +38,36 @@
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include <pjsip.h>
+#include <pjsip_ua.h>
+#include <pjlib.h>
 
 #include "asterisk/res_pjsip.h"
+#include "asterisk/res_pjsip_session.h"
 #include "asterisk/res_hep.h"
 #include "asterisk/module.h"
 #include "asterisk/netsock2.h"
+
+static char *assign_uuid(const pj_str_t *call_id, const pj_str_t *local_tag, const pj_str_t *remote_tag)
+{
+	RAII_VAR(struct ast_sip_session *, session, NULL, ao2_cleanup);
+	pjsip_dialog *dlg;
+	char *uuid = NULL;
+
+	if ((dlg = pjsip_ua_find_dialog(call_id, local_tag, remote_tag, PJ_FALSE))
+	    && (session = ast_sip_dialog_get_session(dlg))
+	    && (session->channel)) {
+
+		uuid = ast_strdup(ast_channel_name(session->channel));
+	} else {
+
+		uuid = ast_malloc(pj_strlen(call_id) + 1);
+		if (uuid) {
+			ast_copy_pj_str(uuid, call_id, pj_strlen(call_id) + 1);
+		}
+	}
+
+	return uuid;
+}
 
 static pj_status_t logging_on_tx_msg(pjsip_tx_data *tdata)
 {
@@ -50,6 +76,8 @@
 	char *uuid;
 	struct hepv3_capture_info *capture_info;
 	pjsip_cid_hdr *cid_hdr;
+	pjsip_from_hdr *from_hdr;
+	pjsip_to_hdr *to_hdr;
 
 	capture_info = hepv3_create_capture_info(tdata->buf.start, (size_t)(tdata->buf.cur - tdata->buf.start));
 	if (!capture_info) {
@@ -60,12 +88,14 @@
 	pj_sockaddr_print(&tdata->tp_info.dst_addr, remote_buf, sizeof(remote_buf), 3);
 
 	cid_hdr = PJSIP_MSG_CID_HDR(tdata->msg);
-	uuid = ast_malloc(pj_strlen(&cid_hdr->id) + 1);
+	from_hdr = PJSIP_MSG_FROM_HDR(tdata->msg);
+	to_hdr = PJSIP_MSG_TO_HDR(tdata->msg);
+
+	uuid = assign_uuid(&cid_hdr->id, &to_hdr->tag, &from_hdr->tag);
 	if (!uuid) {
 		ao2_ref(capture_info, -1);
 		return PJ_SUCCESS;
 	}
-	ast_copy_pj_str(uuid, &cid_hdr->id, pj_strlen(&cid_hdr->id) + 1);
 
 	ast_sockaddr_parse(&capture_info->src_addr, local_buf, PARSE_PORT_REQUIRE);
 	ast_sockaddr_parse(&capture_info->dst_addr, remote_buf, PARSE_PORT_REQUIRE);
@@ -95,12 +125,11 @@
 	pj_sockaddr_print(&rdata->tp_info.transport->local_addr, local_buf, sizeof(local_buf), 3);
 	pj_sockaddr_print(&rdata->pkt_info.src_addr, remote_buf, sizeof(remote_buf), 3);
 
-	uuid = ast_malloc(pj_strlen(&rdata->msg_info.cid->id) + 1);
+	uuid = assign_uuid(&rdata->msg_info.cid->id, &rdata->msg_info.to->tag, &rdata->msg_info.from->tag);
 	if (!uuid) {
 		ao2_ref(capture_info, -1);
 		return PJ_SUCCESS;
 	}
-	ast_copy_pj_str(uuid, &rdata->msg_info.cid->id, pj_strlen(&rdata->msg_info.cid->id) + 1);
 
 	ast_sockaddr_parse(&capture_info->src_addr, remote_buf, PARSE_PORT_REQUIRE);
 	ast_sockaddr_parse(&capture_info->dst_addr, local_buf, PARSE_PORT_REQUIRE);

Modified: tags/12.2.0-rc2/res/res_pjsip_pubsub.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc2/res/res_pjsip_pubsub.c?view=diff&rev=412325&r1=412324&r2=412325
==============================================================================
--- tags/12.2.0-rc2/res/res_pjsip_pubsub.c (original)
+++ tags/12.2.0-rc2/res/res_pjsip_pubsub.c Mon Apr 14 13:57:34 2014
@@ -1161,7 +1161,7 @@
 {
 	struct ast_sip_pubsub_body_supplement *supplement;
 	struct ast_sip_pubsub_body_generator *generator;
-	int res;
+	int res = 0;
 	void *body;
 
 	generator = find_body_generator_type_subtype(type, subtype);

Modified: tags/12.2.0-rc2/res/res_stasis.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc2/res/res_stasis.c?view=diff&rev=412325&r1=412324&r2=412325
==============================================================================
--- tags/12.2.0-rc2/res/res_stasis.c (original)
+++ tags/12.2.0-rc2/res/res_stasis.c Mon Apr 14 13:57:34 2014
@@ -777,7 +777,7 @@
 		RAII_VAR(struct ast_frame *, f, NULL, ast_frame_dtor);
 		int r;
 		int command_count;
-		struct ast_bridge *last_bridge;
+		RAII_VAR(struct ast_bridge *, last_bridge, NULL, ao2_cleanup);
 
 		/* Check to see if a bridge absorbed our hangup frame */
 		if (ast_check_hangup_locked(chan)) {
@@ -785,7 +785,7 @@
 		}
 
 		last_bridge = bridge;
-		bridge = stasis_app_get_bridge(control);
+		bridge = ao2_bump(stasis_app_get_bridge(control));
 
 		if (bridge != last_bridge) {
 			app_unsubscribe_bridge(app, last_bridge);
@@ -839,6 +839,7 @@
 
 	app_unsubscribe_bridge(app, stasis_app_get_bridge(control));
 	app_unsubscribe_channel(app, chan);
+	ao2_cleanup(bridge);
 
 	res = send_end_msg(app, chan);
 	if (res != 0) {




More information about the asterisk-commits mailing list