mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 08:13:22 +00:00
fix issue with dialing client without resource.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -878,7 +878,8 @@ static struct gtalk_pvt *gtalk_alloc(struct gtalk *client, const char *us, const
|
|||||||
data = ast_strdupa((char *) tmp->us);
|
data = ast_strdupa((char *) tmp->us);
|
||||||
exten = strsep(&data, "/");
|
exten = strsep(&data, "/");
|
||||||
free(data);
|
free(data);
|
||||||
}
|
} else
|
||||||
|
exten = tmp->us;
|
||||||
ast_copy_string(tmp->exten, exten, sizeof(tmp->exten));
|
ast_copy_string(tmp->exten, exten, sizeof(tmp->exten));
|
||||||
ast_mutex_init(&tmp->lock);
|
ast_mutex_init(&tmp->lock);
|
||||||
ast_mutex_lock(>alklock);
|
ast_mutex_lock(>alklock);
|
||||||
@@ -1512,6 +1513,7 @@ static int gtalk_do_reload(int fd, int argc, char **argv)
|
|||||||
ast_verbose("IT DOES WORK!\n");
|
ast_verbose("IT DOES WORK!\n");
|
||||||
return RESULT_SUCCESS;
|
return RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gtalk_parser(void *data, ikspak *pak)
|
static int gtalk_parser(void *data, ikspak *pak)
|
||||||
{
|
{
|
||||||
struct gtalk *client = ASTOBJ_REF((struct gtalk *) data);
|
struct gtalk *client = ASTOBJ_REF((struct gtalk *) data);
|
||||||
@@ -1537,6 +1539,7 @@ static int gtalk_parser(void *data, ikspak *pak)
|
|||||||
ASTOBJ_UNREF(client, gtalk_member_destroy);
|
ASTOBJ_UNREF(client, gtalk_member_destroy);
|
||||||
return IKS_FILTER_EAT;
|
return IKS_FILTER_EAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not using this anymore probably take out soon
|
/* Not using this anymore probably take out soon
|
||||||
static struct gtalk_candidate *gtalk_create_candidate(char *args)
|
static struct gtalk_candidate *gtalk_create_candidate(char *args)
|
||||||
{
|
{
|
||||||
@@ -1627,6 +1630,7 @@ static int gtalk_create_member(char *label, struct ast_variable *var, int allowg
|
|||||||
IKS_PAK_IQ, IKS_RULE_FROM_PARTIAL, member->user,
|
IKS_PAK_IQ, IKS_RULE_FROM_PARTIAL, member->user,
|
||||||
IKS_RULE_NS, "http://www.google.com/session",
|
IKS_RULE_NS, "http://www.google.com/session",
|
||||||
IKS_RULE_DONE);
|
IKS_RULE_DONE);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_ERROR, "connection referenced not found!\n");
|
ast_log(LOG_ERROR, "connection referenced not found!\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -871,7 +871,6 @@ static int aji_client_info_handler(void *data, ikspak *pak)
|
|||||||
struct aji_buddy *buddy = ASTOBJ_CONTAINER_FIND(&client->buddies, pak->from->partial);
|
struct aji_buddy *buddy = ASTOBJ_CONTAINER_FIND(&client->buddies, pak->from->partial);
|
||||||
|
|
||||||
resource = aji_find_resource(buddy, pak->from->resource);
|
resource = aji_find_resource(buddy, pak->from->resource);
|
||||||
|
|
||||||
if (pak->subtype == IKS_TYPE_RESULT) {
|
if (pak->subtype == IKS_TYPE_RESULT) {
|
||||||
if (!resource) {
|
if (!resource) {
|
||||||
ast_log(LOG_NOTICE,"JABBER: Received client info from %s when not requested.\n", pak->from->full);
|
ast_log(LOG_NOTICE,"JABBER: Received client info from %s when not requested.\n", pak->from->full);
|
||||||
@@ -927,13 +926,26 @@ static int aji_client_info_handler(void *data, ikspak *pak)
|
|||||||
static int aji_dinfo_handler(void *data, ikspak *pak)
|
static int aji_dinfo_handler(void *data, ikspak *pak)
|
||||||
{
|
{
|
||||||
struct aji_client *client = ASTOBJ_REF((struct aji_client *) data);
|
struct aji_client *client = ASTOBJ_REF((struct aji_client *) data);
|
||||||
char *node = NULL, *type = NULL;
|
char *node = NULL;
|
||||||
type = iks_find_attrib(pak->x,"type");
|
struct aji_resource *resource = NULL;
|
||||||
if (!strcasecmp(type,"error")) {
|
struct aji_buddy *buddy = ASTOBJ_CONTAINER_FIND(&client->buddies, pak->from->partial);
|
||||||
|
|
||||||
|
resource = aji_find_resource(buddy, pak->from->resource);
|
||||||
|
if (pak->subtype == IKS_TYPE_ERROR) {
|
||||||
ast_log(LOG_WARNING, "Recieved error from a client, turn on jabber debug!\n");
|
ast_log(LOG_WARNING, "Recieved error from a client, turn on jabber debug!\n");
|
||||||
return IKS_FILTER_EAT;
|
return IKS_FILTER_EAT;
|
||||||
}
|
}
|
||||||
if (!strcasecmp(type,"get") && !(node = iks_find_attrib(pak->query, "node"))) {
|
if (pak->subtype == IKS_TYPE_RESULT) {
|
||||||
|
if (!resource) {
|
||||||
|
ast_log(LOG_NOTICE,"JABBER: Received client info from %s when not requested.\n", pak->from->full);
|
||||||
|
ASTOBJ_UNREF(client, aji_client_destroy);
|
||||||
|
return IKS_FILTER_EAT;
|
||||||
|
}
|
||||||
|
if (iks_find_with_attrib(pak->query, "feature", "var", "http://www.google.com/xmpp/protocol/voice/v1")) {
|
||||||
|
resource->cap->jingle = 1;
|
||||||
|
} else
|
||||||
|
resource->cap->jingle = 0;
|
||||||
|
} else if (pak->subtype == IKS_TYPE_GET && !(node = iks_find_attrib(pak->query, "node"))) {
|
||||||
iks *iq, *query, *identity, *disco, *reg, *commands, *gateway, *version, *vcard, *search;
|
iks *iq, *query, *identity, *disco, *reg, *commands, *gateway, *version, *vcard, *search;
|
||||||
|
|
||||||
iq = iks_new("iq");
|
iq = iks_new("iq");
|
||||||
@@ -999,7 +1011,7 @@ static int aji_dinfo_handler(void *data, ikspak *pak)
|
|||||||
if (search)
|
if (search)
|
||||||
iks_delete(search);
|
iks_delete(search);
|
||||||
|
|
||||||
} else if (!strcasecmp(type,"get") && !strcasecmp(node, "http://jabber.org/protocol/commands")) {
|
} else if (pak->subtype == IKS_TYPE_GET && !strcasecmp(node, "http://jabber.org/protocol/commands")) {
|
||||||
iks *iq, *query, *confirm;
|
iks *iq, *query, *confirm;
|
||||||
iq = iks_new("iq");
|
iq = iks_new("iq");
|
||||||
query = iks_new("query");
|
query = iks_new("query");
|
||||||
@@ -1028,7 +1040,7 @@ static int aji_dinfo_handler(void *data, ikspak *pak)
|
|||||||
if (confirm)
|
if (confirm)
|
||||||
iks_delete(confirm);
|
iks_delete(confirm);
|
||||||
|
|
||||||
} else if (!strcasecmp(type,"get") && !strcasecmp(node, "confirmaccount")) {
|
} else if (pak->subtype == IKS_TYPE_GET && !strcasecmp(node, "confirmaccount")) {
|
||||||
iks *iq, *query, *feature;
|
iks *iq, *query, *feature;
|
||||||
|
|
||||||
iq = iks_new("iq");
|
iq = iks_new("iq");
|
||||||
|
Reference in New Issue
Block a user