Review Board 1.7.16


Add a reloadable option for sorcery type objects

Review Request #2807 - Created Aug. 29, 2013 and submitted

Kevin Harwell
12
ASTERISK-22382, ASTERISK-22384
Reviewers
asterisk-dev
Asterisk
Some configuration objects currently won't place nice if reloaded.  Specifically, in this case the pjsip transport objects.  Now when registering an object in sorcery one may specify that the object is allowed to be reloaded or not.  If the object is set to not reload then upon reloading of the configuration the objects of that type will not be reloaded.  The initially loaded objects of that type however will remain.

While the transport objects will not longer be reloaded it is still possible for a user to configure an endpoint to an invalid transport.  A couple of log messages were added to help diagnose this problem if it occurs.
Ran asterisk with a couple of pjsip endpoints configured for a valid transport.  Changed the transport name on the transport type and issued a 'core reload' and observed that the transport was not reloaded and calls could still be made.  Then changed the transport name on an endpoint to one that didn't exist and after reloading observed that calls failed, but an error message was logged stating that the transport could not be found.  Also verified the reported crash no longer occurred.
branches/12/include/asterisk/sorcery.h
Diff Revision 1 Diff Revision 2
[20] 353 lines
[+20] [+] int __ast_sorcery_apply_default(struct ast_sorcery *sorcery, const char *type, const char *module, const char *name, const char *data);
354
 * macro'd versions should be used instead.
354
 * macro'd versions should be used instead.
355
 *
355
 *
356
 * \retval 0 success
356
 * \retval 0 success
357
 * \retval -1 failure
357
 * \retval -1 failure
358
 */
358
 */
359
int __ast_sorcery_object_register(struct ast_sorcery *sorcery, const char *type, unsigned int hidden, char reloadable, aco_type_item_alloc alloc, sorcery_transform_handler transform, sorcery_apply_handler apply);
359
int __ast_sorcery_object_register(struct ast_sorcery *sorcery, const char *type, unsigned int hidden, unsigned int reloadable, aco_type_item_alloc alloc, sorcery_transform_handler transform, sorcery_apply_handler apply);
360

    
   
360

   
361
/*!
361
/*!
362
 * \brief Register an object type
362
 * \brief Register an object type
363
 *
363
 *
364
 * \param sorcery Pointer to a sorcery structure
364
 * \param sorcery Pointer to a sorcery structure
[+20] [20] 462 lines
branches/12/main/sorcery.c
Diff Revision 1 Diff Revision 2
 
branches/12/res/res_pjsip.c
Diff Revision 1 Diff Revision 2
 
branches/12/res/res_pjsip_outbound_registration.c
Diff Revision 1 Diff Revision 2
 
branches/12/res/res_pjsip/config_transport.c
Diff Revision 1 Diff Revision 2
 
  1. branches/12/include/asterisk/sorcery.h: Loading...
  2. branches/12/main/sorcery.c: Loading...
  3. branches/12/res/res_pjsip.c: Loading...
  4. branches/12/res/res_pjsip_outbound_registration.c: Loading...
  5. branches/12/res/res_pjsip/config_transport.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.