[asterisk-commits] branch mogorman/asterisk-xmpp r19611 - in
/team/mogorman/asterisk-xmpp: confi...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Apr 12 15:35:25 MST 2006
Author: mogorman
Date: Wed Apr 12 17:35:24 2006
New Revision: 19611
URL: http://svn.digium.com/view/asterisk?rev=19611&view=rev
Log: (empty)
Modified:
team/mogorman/asterisk-xmpp/configs/jabber.conf.sample
team/mogorman/asterisk-xmpp/configs/jingle.conf.sample
team/mogorman/asterisk-xmpp/res/res_jabber.c
Modified: team/mogorman/asterisk-xmpp/configs/jabber.conf.sample
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/configs/jabber.conf.sample?rev=19611&r1=19610&r2=19611&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/configs/jabber.conf.sample (original)
+++ team/mogorman/asterisk-xmpp/configs/jabber.conf.sample Wed Apr 12 17:35:24 2006
@@ -2,20 +2,6 @@
debug=yes
;noautoprune=yes
;noautoregister=yes
-context=default
-
-disallow=all
-allow=pcmu
-allow=ipcmwb
-allow=isac
-allow=eg711u
-allow=eg711a
-allow=pcma
-allow=ilbc
-allow=g723
-allow=red
-allow=audio/telephone-event
-allow=cn
;[asterisk]
;type=client
@@ -28,6 +14,3 @@
;usesasl=yes
;;allowplaintextauth=no
;buddy=mogorman at astjab.org,2000 at local
-context=default
-
-candidate=name,prefrence,protocol,type
Modified: team/mogorman/asterisk-xmpp/configs/jingle.conf.sample
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/configs/jingle.conf.sample?rev=19611&r1=19610&r2=19611&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/configs/jingle.conf.sample (original)
+++ team/mogorman/asterisk-xmpp/configs/jingle.conf.sample Wed Apr 12 17:35:24 2006
@@ -2,6 +2,7 @@
context=default
allowguest=yes
externip=10.16.13.1
+
disallow=all
allow=pcmu
allow=ipcmwb
Modified: team/mogorman/asterisk-xmpp/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/res/res_jabber.c?rev=19611&r1=19610&r2=19611&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/res/res_jabber.c (original)
+++ team/mogorman/asterisk-xmpp/res/res_jabber.c Wed Apr 12 17:35:24 2006
@@ -80,7 +80,8 @@
static int aji_filter_roster(void *udata,ikspak *pak);
static int aji_dinfo_handler(void *udata,ikspak *pak);
static int aji_ditems_handler(void *udata,ikspak *pak);
-static int aji_register_handler(void *udata,ikspak *pak);
+static int aji_register_query_handler(void *udata,ikspak *pak);
+static int aji_register_approve_handler(void *udata,ikspak *pak);
static char debug_usage[] =
"Usage: JABBER debug\n"
@@ -402,7 +403,8 @@
client->state=AJI_CONNECTED;
iks_filter_add_rule (client->f, aji_dinfo_handler, client, IKS_RULE_NS, "http://jabber.org/protocol/disco#info", IKS_RULE_DONE);
iks_filter_add_rule (client->f, aji_ditems_handler, client, IKS_RULE_NS, "http://jabber.org/protocol/disco#items", IKS_RULE_DONE);
- iks_filter_add_rule (client->f, aji_register_handler, client, IKS_RULE_NS, "jabber:iq:register", IKS_RULE_DONE);
+ iks_filter_add_rule (client->f, aji_register_query_handler, client, IKS_RULE_SUBTYPE, IKS_TYPE_GET,IKS_RULE_NS, "jabber:iq:register", IKS_RULE_DONE);
+ iks_filter_add_rule (client->f, aji_register_approve_handler, client, IKS_RULE_SUBTYPE, IKS_TYPE_SET,IKS_RULE_NS, "jabber:iq:register", IKS_RULE_DONE);
break;
@@ -467,7 +469,34 @@
return IKS_OK;
}
-static int aji_register_handler(void *udata,ikspak *pak)
+static int aji_register_approve_handler(void *udata,ikspak *pak)
+{
+ int res=0;
+ struct aji_client *client;
+ iks *iq, *query;
+ client = (struct aji_client *)malloc(sizeof(struct aji_client));
+ memset(client,0,sizeof(struct aji_client));
+ client =ASTOBJ_REF((struct aji_client *) udata);
+
+ iq = iks_new("iq");
+ query = iks_new("query");
+
+ iks_insert_attrib(iq, "from", client->user);
+ iks_insert_attrib(iq, "to", pak->from->full);
+ iks_insert_attrib(iq, "id", pak->id);
+ iks_insert_attrib(iq, "type", "result");
+ iks_insert_attrib(query, "xmlns", "jabber:iq:register");
+
+ iks_insert_node(iq,query);
+ iks_send(client->p,iq);
+
+ iks_delete(iq);
+ iks_delete(query);
+ return IKS_FILTER_EAT;
+
+}
+
+static int aji_register_query_handler(void *udata,ikspak *pak)
{
int res=0;
struct aji_client *client;
@@ -477,14 +506,11 @@
client =ASTOBJ_REF((struct aji_client *) udata);
if(!(node = iks_find_attrib(pak->query,"node"))) {
- iks *iq, *query, *instructions, *username, *password;
- char * explain = "Welcome to Asterisk the Open Source PBX.\n"
- "Please enter your username and password.";
+ iks *iq, *query, *instructions;
+ char * explain = "Welcome to Asterisk the Open Source PBX.\n";
iq = iks_new("iq");
query = iks_new("query");
instructions = iks_new("instructions");
- username = iks_new("username");
- password = iks_new("password");
iks_insert_attrib(iq, "from", client->user);
iks_insert_attrib(iq, "to", pak->from->full);
@@ -494,15 +520,11 @@
iks_insert_cdata(instructions, explain, 0);
iks_insert_node(iq,query);
iks_insert_node(query,instructions);
- iks_insert_node(query,username);
- iks_insert_node(query,password);
iks_send(client->p,iq);
iks_delete(iq);
iks_delete(query);
iks_delete(instructions);
- iks_delete(username);
- iks_delete(password);
}
return IKS_FILTER_EAT;
}
More information about the asterisk-commits
mailing list