[asterisk-commits] branch mogorman/asterisk-xmpp r9347 - in /team/mogorman/asterisk-xmpp: channe...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Feb 9 16:49:01 MST 2006


Author: mogorman
Date: Thu Feb  9 17:48:59 2006
New Revision: 9347

URL: http://svn.digium.com/view/asterisk?rev=9347&view=rev
Log:
some minor updates, still doesnt do what it should.

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

Modified: team/mogorman/asterisk-xmpp/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/channels/Makefile?rev=9347&r1=9346&r2=9347&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/channels/Makefile (original)
+++ team/mogorman/asterisk-xmpp/channels/Makefile Thu Feb  9 17:48:59 2006
@@ -59,11 +59,11 @@
 
 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/iksemel.h),)
   CHANNEL_LIBS+=chan_xmpp.so
-  XMPPLIB=$(CROSS_COMPILE_TARGET)/usr/local/lib/libiksemel.a
+  XMPPLIB=$(CROSS_COMPILE_TARGET)/usr/local/lib/libiksemel.so
   else
      ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/iksemel.h),)
        CHANNEL_LIBS+=chan_xmpp.so
-       XMPPLIB=$(CROSS_COMPILE_TARGET)/usr/lib/libiksemel.a
+       XMPPLIB=$(CROSS_COMPILE_TARGET)/usr/lib/libiksemel.so
      endif
   endif
 
@@ -241,7 +241,7 @@
 	$(CC) $(CFLAGS) -DCHAN_MISDN_VERSION=\"0.2.1\" -c $< -o $@
 
 chan_xmpp.so: chan_xmpp.o
-	$(CC) $(SOLINK) -o $@ $< $(XMPP_LIB) 
+	$(CC) $(SOLINK) -o $@ $< $(XMPPLIB) 
 
 install: all
 	for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done

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=9347&r1=9346&r2=9347&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/channels/chan_xmpp.c (original)
+++ team/mogorman/asterisk-xmpp/channels/chan_xmpp.c Thu Feb  9 17:48:59 2006
@@ -244,9 +244,6 @@
 		iks_insert_attrib(candidate3, "type", "relay");
 		iks_insert_attrib(candidate3, "network", "0");
 		iks_insert_attrib(candidate3, "generation", "0");
-
-
-
 
 		
 		iks_insert_node(iq1,jingle1);

Modified: team/mogorman/asterisk-xmpp/configs/xmpp.conf
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/configs/xmpp.conf?rev=9347&r1=9346&r2=9347&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/configs/xmpp.conf (original)
+++ team/mogorman/asterisk-xmpp/configs/xmpp.conf Thu Feb  9 17:48:59 2006
@@ -4,6 +4,18 @@
 ;noautoregister=yes
 
 
+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
@@ -17,3 +29,4 @@
 ;;allowplaintextauth=no
 ;buddy=mogorman at astjab.org,2000 at local
 
+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=9347&r1=9346&r2=9347&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/include/asterisk/xmpp.h (original)
+++ team/mogorman/asterisk-xmpp/include/asterisk/xmpp.h Thu Feb  9 17:48:59 2006
@@ -68,6 +68,13 @@
 	int port;
 	int receipt;
 	struct axi_candidate *next;
+};
+
+struct axi_send_candidate {
+	iks *iq;
+	iks *jingle;
+	iks *candidate;
+	struct axi_send_candidate *next;
 };
 
 struct axi_buddy {
@@ -126,7 +133,8 @@
 	char localip[16];
 	enum axi_type component;
 	struct axi_buddy_container buddies;
-	struct axi_candidate *candidates;
+	struct axi_send_candidate *candidates;
+	iks *accept;
 	struct xmpp_pvt *xmpps;
 	pthread_t thread;
 };

Modified: team/mogorman/asterisk-xmpp/res/Makefile
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/res/Makefile?rev=9347&r1=9346&r2=9347&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/res/Makefile (original)
+++ team/mogorman/asterisk-xmpp/res/Makefile Thu Feb  9 17:48:59 2006
@@ -52,15 +52,13 @@
 
 CRYPTO_LIBS=-lssl -lcrypto
 
-XMPP_LIB=-liksemel
-
 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/iksemel.h),)
   MODS+=res_xmpp.so
-  XMPPLIB=$(CROSS_COMPILE_TARGET)/usr/local/lib/libiksemel.a
+  XMPPLIB=$(CROSS_COMPILE_TARGET)/usr/local/lib/libiksemel.so
   else
      ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/iksemel.h),)
        MODS+=res_xmpp.so
-       XMPPLIB=$(CROSS_COMPILE_TARGET)/usr/lib/libiksemel.a
+       XMPPLIB=$(CROSS_COMPILE_TARGET)/usr/lib/libiksemel.so
      endif
   endif
 
@@ -104,7 +102,7 @@
 	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CRYPTO_LIBS)
 
 res_xmpp.so: res_xmpp.o
-	$(CC) $(SOLINK) -o $@ $< $(XMPP_LIB) 
+	$(CC) $(SOLINK) -o $@ $< $(XMPPLIB) 
 
 clean:
 	rm -f *.so *.o .depend

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=9347&r1=9346&r2=9347&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/res/res_xmpp.c (original)
+++ team/mogorman/asterisk-xmpp/res/res_xmpp.c Thu Feb  9 17:48:59 2006
@@ -432,7 +432,6 @@
 		if(iks_packet(node)->subtype==IKS_TYPE_SET) {
 			if(iks_find_with_attrib(iks_packet(node)->x,GOOGLE_NODE,"xmlns",GOOGLE_NS))
 				jingle_callback(client,iks_copy(node));
-	//			axi_handle_jingle(client,pak);
 		}
 }
 
@@ -1082,30 +1081,7 @@
 		});
 	return RESULT_SUCCESS;
 }
-static int axi_send_call(struct axi_client *client, char *reciever)
-{
-	char *text = "<iq to='ogorman at gmail.com/Talk.v84FC2E45A7' from='asterisk2 at astjab.org/asterisk' type='set' id='42'><session type='initiate' id='2862583438' initiator='asterisk2 at astjab.org/asterisk' xmlns='http://www.google.com/session'><description xmlns='http://www.google.com/session/phone'><payload-type id='97' name='IPCMWB'/><payload-type id='103' name='ISAC'/><payload-type id='100' name='EG711U'/><payload-type id='101' name='EG711A'/><payload-type id='0' name='PCMU'/><payload-type id='8' name='PCMA'/><payload-type id='102' name='iLBC'/><payload-type id='4' name='G723'/><payload-type id='117' name='red'/><payload-type id='106' name='audio/telephone-event'/><payload-type id='13' name='CN'/></description></session></iq>";
-		
-//		"<iq to='ogorman at gmail.com/Talk.v84FC2E45A7' from='asterisk2 at astjab.org/asterisk' id='jingle1' type='set'> "
-//"  <jingle xmlns='http://jabber.org/protocol/jingle'  action='initiate' initiator='asterisk2 at astjab.org/asterisk' sid='a73sjjvkla37jfea'> "
-//"<description xmlns='http://jabber.org/protocol/jingle/sessions/audio'> "
-//"<payload-type id='18' name='G729'/>"
-//"<payload-type id='97' name='IPCMWB'/>"
-//"<payload-type id='98' name='L16'/>"
-//"<payload-type id='103' name='ISAC'/>"
-//"<payload-type id='102' name='iLBC'/>"
-//"<payload-type id='4' name='G723'/>"
-//"<payload-type id='100' name='EG711U'/>"
-//"<payload-type id='101' name='EG711A'/>"
-//"<payload-type id='0' name='PCMU'/>"
-//"<payload-type id='8' name='PCMA'/>"
-//"<payload-type id='13' name='CN'/>"
-//"</description>"
-//"</jingle>"
-//"</iq>";
-	iks_send_raw(client->p,text);
-	return 0;
-}
+
 static int axi_test(int fd, int argc, char *argv[])
 {
 	struct axi_client *client;
@@ -1205,9 +1181,50 @@
 	return 1;
 }
 
+//static struct axi_send_candidate *axi_create_candidate(char *args)
+//{
+//	char *name, *preference, *protocol, *type;
+//	struct axi_send_candidate *res;
+//	res= malloc(sizeof(struct axi_send_candidate));
+//	memset(res,0,sizeof(struct axi_send_candidate));
+//	res->iq = iks_new("iq");
+//	res->jingle = iks_new(GOOGLE_NODE);
+//	res->candidate = iks_new(GOOGLE_NEGOTIATE);
+//	if(args)
+//		name = args;
+//	if((args = strchr(args,','))) {
+//		*args='\0';
+//		args++;
+//		preference = args;
+//	}
+//	if((args = strchr(args, ','))) {
+//		*args='\0';
+//		args++;
+//		protocol=args;
+//	}
+//	if((args = strchr(args, ','))) {
+//		*args='\0';
+//		args++;
+//		type=args;
+//	}
+//	iks_insert_attrib(res->iq,"type","set");
+//	if(name)
+//		iks_insert_attrib(res->candidate,"name",name);
+//	if(preference)
+//		iks_insert_attrib(res->candidate,"preference",preference);
+//	if(protocol)
+//		iks_insert_attrib(res->candidate,"protocol",protocol);
+//	if(type)
+//		iks_insert_attrib(res->candidate,"type",type);
+//
+//	return res;
+//}
+
 static int *axi_create_client(char *label,struct ast_variable *var, int debug, int pruneregister,char *utype, struct axi_client *client)
 {
 	struct axi_buddy *buddy;
+	struct axi_send_candidate *sc;
+
 	if(!client)
 		ast_log(LOG_WARNING, "Out of memory\n");
 	ast_copy_string(client->name, label,sizeof(client->name));
@@ -1222,8 +1239,6 @@
 	client->timeout=20;
 	client->authorized=0;
 	client->usesasl=0;
-	ast_copy_string(client->externip, "216.207.245.1", sizeof(client->externip));
-	ast_copy_string(client->localip, "10.16.3.55", sizeof(client->localip));
 
 	client->state=AXI_DISCONNECTED;
 	if(!strcasecmp(utype,"component"))
@@ -1241,6 +1256,10 @@
 			ast_copy_string(client->serverhost, var->value, sizeof(client->serverhost));
 		if(!strcasecmp(var->name,"secret"))
 			ast_copy_string(client->password,var->value,sizeof(client->password));
+		if(!strcasecmp(var->name,"externip"))
+			ast_copy_string(client->externip, var->value, sizeof(client->externip));
+		if(!strcasecmp(var->name,"localip"))
+			ast_copy_string(client->localip,var->value,sizeof(client->localip));
 		if(!strcasecmp(var->name,"port"))
 			client->port=atoi(var->value);
 		if(!strcasecmp(var->name,"debug"))
@@ -1270,6 +1289,12 @@
 			ASTOBJ_CONTAINER_LINK(&client->buddies,buddy);
 			ASTOBJ_UNREF(buddy,axi_buddy_destroy);
 		}
+//		if(!strcasecmp(var->name,"candidate")) {
+//			sc = axi_create_candidate(var->value);
+//			sc->next = client->candidates;
+//			client->candidates = sc;
+//		}
+
 		var = var->next;
 	}
 	return 1;



More information about the asterisk-commits mailing list