[Asterisk-code-review] res pjsip/location.c: Use the builtin ao2 callback() match f... (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Thu Sep 10 13:19:13 CDT 2015


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/1246

Change subject: res_pjsip/location.c: Use the builtin ao2_callback() match function instead.
......................................................................

res_pjsip/location.c: Use the builtin ao2_callback() match function instead.

Change-Id: I364906d6d2bad3472929986704a0286b9a2cbe3f
---
M res/res_pjsip/location.c
1 file changed, 2 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/46/1246/1

diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c
index 587e38a..9625f04 100644
--- a/res/res_pjsip/location.c
+++ b/res/res_pjsip/location.c
@@ -137,12 +137,6 @@
 	return 0;
 }
 
-/*! \brief Simple callback function which returns immediately, used to grab the first contact of an AOR */
-static int contact_find_first(void *obj, void *arg, int flags)
-{
-	return CMP_MATCH | CMP_STOP;
-}
-
 struct ast_sip_contact *ast_sip_location_retrieve_first_aor_contact(const struct ast_sip_aor *aor)
 {
 	RAII_VAR(struct ao2_container *, contacts, NULL, ao2_cleanup);
@@ -153,7 +147,8 @@
 		return NULL;
 	}
 
-	contact = ao2_callback(contacts, 0, contact_find_first, NULL);
+	/* Get the first AOR contact in the container. */
+	contact = ao2_callback(contacts, 0, NULL, NULL);
 	return contact;
 }
 

-- 
To view, visit https://gerrit.asterisk.org/1246
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I364906d6d2bad3472929986704a0286b9a2cbe3f
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list