[asterisk-commits] branch mogorman/asterisk-xmpp r9151 - /team/mogorman/asterisk-xmpp/res/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Feb 4 16:02:23 MST 2006


Author: mogorman
Date: Sat Feb  4 17:02:22 2006
New Revision: 9151

URL: http://svn.digium.com/view/asterisk?rev=9151&view=rev
Log:
asterisk go boom

Modified:
    team/mogorman/asterisk-xmpp/res/res_xmpp.c

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=9151&r1=9150&r2=9151&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/res/res_xmpp.c (original)
+++ team/mogorman/asterisk-xmpp/res/res_xmpp.c Sat Feb  4 17:02:22 2006
@@ -755,7 +755,7 @@
 			iks_delete(removeiq);
 			iks_delete(removequery);
 			iks_delete(removeitem);
-			ASTOBJ_CONTAINER_UNLINK(&asterisk->buddies,iterator);
+//			ASTOBJ_CONTAINER_UNLINK(&asterisk->buddies,iterator);
 			break;
 		case AXI_REGISTER:
 			ast_verbose("REGISTER THIS USER %s\n",iterator->name);
@@ -776,7 +776,7 @@
 	}
 	ASTOBJ_UNLOCK(iterator);
 	});
-
+	ASTOBJ_CONTAINER_PRUNE_MARKED(&asterisk->buddies,axi_buddy_destroy);
 }
 
 static int axi_filter_roster(void *udata,ikspak *pak)
@@ -846,6 +846,7 @@
 					ast_copy_string(buddy->name, iks_find_attrib(x,"jid"), sizeof(buddy->name));
 					ast_copy_string(buddy->user, iks_find_attrib(x,"jid"),sizeof(buddy->user));
 					buddy->on_roster=AXI_PRUNE;
+					buddy->objflags |= ASTOBJ_FLAG_MARKED;
 					ASTOBJ_UNLOCK(buddy);
 					if(buddy) {
 						ASTOBJ_CONTAINER_LINK(&asterisk->buddies,buddy);
@@ -1093,12 +1094,36 @@
 		});
 	return RESULT_SUCCESS;
 }
-
+static int axi_send_call(struct axi_master *asterisk, 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(asterisk->p,text);
+	return 0;
+}
 static int axi_test(int fd, int argc, char *argv[])
 {
 	struct axi_master *asterisk;
 	asterisk = ASTOBJ_CONTAINER_FIND(&masters,"asterisk");
-	ast_axi_send(asterisk,"mogorman at astjab.org","blah blah blah");
+	ast_axi_send(asterisk,"ogorman at gmail.com","blah blah blah");
+	axi_send_call(asterisk,"ogorman at gmail.com");
 	if(asterisk) {
 		ASTOBJ_CONTAINER_TRAVERSE(&asterisk->buddies,1, {
 			ASTOBJ_RDLOCK(iterator);



More information about the asterisk-commits mailing list