[asterisk-commits] branch group/asterisk-xmpp r26163 - in
/team/group/asterisk-xmpp: configs/ res/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue May 9 09:05:17 MST 2006
Author: russell
Date: Tue May 9 11:05:17 2006
New Revision: 26163
URL: http://svn.digium.com/view/asterisk?rev=26163&view=rev
Log:
- don't enable jabber debug in the sample config by default
- change the jabber test CLI command to accept an argument to specify which
client to use for the test, and don't crash if the client isn't found
Modified:
team/group/asterisk-xmpp/configs/jabber.conf.sample
team/group/asterisk-xmpp/res/res_jabber.c
Modified: team/group/asterisk-xmpp/configs/jabber.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-xmpp/configs/jabber.conf.sample?rev=26163&r1=26162&r2=26163&view=diff
==============================================================================
--- team/group/asterisk-xmpp/configs/jabber.conf.sample (original)
+++ team/group/asterisk-xmpp/configs/jabber.conf.sample Tue May 9 11:05:17 2006
@@ -1,5 +1,5 @@
[general]
-debug=yes
+;debug=yes
;autoprune=yes
;autoregister=yes
Modified: team/group/asterisk-xmpp/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-xmpp/res/res_jabber.c?rev=26163&r1=26162&r2=26163&view=diff
==============================================================================
--- team/group/asterisk-xmpp/res/res_jabber.c (original)
+++ team/group/asterisk-xmpp/res/res_jabber.c Tue May 9 11:05:17 2006
@@ -1776,29 +1776,37 @@
{
struct aji_client *client;
struct aji_resource *resource;
- client = ASTOBJ_CONTAINER_FIND(&clients, "asterisk");
+ const char *name = "asterisk";
+
+ if (argc > 3)
+ return RESULT_SHOWUSAGE;
+ else if (argc == 3)
+ name = argv[2];
+
+ if (!(client = ASTOBJ_CONTAINER_FIND(&clients, name))) {
+ ast_cli(fd, "Unable to find client '%s'!\n", name);
+ return RESULT_FAILURE;
+ }
+
ast_aji_send(client, "mogorman at astjab.org", "blahblah");
- if (client) {
- ASTOBJ_CONTAINER_TRAVERSE(&client->buddies, 1, {
- ASTOBJ_RDLOCK(iterator);
- ast_verbose("User: %s\n", iterator->name);
- ast_verbose("User: %s\n", iterator->user);
- ast_verbose("Pass: %s\n", iterator->pass);
- ast_verbose("Host: %s\n", iterator->host);
- for (resource = iterator->resources; resource; resource = resource->next) {
- ast_verbose("Resource: %s\n", resource->resource);
- ast_verbose(" Jingle Capable: %d\n", resource->jinglecapable);
- ast_verbose(" Priority: %d\n", resource->priority);
- ast_verbose(" Status: %d\n", resource->status);
- ast_verbose(" Message: %s\n", resource->description);
- }
- ast_verbose("DefChannel: %s\n\n", iterator->channel);
- ASTOBJ_UNLOCK(iterator);
- });
- }
-
- if (client)
- ASTOBJ_UNREF(client, aji_client_destroy);
+ ASTOBJ_CONTAINER_TRAVERSE(&client->buddies, 1, {
+ ASTOBJ_RDLOCK(iterator);
+ ast_verbose("User: %s\n", iterator->name);
+ ast_verbose("User: %s\n", iterator->user);
+ ast_verbose("Pass: %s\n", iterator->pass);
+ ast_verbose("Host: %s\n", iterator->host);
+ for (resource = iterator->resources; resource; resource = resource->next) {
+ ast_verbose("Resource: %s\n", resource->resource);
+ ast_verbose(" Jingle Capable: %d\n", resource->jinglecapable);
+ ast_verbose(" Priority: %d\n", resource->priority);
+ ast_verbose(" Status: %d\n", resource->status);
+ ast_verbose(" Message: %s\n", resource->description);
+ }
+ ast_verbose("DefChannel: %s\n\n", iterator->channel);
+ ASTOBJ_UNLOCK(iterator);
+ });
+
+ ASTOBJ_UNREF(client, aji_client_destroy);
return RESULT_SUCCESS;
}
More information about the asterisk-commits
mailing list