[asterisk-commits] mmichelson: branch group/pimp_my_sip r381579 - in /team/group/pimp_my_sip: ./...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 15 13:49:36 CST 2013


Author: mmichelson
Date: Fri Feb 15 13:49:32 2013
New Revision: 381579

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


Modified:
    team/group/pimp_my_sip/   (props changed)
    team/group/pimp_my_sip/channels/chan_sip.c
    team/group/pimp_my_sip/include/asterisk/logger.h
    team/group/pimp_my_sip/include/asterisk/sorcery.h
    team/group/pimp_my_sip/main/autoservice.c
    team/group/pimp_my_sip/main/config_options.c
    team/group/pimp_my_sip/main/logger.c
    team/group/pimp_my_sip/main/sorcery.c

Propchange: team/group/pimp_my_sip/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/pimp_my_sip/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/group/pimp_my_sip/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Feb 15 13:49:32 2013
@@ -1,1 +1,1 @@
-/trunk:1-381542
+/trunk:1-381578

Modified: team/group/pimp_my_sip/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/channels/chan_sip.c?view=diff&rev=381579&r1=381578&r2=381579
==============================================================================
--- team/group/pimp_my_sip/channels/chan_sip.c (original)
+++ team/group/pimp_my_sip/channels/chan_sip.c Fri Feb 15 13:49:32 2013
@@ -13165,7 +13165,7 @@
 		if (needvideo) {
 			get_crypto_attrib(p, p->vsrtp, &v_a_crypto);
 			ast_str_append(&m_video, 0, "m=video %d %s", ast_sockaddr_port(&vdest),
-				       get_sdp_rtp_profile(p, a_crypto ? 1 : 0, p->vrtp));
+				       get_sdp_rtp_profile(p, v_a_crypto ? 1 : 0, p->vrtp));
 
 			/* Build max bitrate string */
 			if (p->maxcallbitrate)
@@ -13190,7 +13190,7 @@
 				ast_verbose("Lets set up the text sdp\n");
 			get_crypto_attrib(p, p->tsrtp, &t_a_crypto);
 			ast_str_append(&m_text, 0, "m=text %d %s", ast_sockaddr_port(&tdest),
-				       get_sdp_rtp_profile(p, a_crypto ? 1 : 0, p->trtp));
+				       get_sdp_rtp_profile(p, t_a_crypto ? 1 : 0, p->trtp));
 			if (debug) {  /* XXX should I use tdest below ? */
 				ast_verbose("Text is at %s\n", ast_sockaddr_stringify(&taddr));
 			}
@@ -24814,9 +24814,6 @@
 	}
 	ast_setstate(c, AST_STATE_DOWN);
 	ast_channel_unlock(c);
-
-	/* The call should be down with no ast_channel, so hang it up */
-	ast_channel_tech_pvt_set(c, dialog_unref(ast_channel_tech_pvt(c), "unref dialog c->tech_pvt"));
 
 	/* c and c's tech pvt must be unlocked at this point for ast_hangup */
 	ast_hangup(c);

Modified: team/group/pimp_my_sip/include/asterisk/logger.h
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/include/asterisk/logger.h?view=diff&rev=381579&r1=381578&r2=381579
==============================================================================
--- team/group/pimp_my_sip/include/asterisk/logger.h (original)
+++ team/group/pimp_my_sip/include/asterisk/logger.h Fri Feb 15 13:49:32 2013
@@ -281,6 +281,15 @@
 #define ast_callid_unref(c) ({ ao2_ref(c, -1); (NULL); })
 
 /*!
+ * \brief Sets what is stored in the thread storage to the given
+ *        callid if it does not match what is already there.
+ *
+ * \retval 0 - success
+ * \retval non-zero - failure
+ */
+int ast_callid_threadassoc_change(struct ast_callid *callid);
+
+/*!
  * \brief Adds a known callid to thread storage of the calling thread
  *
  * \retval 0 - success

Modified: team/group/pimp_my_sip/include/asterisk/sorcery.h
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/include/asterisk/sorcery.h?view=diff&rev=381579&r1=381578&r2=381579
==============================================================================
--- team/group/pimp_my_sip/include/asterisk/sorcery.h (original)
+++ team/group/pimp_my_sip/include/asterisk/sorcery.h Fri Feb 15 13:49:32 2013
@@ -280,17 +280,22 @@
  *
  * \param sorcery Pointer to a sorcery structure
  * \param name Name of the category to use within the configuration file, normally the module name
- *
- * \retval 0 success
- * \retval -1 failure
- */
-int ast_sorcery_apply_config(struct ast_sorcery *sorcery, const char *name);
+ * \param module The module name (AST_MODULE)
+ *
+ * \retval 0 success
+ * \retval -1 failure
+ */
+int __ast_sorcery_apply_config(struct ast_sorcery *sorcery, const char *name, const char *module);
+
+#define ast_sorcery_apply_config(sorcery, name) \
+	__ast_sorcery_apply_config((sorcery), (name), AST_MODULE)
 
 /*!
  * \brief Apply default object wizard mappings
  *
  * \param sorcery Pointer to a sorcery structure
  * \param type Type of object to apply to
+ * \param module The name of the module, typically AST_MODULE
  * \param name Name of the wizard to use
  * \param data Data to be passed to wizard
  *
@@ -301,7 +306,10 @@
  *
  * \note Only a single default can exist per object type
  */
-int ast_sorcery_apply_default(struct ast_sorcery *sorcery, const char *type, const char *name, const char *data);
+int __ast_sorcery_apply_default(struct ast_sorcery *sorcery, const char *type, const char *module, const char *name, const char *data);
+
+#define ast_sorcery_apply_default(sorcery, type, name, data) \
+	__ast_sorcery_apply_default((sorcery), (type), AST_MODULE, (name), (data))
 
 /*!
  * \brief Register an object type

Modified: team/group/pimp_my_sip/main/autoservice.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/main/autoservice.c?view=diff&rev=381579&r1=381578&r2=381579
==============================================================================
--- team/group/pimp_my_sip/main/autoservice.c (original)
+++ team/group/pimp_my_sip/main/autoservice.c Fri Feb 15 13:49:32 2013
@@ -77,6 +77,7 @@
 
 static void *autoservice_run(void *ign)
 {
+	struct ast_callid *callid = NULL;
 	struct ast_frame hangup_frame = {
 		.frametype = AST_FRAME_CONTROL,
 		.subclass.integer = AST_CONTROL_HANGUP,
@@ -90,7 +91,6 @@
 		int i, x = 0, ms = 50;
 		struct ast_frame *f = NULL;
 		struct ast_frame *defer_frame = NULL;
-		struct ast_callid *callid = NULL;
 
 		AST_LIST_LOCK(&aslist);
 
@@ -129,9 +129,8 @@
 			continue;
 		}
 
-		if ((callid = ast_channel_callid(chan))) {
-			ast_callid_threadassoc_add(callid);
-		}
+		callid = ast_channel_callid(chan);
+		ast_callid_threadassoc_change(callid);
 
 		f = ast_read(chan);
 
@@ -173,11 +172,11 @@
 		} else if (f) {
 			ast_frfree(f);
 		}
-
-		if (callid) {
-			ast_callid_threadassoc_remove();
-			callid = ast_callid_unref(callid);
-		}
+	}
+
+	if (callid) {
+		ast_callid_threadassoc_remove();
+		callid = ast_callid_unref(callid);
 	}
 
 	asthread = AST_PTHREADT_NULL;

Modified: team/group/pimp_my_sip/main/config_options.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/main/config_options.c?view=diff&rev=381579&r1=381578&r2=381579
==============================================================================
--- team/group/pimp_my_sip/main/config_options.c (original)
+++ team/group/pimp_my_sip/main/config_options.c Fri Feb 15 13:49:32 2013
@@ -894,7 +894,7 @@
 /* Define as 0 if we want to allow configurations to be registered without
  * documentation
  */
-#define XMLDOC_STRICT 1
+#define XMLDOC_STRICT 0
 
 /*! \internal
  * \brief Update the XML documentation for a config type based on its registration

Modified: team/group/pimp_my_sip/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/main/logger.c?view=diff&rev=381579&r1=381578&r2=381579
==============================================================================
--- team/group/pimp_my_sip/main/logger.c (original)
+++ team/group/pimp_my_sip/main/logger.c Fri Feb 15 13:49:32 2013
@@ -1317,7 +1317,9 @@
 	}
 
 	call->call_identifier = ast_atomic_fetchadd_int(&next_unique_callid, +1);
+#ifdef TEST_FRAMEWORK
 	ast_debug(3, "CALL_ID [C-%08x] created by thread.\n", call->call_identifier);
+#endif
 	return call;
 }
 
@@ -1334,6 +1336,36 @@
 
 }
 
+int ast_callid_threadassoc_change(struct ast_callid *callid)
+{
+	struct ast_callid **id =
+		ast_threadstorage_get(&unique_callid, sizeof(struct ast_callid **));
+
+	if (!id) {
+		ast_log(LOG_ERROR, "Failed to allocate thread storage.\n");
+		return -1;
+	}
+
+	if (*id && (*id != callid)) {
+#ifdef TEST_FRAMEWORK
+		ast_debug(3, "CALL_ID [C-%08x] being removed from thread.\n", (*id)->call_identifier);
+#endif
+		*id = ast_callid_unref(*id);
+		*id = NULL;
+	}
+
+	if (!(*id) && callid) {
+		/* callid will be unreffed at thread destruction */
+		ast_callid_ref(callid);
+		*id = callid;
+#ifdef TEST_FRAMEWORK
+		ast_debug(3, "CALL_ID [C-%08x] bound to thread.\n", callid->call_identifier);
+#endif
+	}
+
+	return 0;
+}
+
 int ast_callid_threadassoc_add(struct ast_callid *callid)
 {
 	struct ast_callid **pointing;
@@ -1347,7 +1379,9 @@
 		/* callid will be unreffed at thread destruction */
 		ast_callid_ref(callid);
 		*pointing = callid;
+#ifdef TEST_FRAMEWORK
 		ast_debug(3, "CALL_ID [C-%08x] bound to thread.\n", callid->call_identifier);
+#endif
 	} else {
 		ast_log(LOG_WARNING, "Attempted to ast_callid_threadassoc_add on thread already associated with a callid.\n");
 		return 1;
@@ -1369,7 +1403,9 @@
 		ast_log(LOG_ERROR, "Tried to clean callid thread storage with no callid in thread storage.\n");
 		return -1;
 	} else {
+#ifdef TEST_FRAMEWORK
 		ast_debug(3, "CALL_ID [C-%08x] being removed from thread.\n", (*pointing)->call_identifier);
+#endif
 		*pointing = ast_callid_unref(*pointing);
 		return 0;
 	}

Modified: team/group/pimp_my_sip/main/sorcery.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/main/sorcery.c?view=diff&rev=381579&r1=381578&r2=381579
==============================================================================
--- team/group/pimp_my_sip/main/sorcery.c (original)
+++ team/group/pimp_my_sip/main/sorcery.c Fri Feb 15 13:49:32 2013
@@ -330,7 +330,7 @@
 }
 
 /*! \brief Internal function which allocates an object type structure */
-static struct ast_sorcery_object_type *sorcery_object_type_alloc(const char *type)
+static struct ast_sorcery_object_type *sorcery_object_type_alloc(const char *type, const char *module)
 {
 	struct ast_sorcery_object_type *object_type;
 
@@ -361,6 +361,7 @@
 
 	object_type->info->files[0] = object_type->file;
 	object_type->info->files[1] = NULL;
+	object_type->info->module = module;
 
 	ast_copy_string(object_type->name, type, sizeof(object_type->name));
 
@@ -382,7 +383,7 @@
 }
 
 /*! \brief Internal function which creates an object type and adds a wizard mapping */
-static int sorcery_apply_wizard_mapping(struct ast_sorcery *sorcery, const char *type, const char *name, const char *data, unsigned int caching)
+static int sorcery_apply_wizard_mapping(struct ast_sorcery *sorcery, const char *type, const char *module, const char *name, const char *data, unsigned int caching)
 {
 	RAII_VAR(struct ast_sorcery_object_type *, object_type,  ao2_find(sorcery->types, type, OBJ_KEY), ao2_cleanup);
 	RAII_VAR(struct ast_sorcery_wizard *, wizard, ao2_find(wizards, name, OBJ_KEY), ao2_cleanup);
@@ -394,7 +395,7 @@
 	}
 
 	if (!object_type) {
-		if (!(object_type = sorcery_object_type_alloc(type))) {
+		if (!(object_type = sorcery_object_type_alloc(type, module))) {
 			return -1;
 		}
 		created = 1;
@@ -418,7 +419,7 @@
 	return 0;
 }
 
-int ast_sorcery_apply_config(struct ast_sorcery *sorcery, const char *name)
+int __ast_sorcery_apply_config(struct ast_sorcery *sorcery, const char *name, const char *module)
 {
 	struct ast_flags flags = { 0 };
 	struct ast_config *config = ast_config_load2("sorcery.conf", "sorcery", flags);
@@ -447,7 +448,7 @@
 		}
 
 		/* Any error immediately causes us to stop */
-		if ((res = sorcery_apply_wizard_mapping(sorcery, name, wizard, data, caching))) {
+		if ((res = sorcery_apply_wizard_mapping(sorcery, name, module, wizard, data, caching))) {
 			break;
 		}
 	}
@@ -457,7 +458,7 @@
 	return res;
 }
 
-int ast_sorcery_apply_default(struct ast_sorcery *sorcery, const char *type, const char *name, const char *data)
+int __ast_sorcery_apply_default(struct ast_sorcery *sorcery, const char *type, const char *module, const char *name, const char *data)
 {
 	RAII_VAR(struct ast_sorcery_object_type *, object_type,  ao2_find(sorcery->types, type, OBJ_KEY), ao2_cleanup);
 
@@ -466,7 +467,7 @@
 		return -1;
 	}
 
-	return sorcery_apply_wizard_mapping(sorcery, type, name, data, 0);
+	return sorcery_apply_wizard_mapping(sorcery, type, module, name, data, 0);
 }
 
 int ast_sorcery_object_register(struct ast_sorcery *sorcery, const char *type, aco_type_item_alloc alloc, sorcery_transform_handler transform, sorcery_apply_handler apply)




More information about the asterisk-commits mailing list