From: Kevin Harwell Date: Tue, 17 Mar 2015 18:35:07 +0000 (+0000) Subject: res_pjsip: Allow configuration of endpoint identifier query order X-Git-Tag: 14.0.0-beta1~1178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=803a916334363adcaf5b88bf16eb99d4c1d90dae;p=thirdparty%2Fasterisk.git res_pjsip: Allow configuration of endpoint identifier query order Updated some documentation stating that endpoint identifiers registered without a name are place at the front of the lookup list. Also renamed register method 'ast_sip_register_endpoint_identifier_by_name' to 'ast_sip_register_endpoint_identifier_with_name' ASTERISK-24840 Reported by: Mark Michelson ........ Merged revisions 433031 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433032 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index a34c4b3069..57c1a598d8 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -793,8 +793,8 @@ void ast_sip_unregister_outbound_authenticator(struct ast_sip_outbound_authentic * \retval 0 Success * \retval -1 Failure */ -int ast_sip_register_endpoint_identifier_by_name(struct ast_sip_endpoint_identifier *identifier, - const char *name); +int ast_sip_register_endpoint_identifier_with_name(struct ast_sip_endpoint_identifier *identifier, + const char *name); /*! * \brief Register a SIP endpoint identifier @@ -813,6 +813,10 @@ int ast_sip_register_endpoint_identifier_by_name(struct ast_sip_endpoint_identif * be sure to load individual endpoint identifier modules in the order you wish * for them to be run in modules.conf * + * \note endpoint identifiers registered using this method (no name specified) + * are placed at the front of the endpoint identifiers list ahead of any + * named identifiers. + * * \param identifier The SIP endpoint identifier to register * \retval 0 Success * \retval -1 Failure diff --git a/res/res_pjsip.c b/res/res_pjsip.c index f26af1f5d2..4e0a797c63 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -1978,7 +1978,7 @@ struct endpoint_identifier_list { static AST_RWLIST_HEAD_STATIC(endpoint_identifiers, endpoint_identifier_list); -int ast_sip_register_endpoint_identifier_by_name(struct ast_sip_endpoint_identifier *identifier, +int ast_sip_register_endpoint_identifier_with_name(struct ast_sip_endpoint_identifier *identifier, const char *name) { char *prev, *current, *identifier_order; @@ -2060,7 +2060,7 @@ int ast_sip_register_endpoint_identifier_by_name(struct ast_sip_endpoint_identif int ast_sip_register_endpoint_identifier(struct ast_sip_endpoint_identifier *identifier) { - return ast_sip_register_endpoint_identifier_by_name(identifier, NULL); + return ast_sip_register_endpoint_identifier_with_name(identifier, NULL); } void ast_sip_unregister_endpoint_identifier(struct ast_sip_endpoint_identifier *identifier) diff --git a/res/res_pjsip_endpoint_identifier_anonymous.c b/res/res_pjsip_endpoint_identifier_anonymous.c index f191d99cfb..274c055868 100644 --- a/res/res_pjsip_endpoint_identifier_anonymous.c +++ b/res/res_pjsip_endpoint_identifier_anonymous.c @@ -110,7 +110,7 @@ static int load_module(void) { CHECK_PJSIP_MODULE_LOADED(); - ast_sip_register_endpoint_identifier_by_name(&anonymous_identifier, "anonymous"); + ast_sip_register_endpoint_identifier_with_name(&anonymous_identifier, "anonymous"); return AST_MODULE_LOAD_SUCCESS; } diff --git a/res/res_pjsip_endpoint_identifier_ip.c b/res/res_pjsip_endpoint_identifier_ip.c index b97724e3fe..5c6e2cc3e8 100644 --- a/res/res_pjsip_endpoint_identifier_ip.c +++ b/res/res_pjsip_endpoint_identifier_ip.c @@ -491,7 +491,7 @@ static int load_module(void) ast_sorcery_object_field_register_custom(ast_sip_get_sorcery(), "identify", "match", "", ip_identify_match_handler, match_to_str, match_to_var_list, 0, 0); ast_sorcery_reload_object(ast_sip_get_sorcery(), "identify"); - ast_sip_register_endpoint_identifier_by_name(&ip_identifier, "ip"); + ast_sip_register_endpoint_identifier_with_name(&ip_identifier, "ip"); ast_sip_register_endpoint_formatter(&endpoint_identify_formatter); cli_formatter = ao2_alloc(sizeof(struct ast_sip_cli_formatter_entry), NULL); diff --git a/res/res_pjsip_endpoint_identifier_user.c b/res/res_pjsip_endpoint_identifier_user.c index a60057e147..5abf879999 100644 --- a/res/res_pjsip_endpoint_identifier_user.c +++ b/res/res_pjsip_endpoint_identifier_user.c @@ -116,7 +116,7 @@ static int load_module(void) { CHECK_PJSIP_MODULE_LOADED(); - ast_sip_register_endpoint_identifier_by_name(&username_identifier, "username"); + ast_sip_register_endpoint_identifier_with_name(&username_identifier, "username"); return AST_MODULE_LOAD_SUCCESS; }