aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorphsultan <phsultan@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-02 14:40:42 +0000
committerphsultan <phsultan@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-02 14:40:42 +0000
commit26fb791337d4d8eab2862cd9c5f25b6e9e436d06 (patch)
tree37d577d5a4bf93dd19aa95256888d74b934cf82b /res
parent04e6144f2dc67df30af56ef73a970934b9ee40a6 (diff)
Merged revisions 119741 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r119741 | phsultan | 2008-06-02 16:35:24 +0200 (Mon, 02 Jun 2008) | 13 lines 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. Apply this fix to Jingle too. 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: http://svn.digium.com/svn/asterisk/branches/1.6.0@119743 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_jabber.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c
index 653537df4..20189c78d 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -2884,17 +2884,30 @@ static int aji_load_config(int reload)
}
/*!
- * \brief grab a aji_client structure by label name.
- * \param name label name
+ * \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;
}