[asterisk-commits] branch mogorman/asterisk-xmpp r10690 - in /team/mogorman/asterisk-xmpp: chann...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Feb 21 15:49:18 MST 2006


Author: mogorman
Date: Tue Feb 21 16:49:17 2006
New Revision: 10690

URL: http://svn.digium.com/view/asterisk?rev=10690&view=rev
Log:
about to start with clean chan_xmpp.c

Modified:
    team/mogorman/asterisk-xmpp/channels/chan_xmpp.c
    team/mogorman/asterisk-xmpp/configs/xmpp.conf.sample
    team/mogorman/asterisk-xmpp/include/asterisk/xmpp.h
    team/mogorman/asterisk-xmpp/res/res_xmpp.c

Modified: team/mogorman/asterisk-xmpp/channels/chan_xmpp.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/channels/chan_xmpp.c?rev=10690&r1=10689&r2=10690&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/channels/chan_xmpp.c (original)
+++ team/mogorman/asterisk-xmpp/channels/chan_xmpp.c Tue Feb 21 16:49:17 2006
@@ -641,6 +641,8 @@
 		ast_verbose("yatta!!\n");
 		codec= iks_next(codec);
 	}
+	ast_pbx_start(chan);
+	p->owner = chan;
 	ast_mutex_unlock(&p->lock);
 	accept = iks_new("iq");
 	iks_insert_attrib(accept,"type","result");
@@ -918,18 +920,18 @@
 /*! \brief Hangup a call through the xmpp proxy channel */
 static int xmpp_hangup(struct ast_channel *ast)
 {
+	return 0;
 	struct xmpp_pvt *p = ast->tech_pvt;
 	struct axi_client *client = NULL;
 	client = ast_axi_get_client("asterisk");
 	int isoutbound;
-//	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
+	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
 	struct xmpp_pvt *cur, *prev=NULL;
 	struct ast_channel *ochan = NULL;
-//	int glaredetect;
+	int glaredetect;
 	const char *status;
 
 	ast_mutex_lock(&p->lock);
-//	isoutbound = IS_OUTBOUND(ast, p);
 	if (isoutbound) {
 //		status = pbx_builtin_getvar_helper(p->chan, "DIALSTATUS");
 		if(status)

Modified: team/mogorman/asterisk-xmpp/configs/xmpp.conf.sample
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/configs/xmpp.conf.sample?rev=10690&r1=10689&r2=10690&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/configs/xmpp.conf.sample (original)
+++ team/mogorman/asterisk-xmpp/configs/xmpp.conf.sample Tue Feb 21 16:49:17 2006
@@ -2,7 +2,7 @@
 debug=yes
 ;noautoprune=yes
 ;noautoregister=yes
-
+context=default
 
 disallow=all
 allow=pcmu
@@ -28,5 +28,6 @@
 ;usesasl=yes
 ;;allowplaintextauth=no
 ;buddy=mogorman at astjab.org,2000 at local
+context=default
 
 candidate=name,prefrence,protocol,type

Modified: team/mogorman/asterisk-xmpp/include/asterisk/xmpp.h
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/include/asterisk/xmpp.h?rev=10690&r1=10689&r2=10690&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/include/asterisk/xmpp.h (original)
+++ team/mogorman/asterisk-xmpp/include/asterisk/xmpp.h Tue Feb 21 16:49:17 2006
@@ -109,6 +109,7 @@
 	char user[160];
 	char server[160];
 	char serverhost[160];
+	char context[100];
 	char sid[10]; /* Session ID */
 	char mid[6]; /* Message ID */
 	iksid *jid;

Modified: team/mogorman/asterisk-xmpp/res/res_xmpp.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/res/res_xmpp.c?rev=10690&r1=10689&r2=10690&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/res/res_xmpp.c (original)
+++ team/mogorman/asterisk-xmpp/res/res_xmpp.c Tue Feb 21 16:49:17 2006
@@ -78,7 +78,7 @@
 static int axi_test(int fd, int argc, char *argv[]);
 static int axi_show_clients(int fd, int argc, char *argv[]);
 static int axi_register_struct(struct axi_action *act);
-static int *axi_create_client(char *label,struct ast_variable *var,int debug,int pruneregister,char *utype, struct ast_codec_pref prefs, struct axi_client *client);
+static int *axi_create_client(char *label,struct ast_variable *var,int debug,int pruneregister,char *utype, char *context, struct ast_codec_pref prefs, struct axi_client *client);
 static int *axi_create_buddy(char *label, struct axi_buddy *buddy);
 static int *axi_create_transport(char *label, struct axi_buddy *buddy);
 static int axi_load_config(void);
@@ -1270,7 +1270,7 @@
 	return res;
 }
 
-static int *axi_create_client(char *label,struct ast_variable *var, int debug, int pruneregister,char *utype, struct ast_codec_pref prefs, struct axi_client *client)
+static int *axi_create_client(char *label,struct ast_variable *var, int debug, int pruneregister,char *utype, char *context, struct ast_codec_pref prefs, struct axi_client *client)
 {
 	struct axi_buddy *buddy;
 	struct axi_candidate *sc;
@@ -1279,6 +1279,7 @@
 		ast_log(LOG_WARNING, "Out of memory\n");
 	ast_copy_string(client->name, label,sizeof(client->name));
 	ast_copy_string(client->mid, "aaaaa",sizeof(client->mid));
+	ast_copy_string(client->context, context, sizeof(client->context));
 
 	client->debug = debug;
 	client->pruneregister = pruneregister;
@@ -1311,6 +1312,8 @@
 			ast_copy_string(client->externip, var->value, sizeof(client->externip));
 		else if(!strcasecmp(var->name,"localip"))
 			ast_copy_string(client->localip,var->value,sizeof(client->localip));
+		else if(!strcasecmp(var->name,"context"))
+			ast_copy_string(client->context,var->value,sizeof(client->context));
 		else if(!strcasecmp(var->name,"port"))
 			client->port=atoi(var->value);
 		else if(!strcasecmp(var->name,"debug"))
@@ -1403,12 +1406,14 @@
 {
 	char *cat=NULL;
 	char *utype=NULL;
+	char context[100];
 	int debug=1, pruneregister=3;
 	struct ast_config *cfg=NULL;
 	struct ast_variable *var;
 	struct axi_client *client;
 	struct ast_codec_pref prefs;
 
+	ast_copy_string(context,"default",sizeof(context));
 	cfg = ast_config_load(XMPP_CONFIG);
 	if(!cfg) {
 		ast_log(LOG_WARNING, "No such configuration file %s\n", XMPP_CONFIG);
@@ -1424,6 +1429,8 @@
 			pruneregister = (ast_false(ast_variable_retrieve(cfg,"general","noautoprune")))?pruneregister:pruneregister--;
 		else if(!strcasecmp(var->name, "noautoregister"))
 			pruneregister = (ast_false(ast_variable_retrieve(cfg,"general","noautoregister")))?pruneregister:pruneregister-2;
+		else if(!strcasecmp(var->name, "context"))
+			ast_copy_string(context,var->value,sizeof(context));
 		else if (!strcasecmp(var->name, "disallow")) 
 			ast_parse_allow_disallow(&prefs, &global_capability, var->value, 0);
 		else if (!strcasecmp(var->name, "allow")) 
@@ -1439,7 +1446,7 @@
 				memset(client,0,sizeof(struct axi_client));
 				ASTOBJ_INIT(client);
 				ASTOBJ_WRLOCK(client);
-				axi_create_client(cat, var, debug, pruneregister, utype, prefs, client);
+				axi_create_client(cat, var, debug, pruneregister, utype, context, prefs, client);
 				ASTOBJ_UNLOCK(client);
 				ASTOBJ_CONTAINER_LINK(&clients,client);
 				ASTOBJ_UNREF(client,axi_client_destroy);



More information about the asterisk-commits mailing list