[asterisk-commits] anthonyl: branch anthonyl/history-cli r44767 - in /team/anthonyl/history-cli:...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Oct 9 09:47:44 MST 2006


Author: anthonyl
Date: Mon Oct  9 11:47:43 2006
New Revision: 44767

URL: http://svn.digium.com/view/asterisk?rev=44767&view=rev
Log:
testing-tree

Added:
    team/anthonyl/history-cli/
      - copied from r44765, trunk/
Modified:
    team/anthonyl/history-cli/channels/chan_local.c
    team/anthonyl/history-cli/channels/chan_skinny.c

Modified: team/anthonyl/history-cli/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/history-cli/channels/chan_local.c?rev=44767&r1=44765&r2=44767&view=diff
==============================================================================
--- team/anthonyl/history-cli/channels/chan_local.c (original)
+++ team/anthonyl/history-cli/channels/chan_local.c Mon Oct  9 11:47:43 2006
@@ -294,7 +294,17 @@
 
 static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
-	struct local_pvt *p = newchan->tech_pvt;
+	struct local_pvt *p;
+	
+	if (!newchan || !newchan->tech_pvt) {
+		if (!newchan)
+			ast_log(LOG_WARNING, "No new channel! Fixup of %s failed.\n", oldchan->name);
+		else
+			ast_log(LOG_WARNING, "No tech_pvt! Fixup of %s failed.\n", oldchan->name);
+		return -1;
+	}
+	
+	p = newchan->tech_pvt;
 	ast_mutex_lock(&p->lock);
 
 	if ((p->owner != oldchan) && (p->chan != oldchan)) {

Modified: team/anthonyl/history-cli/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/history-cli/channels/chan_skinny.c?rev=44767&r1=44765&r2=44767&view=diff
==============================================================================
--- team/anthonyl/history-cli/channels/chan_skinny.c (original)
+++ team/anthonyl/history-cli/channels/chan_skinny.c Mon Oct  9 11:47:43 2006
@@ -732,6 +732,24 @@
    (sizeof(skinny_req) - sizeof(skinny_data)) DOES NOT WORK on all systems (amd64?). */
 int skinny_header_size = 12;
 
+
+
+
+/*******************************
+ *Skinny Message Structure
+ ******************************/
+/* i would much rather store all of the possible skinny messages and their handlers inside of this structure */
+/* then use it has the main body for things */
+struct skinny_message {
+	int method_id;  /* method id */
+	char *data;     /* pointer to where the data should be */
+	int  data_len;  /* total length of the message */
+	char *human;    /* human readable form of what the message is */
+	int (* const message_handler)(void); 
+} skinny_messages[] {
+	{ }
+};
+
 /*****************************
  * Asterisk specific globals *
  *****************************/
@@ -1017,6 +1035,7 @@
 	int fd;
 	char inbuf[SKINNY_MAX_PACKET];
 	char outbuf[SKINNY_MAX_PACKET];
+	struct skinny_req    *req;
 	struct skinny_device *device;
 	struct skinnysession *next;
 } *sessions = NULL;
@@ -3638,6 +3657,7 @@
 		ast_verbose("ourip = %s:%d\n", ast_inet_ntoa(d->ourip), ntohs(us.sin_port));
 	}
 
+	/* why is this needing to be re_allocated ? */
 	if (!(req = req_alloc(sizeof(struct start_media_transmission_message), START_MEDIA_TRANSMISSION_MESSAGE)))
 		return -1;
 
@@ -4251,6 +4271,8 @@
 				return NULL;
 			}
 
+			s->req = req;
+			
 			res = handle_message(req, s);
 			if (res < 0) {
 				destroy_session(s);



More information about the asterisk-commits mailing list