[asterisk-commits] mmichelson: branch mmichelson/pool_shark r380895 - in /team/mmichelson/pool_s...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Feb 5 13:11:18 CST 2013
Author: mmichelson
Date: Tue Feb 5 13:11:16 2013
New Revision: 380895
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380895
Log:
Resolve conflict and restart automerge.
Modified:
team/mmichelson/pool_shark/ (props changed)
team/mmichelson/pool_shark/apps/confbridge/conf_config_parser.c
team/mmichelson/pool_shark/main/dial.c
team/mmichelson/pool_shark/res/res_sip.c
team/mmichelson/pool_shark/res/res_sip/sip_options.c
team/mmichelson/pool_shark/res/res_sip_session.c
Propchange: team/mmichelson/pool_shark/
------------------------------------------------------------------------------
automerge = *
Propchange: team/mmichelson/pool_shark/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Propchange: team/mmichelson/pool_shark/
------------------------------------------------------------------------------
--- pool_shark-integrated (original)
+++ pool_shark-integrated Tue Feb 5 13:11:16 2013
@@ -1,1 +1,1 @@
-/team/group/pimp_my_sip:1-380823
+/team/group/pimp_my_sip:1-380877
Propchange: team/mmichelson/pool_shark/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Feb 5 13:11:16 2013
@@ -1,1 +1,1 @@
-/trunk:1-380818
+/trunk:1-380858
Modified: team/mmichelson/pool_shark/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pool_shark/apps/confbridge/conf_config_parser.c?view=diff&rev=380895&r1=380894&r2=380895
==============================================================================
--- team/mmichelson/pool_shark/apps/confbridge/conf_config_parser.c (original)
+++ team/mmichelson/pool_shark/apps/confbridge/conf_config_parser.c Tue Feb 5 13:11:16 2013
@@ -1355,7 +1355,7 @@
static void conf_user_profile_copy(struct user_profile *dst, struct user_profile *src)
{
- memcpy(dst, src, sizeof(*dst));
+ *dst = *src;
}
const struct user_profile *conf_find_user_profile(struct ast_channel *chan, const char *user_profile_name, struct user_profile *result)
Modified: team/mmichelson/pool_shark/main/dial.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pool_shark/main/dial.c?view=diff&rev=380895&r1=380894&r2=380895
==============================================================================
--- team/mmichelson/pool_shark/main/dial.c (original)
+++ team/mmichelson/pool_shark/main/dial.c Tue Feb 5 13:11:16 2013
@@ -167,12 +167,19 @@
return;
}
-/*! \brief Options structure - maps options to respective handlers (enable/disable). This list MUST be perfectly kept in order, or else madness will happen. */
-static const struct ast_option_types {
+struct ast_option_types {
enum ast_dial_option option;
ast_dial_option_cb_enable enable;
ast_dial_option_cb_disable disable;
-} option_types[] = {
+};
+
+/*!
+ * \brief Map options to respective handlers (enable/disable).
+ *
+ * \note This list MUST be perfectly kept in order with enum
+ * ast_dial_option, or else madness will happen.
+ */
+static const struct ast_option_types option_types[] = {
{ AST_DIAL_OPTION_RINGING, NULL, NULL }, /*!< Always indicate ringing to caller */
{ AST_DIAL_OPTION_ANSWER_EXEC, answer_exec_enable, answer_exec_disable }, /*!< Execute application upon answer in async mode */
{ AST_DIAL_OPTION_MUSIC, music_enable, music_disable }, /*!< Play music to the caller instead of ringing */
Modified: team/mmichelson/pool_shark/res/res_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pool_shark/res/res_sip.c?view=diff&rev=380895&r1=380894&r2=380895
==============================================================================
--- team/mmichelson/pool_shark/res/res_sip.c (original)
+++ team/mmichelson/pool_shark/res/res_sip.c Tue Feb 5 13:11:16 2013
@@ -58,6 +58,7 @@
return -1;
}
ast_debug(1, "Registered SIP service %.*s (%p)\n", (int) pj_strlen(&(*module)->name), pj_strbuf(&(*module)->name), *module);
+ ast_module_ref(ast_module_info->self);
return 0;
}
@@ -69,6 +70,7 @@
static int unregister_service(void *data)
{
pjsip_module **module = data;
+ ast_module_unref(ast_module_info->self);
if (!ast_pjsip_endpoint) {
return -1;
}
@@ -93,6 +95,7 @@
}
ao2_global_obj_replace_unref(registered_authenticator, auth);
ast_debug(1, "Registered SIP authenticator module %p\n", auth);
+ ast_module_ref(ast_module_info->self);
return 0;
}
@@ -106,6 +109,7 @@
}
ao2_global_obj_release(registered_authenticator);
ast_debug(1, "Unregistered SIP authenticator %p\n", auth);
+ ast_module_unref(ast_module_info->self);
}
int ast_sip_requires_authentication(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
@@ -194,6 +198,8 @@
AST_RWLIST_INSERT_TAIL(&endpoint_identifiers, id_list_item, list);
ast_debug(1, "Registered endpoint identifier %p\n", identifier);
+
+ ast_module_ref(ast_module_info->self);
return 0;
}
@@ -206,6 +212,7 @@
AST_RWLIST_REMOVE_CURRENT(list);
ast_free(iter);
ast_debug(1, "Unregistered endpoint identifier %p\n", identifier);
+ ast_module_unref(ast_module_info->self);
break;
}
}
@@ -641,7 +648,7 @@
goto error;
}
- if (ast_sip_register_service(&unhandled_module)) {
+ if (pjsip_endpt_register_module(ast_pjsip_endpoint, &unhandled_module)) {
ast_log(LOG_ERROR, "Failed to register unhandled request module. Aborting load\n");
goto error;
}
Modified: team/mmichelson/pool_shark/res/res_sip/sip_options.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pool_shark/res/res_sip/sip_options.c?view=diff&rev=380895&r1=380894&r2=380895
==============================================================================
--- team/mmichelson/pool_shark/res/res_sip/sip_options.c (original)
+++ team/mmichelson/pool_shark/res/res_sip/sip_options.c Tue Feb 5 13:11:16 2013
@@ -36,6 +36,8 @@
int scheduler_id;
};
+static pj_bool_t options_module_start(void);
+static pj_bool_t options_module_stop(void);
static pj_bool_t options_module_on_rx_request(pjsip_rx_data *rdata);
static pj_bool_t options_module_on_rx_response(pjsip_rx_data *rdata);
@@ -43,9 +45,32 @@
.name = {"Options Module", 14},
.id = -1,
.priority = PJSIP_MOD_PRIORITY_APPLICATION,
+ .start = options_module_start,
+ .stop = options_module_stop,
.on_rx_request = options_module_on_rx_request,
.on_rx_response = options_module_on_rx_response,
};
+
+static pj_bool_t options_module_start(void)
+{
+ if (!(sched = ast_sched_context_create()) ||
+ ast_sched_start_thread(sched)) {
+ return -1;
+ }
+
+ return PJ_SUCCESS;
+}
+
+static pj_bool_t options_module_stop(void)
+{
+ ao2_t_ref(scheduled_qualifies, -1, "Remove scheduled qualifies on module stop");
+
+ if (sched) {
+ ast_sched_context_destroy(sched);
+ }
+
+ return PJ_SUCCESS;
+}
static pj_status_t send_options_response(pjsip_rx_data *rdata, pjsip_dialog *pj_dlg, int code)
{
@@ -330,17 +355,10 @@
ao2_iterator_destroy(&it_endpoints);
}
-static void options_cleanup(void)
-{
- ao2_t_ref(scheduled_qualifies, -1, "Remove scheduled qualifies on exit");
- ast_sip_unregister_service(&options_module);
- if (sched) {
- ast_sched_context_destroy(sched);
- }
-}
-
int ast_res_sip_init_options_handling(int reload)
{
+ const pj_str_t STR_OPTIONS = { "OPTIONS", 7 };
+
if (scheduled_qualifies) {
ao2_t_ref(scheduled_qualifies, -1, "Remove old scheduled qualifies");
}
@@ -349,37 +367,21 @@
return -1;
}
- if (!reload) {
- const pj_str_t STR_OPTIONS = { "OPTIONS", 7 };
-
- if (ast_sip_register_service(&options_module)) {
- ao2_t_ref(scheduled_qualifies, -1, "Remove scheduled qualifies on off nominal path");
- return -1;
- }
-
- if (pjsip_endpt_add_capability(ast_sip_get_pjsip_endpoint(), NULL, PJSIP_H_ALLOW, NULL, 1, &STR_OPTIONS) != PJ_SUCCESS) {
- ao2_t_ref(scheduled_qualifies, -1, "Remove scheduled qualifies on off nominal path");
- ast_sip_unregister_service(&options_module);
- return -1;
- }
-
- sched = ast_sched_context_create();
- if (!sched) {
- ao2_t_ref(scheduled_qualifies, -1, "Remove scheduled qualifies on off nominal path");
- ast_sip_unregister_service(&options_module);
- return -1;
- }
-
- if (ast_sched_start_thread(sched)) {
- ao2_t_ref(scheduled_qualifies, -1, "Remove scheduled qualifies on off nominal path");
- ast_sip_unregister_service(&options_module);
- ast_sched_context_destroy(sched);
- return -1;
- }
-
- schedule_qualifies();
- }
-
- ast_register_atexit(options_cleanup);
+ if (reload) {
+ return 0;
+ }
+
+ if (pjsip_endpt_register_module(ast_sip_get_pjsip_endpoint(), &options_module) != PJ_SUCCESS) {
+ options_module_stop();
+ return -1;
+ }
+
+ if (pjsip_endpt_add_capability(ast_sip_get_pjsip_endpoint(), NULL, PJSIP_H_ALLOW, NULL, 1, &STR_OPTIONS) != PJ_SUCCESS) {
+ pjsip_endpt_unregister_module(ast_sip_get_pjsip_endpoint(), &options_module);
+ return -1;
+ }
+
+ schedule_qualifies();
+
return 0;
}
Modified: team/mmichelson/pool_shark/res/res_sip_session.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pool_shark/res/res_sip_session.c?view=diff&rev=380895&r1=380894&r2=380895
==============================================================================
--- team/mmichelson/pool_shark/res/res_sip_session.c (original)
+++ team/mmichelson/pool_shark/res/res_sip_session.c Tue Feb 5 13:11:16 2013
@@ -104,6 +104,7 @@
}
AST_LIST_INSERT_TAIL(&handler_list->list, handler, next);
ast_debug(1, "Registered SDP stream handler '%s' for stream type '%s'\n", handler->id, stream_type);
+ ast_module_ref(ast_module_info->self);
return 0;
}
@@ -120,6 +121,7 @@
return -1;
}
ast_debug(1, "Registered SDP stream handler '%s' for stream type '%s'\n", handler->id, stream_type);
+ ast_module_ref(ast_module_info->self);
return 0;
}
@@ -134,6 +136,7 @@
if (!strcmp(iter->id, handler->id)) {
AST_LIST_REMOVE_CURRENT(next);
ast_debug(1, "Unregistered SDP stream handler '%s' for stream type '%s'\n", handler->id, stream_type);
+ ast_module_unref(ast_module_info->self);
}
}
AST_LIST_TRAVERSE_SAFE_END;
@@ -191,6 +194,7 @@
{
SCOPED_LOCK(lock, &session_supplements, AST_RWLIST_WRLOCK, AST_RWLIST_UNLOCK);
AST_RWLIST_INSERT_TAIL(&session_supplements, supplement, next);
+ ast_module_ref(ast_module_info->self);
return 0;
}
@@ -201,6 +205,7 @@
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&session_supplements, iter, next) {
if (supplement == iter) {
AST_RWLIST_REMOVE_CURRENT(next);
+ ast_module_unref(ast_module_info->self);
break;
}
}
More information about the asterisk-commits
mailing list