]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip: Allow configuration of endpoint identifier query order
authorKevin Harwell <kharwell@digium.com>
Tue, 17 Mar 2015 18:34:12 +0000 (18:34 +0000)
committerKevin Harwell <kharwell@digium.com>
Tue, 17 Mar 2015 18:34:12 +0000 (18:34 +0000)
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433031 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/res_pjsip.h
res/res_pjsip.c
res/res_pjsip_endpoint_identifier_anonymous.c
res/res_pjsip_endpoint_identifier_ip.c
res/res_pjsip_endpoint_identifier_user.c

index 2576bc3c146a3512dca50c8917ebff002d4b0c31..70e9c3064f11d395382aa93a66520df25bf09482 100644 (file)
@@ -791,8 +791,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
@@ -811,6 +811,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
index b56b3aec3713947fae4f9ac7b948fdd05e9b7d24..376a16e08ba388e5d81f7a0b7c80682d14f60a30 100644 (file)
@@ -1972,7 +1972,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;
@@ -2054,7 +2054,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)
index f191d99cfb41475946edf9c3eb4984f016d663bb..274c05586894af6438f21929cef7dcaa0fc024f1 100644 (file)
@@ -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;
 }
 
index b97724e3fe56f8079507fe5569f19fe15719655b..5c6e2cc3e8df5387fa52e45e91178d0f8c6ca727 100644 (file)
@@ -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);
index a60057e1478a93087b825585390318dc9a715286..5abf8799994fe816c47cfc0d7dde958ea39b159c 100644 (file)
@@ -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;
 }