aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-25 01:01:49 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-25 01:01:49 +0000
commit3ce5f8f4ee27228b26f6d39d9e1cf75f439995a7 (patch)
tree6af2cfc1b0ec46aa179c5019f00274f1eba84fce /channels/chan_iax2.c
parent7bf3c44abe26f6ce1dc917c33e5ed4a98e80776d (diff)
This is basically a complete rollback of r155401, as it was determined that
it would be best to maintain API compatibility. Instead, this commit introduces ao2_callback_data() which is functionally identical to ao2_callback() except that it allows you to pass arbitrary data to the callback. Reviewed by Mark Michelson via ReviewBoard: http://reviewboard.digium.com/r/64 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@158959 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r--channels/chan_iax2.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index b618d03c1..7aff8f8a5 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1400,7 +1400,7 @@ static int peer_hash_cb(const void *obj, const int flags)
/*!
* \note The only member of the peer passed here guaranteed to be set is the name field
*/
-static int peer_cmp_cb(void *obj, void *arg, void *data, int flags)
+static int peer_cmp_cb(void *obj, void *arg, int flags)
{
struct iax2_peer *peer = obj, *peer2 = arg;
@@ -1420,7 +1420,7 @@ static int user_hash_cb(const void *obj, const int flags)
/*!
* \note The only member of the user passed here guaranteed to be set is the name field
*/
-static int user_cmp_cb(void *obj, void *arg, void *data, int flags)
+static int user_cmp_cb(void *obj, void *arg, int flags)
{
struct iax2_user *user = obj, *user2 = arg;
@@ -1438,7 +1438,7 @@ static struct iax2_peer *find_peer(const char *name, int realtime)
.name = name,
};
- peer = ao2_find(peers, &tmp_peer, NULL, OBJ_POINTER);
+ peer = ao2_find(peers, &tmp_peer, OBJ_POINTER);
/* Now go for realtime if applicable */
if(!peer && realtime)
@@ -1512,7 +1512,7 @@ static void iax2_destroy_helper(struct chan_iax2_pvt *pvt)
.name = pvt->username,
};
- user = ao2_find(users, &tmp_user, NULL, OBJ_POINTER);
+ user = ao2_find(users, &tmp_user, OBJ_POINTER);
if (user) {
ast_atomic_fetchadd_int(&user->curauthreq, -1);
user_unref(user);
@@ -1793,7 +1793,7 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s
memcpy(&tmp_pvt.addr, sin, sizeof(tmp_pvt.addr));
- if ((pvt = ao2_find(iax_peercallno_pvts, &tmp_pvt, NULL, OBJ_POINTER))) {
+ if ((pvt = ao2_find(iax_peercallno_pvts, &tmp_pvt, OBJ_POINTER))) {
if (return_locked) {
ast_mutex_lock(&iaxsl[pvt->callno]);
}
@@ -5431,7 +5431,7 @@ static char *handle_cli_iax2_unregister(struct ast_cli_entry *e, int cmd, struct
};
struct iax2_peer *peer;
- peer = ao2_find(peers, &tmp_peer, NULL, OBJ_POINTER);
+ peer = ao2_find(peers, &tmp_peer, OBJ_POINTER);
if (peer) {
expire_registry(peer_ref(peer)); /* will release its own reference when done */
peer_unref(peer); /* ref from ao2_find() */
@@ -6323,7 +6323,7 @@ static int authenticate_request(int call_num)
.name = p->username,
};
- user = ao2_find(users, &tmp_user, NULL, OBJ_POINTER);
+ user = ao2_find(users, &tmp_user, OBJ_POINTER);
if (user) {
if (user->curauthreq == user->maxauthreq)
authreq_restrict = 1;
@@ -6373,7 +6373,7 @@ static int authenticate_verify(struct chan_iax2_pvt *p, struct iax_ies *ies)
.name = p->username,
};
- user = ao2_find(users, &tmp_user, NULL, OBJ_POINTER);
+ user = ao2_find(users, &tmp_user, OBJ_POINTER);
if (user) {
if (ast_test_flag(p, IAX_MAXAUTHREQ)) {
ast_atomic_fetchadd_int(&user->curauthreq, -1);
@@ -10250,7 +10250,7 @@ static int iax2_poke_noanswer(const void *data)
return 0;
}
-static int iax2_poke_peer_cb(void *obj, void *arg, void *data, int flags)
+static int iax2_poke_peer_cb(void *obj, void *arg, int flags)
{
struct iax2_peer *peer = obj;
@@ -10690,7 +10690,7 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st
};
if (!temponly) {
- peer = ao2_find(peers, &tmp_peer, NULL, OBJ_POINTER);
+ peer = ao2_find(peers, &tmp_peer, OBJ_POINTER);
if (peer && !ast_test_flag(peer, IAX_DELME))
firstpass = 0;
}
@@ -10944,7 +10944,7 @@ static struct iax2_user *build_user(const char *name, struct ast_variable *v, st
};
if (!temponly) {
- user = ao2_find(users, &tmp_user, NULL, OBJ_POINTER);
+ user = ao2_find(users, &tmp_user, OBJ_POINTER);
if (user && !ast_test_flag(user, IAX_DELME))
firstpass = 0;
}
@@ -11144,7 +11144,7 @@ cleanup:
return user;
}
-static int peer_delme_cb(void *obj, void *arg, void *data, int flags)
+static int peer_delme_cb(void *obj, void *arg, int flags)
{
struct iax2_peer *peer = obj;
@@ -11153,7 +11153,7 @@ static int peer_delme_cb(void *obj, void *arg, void *data, int flags)
return 0;
}
-static int user_delme_cb(void *obj, void *arg, void *data, int flags)
+static int user_delme_cb(void *obj, void *arg, int flags)
{
struct iax2_user *user = obj;
@@ -11166,7 +11166,7 @@ static void delete_users(void)
{
struct iax2_registry *reg;
- ao2_callback(users, 0, user_delme_cb, NULL, NULL);
+ ao2_callback(users, 0, user_delme_cb, NULL);
AST_LIST_LOCK(&registrations);
while ((reg = AST_LIST_REMOVE_HEAD(&registrations, entry))) {
@@ -11186,7 +11186,7 @@ static void delete_users(void)
}
AST_LIST_UNLOCK(&registrations);
- ao2_callback(peers, 0, peer_delme_cb, NULL, NULL);
+ ao2_callback(peers, 0, peer_delme_cb, NULL);
}
static void prune_users(void)
@@ -12434,7 +12434,7 @@ static int unload_module(void)
return __unload_module();
}
-static int peer_set_sock_cb(void *obj, void *arg, void *data, int flags)
+static int peer_set_sock_cb(void *obj, void *arg, int flags)
{
struct iax2_peer *peer = obj;
@@ -12451,7 +12451,7 @@ static int pvt_hash_cb(const void *obj, const int flags)
return pvt->peercallno;
}
-static int pvt_cmp_cb(void *obj, void *arg, void *data, int flags)
+static int pvt_cmp_cb(void *obj, void *arg, int flags)
{
struct chan_iax2_pvt *pvt = obj, *pvt2 = arg;
@@ -12565,8 +12565,8 @@ static int load_module(void)
iax2_do_register(reg);
AST_LIST_UNLOCK(&registrations);
- ao2_callback(peers, 0, peer_set_sock_cb, NULL, NULL);
- ao2_callback(peers, 0, iax2_poke_peer_cb, NULL, NULL);
+ ao2_callback(peers, 0, peer_set_sock_cb, NULL);
+ ao2_callback(peers, 0, iax2_poke_peer_cb, NULL);
reload_firmware(0);