|
|
@ -28,6 +28,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "asterisk.h"
|
|
|
|
#include "asterisk.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <net/if.h>
|
|
|
|
#include <net/if.h>
|
|
|
@ -287,15 +288,22 @@ static struct http_route *unref_route(struct http_route *route)
|
|
|
|
static int routes_hash_fn(const void *obj, const int flags)
|
|
|
|
static int routes_hash_fn(const void *obj, const int flags)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const struct http_route *route = obj;
|
|
|
|
const struct http_route *route = obj;
|
|
|
|
|
|
|
|
char *tmp, *uri;
|
|
|
|
return ast_str_hash(route->uri);
|
|
|
|
|
|
|
|
|
|
|
|
uri = tmp = ast_strdupa(route->uri);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (*tmp++) {
|
|
|
|
|
|
|
|
*tmp = tolower(*tmp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ast_str_hash(uri);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int routes_cmp_fn(void *obj, void *arg, int flags)
|
|
|
|
static int routes_cmp_fn(void *obj, void *arg, int flags)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const struct http_route *route1 = obj, *route2 = arg;
|
|
|
|
const struct http_route *route1 = obj, *route2 = arg;
|
|
|
|
|
|
|
|
|
|
|
|
return !strcmp(route1->uri, route2->uri) ? CMP_MATCH | CMP_STOP : 0;
|
|
|
|
return !strcasecmp(route1->uri, route2->uri) ? CMP_MATCH | CMP_STOP : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void route_destructor(void *obj)
|
|
|
|
static void route_destructor(void *obj)
|
|
|
@ -776,8 +784,15 @@ static struct user *find_user(const char *macaddress)
|
|
|
|
static int users_hash_fn(const void *obj, const int flags)
|
|
|
|
static int users_hash_fn(const void *obj, const int flags)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const struct user *user = obj;
|
|
|
|
const struct user *user = obj;
|
|
|
|
|
|
|
|
char *tmp, *mac;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mac = tmp = ast_strdupa(user->macaddress);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (*tmp++) {
|
|
|
|
|
|
|
|
*tmp = tolower(*tmp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ast_str_hash(user->macaddress);
|
|
|
|
return ast_str_hash(mac);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int users_cmp_fn(void *obj, void *arg, int flags)
|
|
|
|
static int users_cmp_fn(void *obj, void *arg, int flags)
|
|
|
@ -821,7 +836,6 @@ static void delete_users(void)
|
|
|
|
static struct user *build_user(const char *mac, struct phone_profile *profile)
|
|
|
|
static struct user *build_user(const char *mac, struct phone_profile *profile)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct user *user;
|
|
|
|
struct user *user;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!(user = ao2_alloc(sizeof(*user), user_destructor))) {
|
|
|
|
if (!(user = ao2_alloc(sizeof(*user), user_destructor))) {
|
|
|
|
profile = unref_profile(profile);
|
|
|
|
profile = unref_profile(profile);
|
|
|
|