[svn-commits] kharwell: branch 12 r405643 - /branches/12/channels/chan_pjsip.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Jan 16 10:35:15 CST 2014
Author: kharwell
Date: Thu Jan 16 10:35:12 2014
New Revision: 405643
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=405643
Log:
chan_pjsip: initial device state on endpoints is INVALID
When endpoints get loaded their device state gets set to 'INVALID' because the
channel driver has not been loaded yet. Fixed by updating the device state for
every endpoint upon load of the channel driver.
(closes issue ASTERISK-23065)
Reported by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/3123/
Modified:
branches/12/channels/chan_pjsip.c
Modified: branches/12/channels/chan_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/chan_pjsip.c?view=diff&rev=405643&r1=405642&r2=405643
==============================================================================
--- branches/12/channels/chan_pjsip.c (original)
+++ branches/12/channels/chan_pjsip.c Thu Jan 16 10:35:12 2014
@@ -1874,6 +1874,13 @@
return 0;
}
+static int update_devstate(void *obj, void *arg, int flags)
+{
+ ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE,
+ "PJSIP/%s", ast_sorcery_object_get_id(obj));
+ return 0;
+}
+
static struct ast_custom_function chan_pjsip_dial_contacts_function = {
.name = "PJSIP_DIAL_CONTACTS",
.read = pjsip_acf_dial_contacts_read,
@@ -1897,6 +1904,8 @@
*/
static int load_module(void)
{
+ struct ao2_container *endpoints;
+
if (!(chan_pjsip_tech.capabilities = ast_format_cap_alloc(0))) {
return AST_MODULE_LOAD_DECLINE;
}
@@ -1936,6 +1945,13 @@
ast_sip_session_unregister_supplement(&pbx_start_supplement);
ast_sip_session_unregister_supplement(&chan_pjsip_supplement);
goto end;
+ }
+
+ /* since endpoints are loaded before the channel driver their device
+ states get set to 'invalid', so they need to be updated */
+ if ((endpoints = ast_sip_get_endpoints())) {
+ ao2_callback(endpoints, OBJ_NODATA, update_devstate, NULL);
+ ao2_ref(endpoints, -1);
}
return 0;
More information about the svn-commits
mailing list