Do not link the guest account with any configured XMPP client (in

jabber.conf). The actual connection is made when a call comes in
Asterisk.

Fix the ast_aji_get_client function that was not able to retrieve an
XMPP client from its JID.

(closes issue #12085)
Reported by: junky
Tested by: phsultan

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Philippe Sultan
2008-06-02 14:32:53 +00:00
parent 35ea2643d4
commit 59410a3f01
2 changed files with 44 additions and 15 deletions

View File

@@ -2359,17 +2359,30 @@ static int aji_load_config(void)
}
/*!
* \brief grab a aji_client structure by label name.
* \param void.
* \return 1.
* \brief grab a aji_client structure by label name or JID
* (without the resource string)
* \param name label or JID
* \return aji_client.
*/
struct aji_client *ast_aji_get_client(const char *name)
{
struct aji_client *client = NULL;
char *aux = NULL;
client = ASTOBJ_CONTAINER_FIND(&clients, name);
if (!client && !strchr(name, '@'))
client = ASTOBJ_CONTAINER_FIND_FULL(&clients, name, user,,, strcasecmp);
if (!client && strchr(name, '@')) {
ASTOBJ_CONTAINER_TRAVERSE(&clients, 1, {
aux = ast_strdupa(iterator->user);
if (strchr(aux, '/')) {
/* strip resource for comparison */
aux = strsep(&aux, "/");
}
if (!strcasecmp(aux, name)) {
client = iterator;
}
});
}
return client;
}