[asterisk-commits] jpeeler: branch jpeeler/asterisk-sigwork-trunk r203196 - in /team/jpeeler/ast...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 25 12:18:35 CDT 2009


Author: jpeeler
Date: Thu Jun 25 12:18:31 2009
New Revision: 203196

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=203196
Log:
resolve conflict

Modified:
    team/jpeeler/asterisk-sigwork-trunk/   (props changed)
    team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c
    team/jpeeler/asterisk-sigwork-trunk/channels/chan_sip.c
    team/jpeeler/asterisk-sigwork-trunk/main/logger.c

Propchange: team/jpeeler/asterisk-sigwork-trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/jpeeler/asterisk-sigwork-trunk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jun 25 12:18:31 2009
@@ -1,1 +1,1 @@
-/trunk:1-203055
+/trunk:1-203190

Modified: team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c?view=diff&rev=203196&r1=203195&r2=203196
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c Thu Jun 25 12:18:31 2009
@@ -4094,7 +4094,7 @@
 	p->outgoing = 1;
 
 	set_actual_gain(p->subs[SUB_REAL].dfd, 0, p->rxgain, p->txgain, p->law);
-
+	
 #ifdef HAVE_PRI
 	if (p->sig == SIG_PRI || p->sig == SIG_BRI || p->sig == SIG_BRI_PTMP) {
 		struct dahdi_params ps;

Modified: team/jpeeler/asterisk-sigwork-trunk/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/chan_sip.c?view=diff&rev=203196&r1=203195&r2=203196
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/chan_sip.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/chan_sip.c Thu Jun 25 12:18:31 2009
@@ -20494,7 +20494,23 @@
 
 
 	if (c) {	/* We have a call  -either a new call or an old one (RE-INVITE) */
-		switch(c->_state) {
+		enum ast_channel_state c_state = c->_state;
+
+		if (c_state != AST_STATE_UP && reinvite &&
+			(p->invitestate == INV_TERMINATED || p->invitestate == INV_CONFIRMED)) {
+			/* If these conditions are true, and the channel is still in the 'ringing'
+			 * state, then this likely means that we have a situation where the initial
+			 * INVITE transaction has completed *but* the channel's state has not yet been
+			 * changed to UP. The reason this could happen is if the reinvite is received
+			 * on the SIP socket prior to an application calling ast_read on this channel
+			 * to read the answer frame we earlier queued on it. In this case, the reinvite
+			 * is completely legitimate so we need to handle this the same as if the channel 
+			 * were already UP. Thus we are purposely falling through to the AST_STATE_UP case.
+			 */
+			c_state = AST_STATE_UP;
+		}
+
+		switch(c_state) {
 		case AST_STATE_DOWN:
 			ast_debug(2, "%s: New call is still down.... Trying... \n", c->name);
 			transmit_response(p, "100 Trying", req);
@@ -20555,21 +20571,9 @@
 			p->invitestate = INV_PROCEEDING;
 			break;
 		case AST_STATE_RINGING:
-			if (reinvite && (p->invitestate == INV_TERMINATED || p->invitestate == INV_CONFIRMED)) {
-			/* If these conditions are true, and the channel is still in the 'ringing'
-			 * state, then this likely means that we have a situation where the initial
-			 * INVITE transaction has completed *but* the channel's state has not yet been
-			 * changed to UP. The reason this could happen is if the reinvite is received
-			 * on the SIP socket prior to an application calling ast_read on this channel
-			 * to read the answer frame we earlier queued on it. In this case, the reinvite
-			 * is completely legitimate so we need to handle this the same as if the channel 
-			 * were already UP. Thus we are purposely falling through to the AST_STATE_UP case.
-			 */
-			} else {
-				transmit_response(p, "180 Ringing", req);
-				p->invitestate = INV_PROCEEDING;
-				break;
-			}
+			transmit_response(p, "180 Ringing", req);
+			p->invitestate = INV_PROCEEDING;
+			break;
 		case AST_STATE_UP:
 			ast_debug(2, "%s: This call is UP.... \n", c->name);
 

Modified: team/jpeeler/asterisk-sigwork-trunk/main/logger.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/main/logger.c?view=diff&rev=203196&r1=203195&r2=203196
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/main/logger.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/main/logger.c Thu Jun 25 12:18:31 2009
@@ -840,29 +840,29 @@
 	return 0;
 }
 
-static void ast_log_vsyslog(int level, const char *file, int line, const char *function, const char *str, long pid)
+static void ast_log_vsyslog(struct logmsg *msg)
 {
 	char buf[BUFSIZ];
 
-	if (level >= SYSLOG_NLEVELS) {
+	if (msg->level >= SYSLOG_NLEVELS) {
 		/* we are locked here, so cannot ast_log() */
-		fprintf(stderr, "ast_log_vsyslog called with bogus level: %d\n", level);
-		return;
-	}
-
-	if (level == __LOG_VERBOSE) {
-		snprintf(buf, sizeof(buf), "VERBOSE[%ld]: %s", pid, str);
-		level = __LOG_DEBUG;
-	} else if (level == __LOG_DTMF) {
-		snprintf(buf, sizeof(buf), "DTMF[%ld]: %s", pid, str);
-		level = __LOG_DEBUG;
+		fprintf(stderr, "ast_log_vsyslog called with bogus level: %d\n", msg->level);
+		return;
+	}
+
+	if (msg->level == __LOG_VERBOSE) {
+		snprintf(buf, sizeof(buf), "VERBOSE[%ld]: %s", msg->process_id, msg->message);
+		msg->level = __LOG_DEBUG;
+	} else if (msg->level == __LOG_DTMF) {
+		snprintf(buf, sizeof(buf), "DTMF[%ld]: %s", msg->process_id, msg->message);
+		msg->level = __LOG_DEBUG;
 	} else {
 		snprintf(buf, sizeof(buf), "%s[%ld]: %s:%d in %s: %s",
-			 levels[level], pid, file, line, function, str);
+			 levels[msg->level], msg->process_id, msg->file, msg->line, msg->function, msg->message);
 	}
 
 	term_strip(buf, buf, strlen(buf) + 1);
-	syslog(syslog_level_map[level], "%s", buf);
+	syslog(syslog_level_map[msg->level], "%s", buf);
 }
 
 /*! \brief Print a normal log message to the channels */
@@ -880,7 +880,7 @@
 				continue;
 			/* Check syslog channels */
 			if (chan->type == LOGTYPE_SYSLOG && (chan->logmask & (1 << logmsg->level))) {
-				ast_log_vsyslog(logmsg->level, logmsg->file, logmsg->line, logmsg->function, logmsg->message, logmsg->process_id);
+				ast_log_vsyslog(logmsg);
 			/* Console channels */
 			} else if (chan->type == LOGTYPE_CONSOLE && (chan->logmask & (1 << logmsg->level))) {
 				char linestr[128];




More information about the asterisk-commits mailing list