[asterisk-commits] murf: branch murf/bug8423-1.4 r48335 - in /team/murf/bug8423-1.4: ./ apps/ ch...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Dec 6 13:07:40 MST 2006


Author: murf
Date: Wed Dec  6 14:07:40 2006
New Revision: 48335

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48335
Log:
Merged revisions 48228,48230,48234,48237,48247-48248,48252,48254,48264,48268,48270,48279,48281 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r48228 | qwell | 2006-12-04 10:43:24 -0700 (Mon, 04 Dec 2006) | 4 lines

Attempt to document some of the dependencies that are needed for net-snmp

Issue 8499 - initial patch by blitzrage.

................
r48230 | qwell | 2006-12-04 10:54:46 -0700 (Mon, 04 Dec 2006) | 4 lines

Add documentation to voicemail.conf.sample for ODBC storage.

Issue 8499 - patch by blitzrage.

................
r48234 | file | 2006-12-04 11:16:31 -0700 (Mon, 04 Dec 2006) | 9 lines

Blocked revisions 48233 via svnmerge

........
r48233 | file | 2006-12-04 13:14:46 -0500 (Mon, 04 Dec 2006) | 2 lines

If the generic bridge tells us not to retry, and we have a frame to spit out then break the bridge. Props to markit in #asterisk-bugs for bringing this up.

........

................
r48237 | qwell | 2006-12-04 12:08:18 -0700 (Mon, 04 Dec 2006) | 11 lines

Blocked revisions 48236 via svnmerge

........
r48236 | qwell | 2006-12-04 13:06:26 -0600 (Mon, 04 Dec 2006) | 4 lines

Fix an issue where a message isn't saved correctly when using ODBC storage and reviewing a message.

Issue 8016 - patch by sokhapkin.

........

................
r48247 | qwell | 2006-12-04 14:23:11 -0700 (Mon, 04 Dec 2006) | 14 lines

Blocked revisions 48246 via svnmerge

........
r48246 | qwell | 2006-12-04 15:20:34 -0600 (Mon, 04 Dec 2006) | 7 lines

Revert change from 8016 - this breaks other stuff...  Needs further review.

Tip: When you've reported a bug about something and somebody has put up a
patch for it..  It's not a good idea to open a completely new bug and say that
something is broken because of the patch in the other bug - PLEASE mention
something in the bug where the patch was actually created.

........

................
r48248 | qwell | 2006-12-04 14:48:41 -0700 (Mon, 04 Dec 2006) | 2 lines

Fix an issue which didn't allow unavail/greet/busy/etc messages from being saved into ODBC (and probably IMAP).

................
r48252 | tilghman | 2006-12-04 18:34:34 -0700 (Mon, 04 Dec 2006) | 14 lines

Merged revisions 48251 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48251 | tilghman | 2006-12-04 19:26:08 -0600 (Mon, 04 Dec 2006) | 6 lines

If the recording in the database is too large, it will fail to retrieve with
an mmap error.  Not too sure why this doesn't happen when we put it in the
database, also, but since that doesn't seem to be broken, I'm not going to fix
it (at least until someone reports it).  Solution is to ask for the file in
smaller chunks.  (Bug 8385)

........

................
r48254 | tilghman | 2006-12-04 18:41:02 -0700 (Mon, 04 Dec 2006) | 2 lines

Oops, forgot to release the odbc handle

................
r48264 | oej | 2006-12-05 05:39:30 -0700 (Tue, 05 Dec 2006) | 11 lines

Updating sip.conf.sample with information about T38 not working
when chan_local or chan_agent is involved in the call.

I don't know how big a fix that would be to solve, but this is
the current state of affairs.

(Chan_sip currently checks if the other side of the bridge
has a SIP tech. We could/should implement another check,
possibly for udptl_write or some flag in the ast_channel
structure).

................
r48268 | oej | 2006-12-05 08:59:05 -0700 (Tue, 05 Dec 2006) | 2 lines

Add missing s from another repository. (thanks jcmoore!)

................
r48270 | oej | 2006-12-05 10:29:43 -0700 (Tue, 05 Dec 2006) | 4 lines

Merging the invitestate-1.4 branch after successful testing.

Will check if I can solve this with less changes in 1.2.

................
r48279 | qwell | 2006-12-05 13:42:52 -0700 (Tue, 05 Dec 2006) | 4 lines

Fix curl version number testing to be much more friendly to non-bash shells.

Issue 8508, patch by me.  This *SHOULD* be POSIX compliant now..

................
r48281 | file | 2006-12-05 13:45:28 -0700 (Tue, 05 Dec 2006) | 2 lines

Regenerate configure from Qwell's last commit.

................

Modified:
    team/murf/bug8423-1.4/   (props changed)
    team/murf/bug8423-1.4/apps/app_voicemail.c
    team/murf/bug8423-1.4/channels/chan_sip.c
    team/murf/bug8423-1.4/configs/sip.conf.sample
    team/murf/bug8423-1.4/configs/voicemail.conf.sample
    team/murf/bug8423-1.4/configure
    team/murf/bug8423-1.4/configure.ac
    team/murf/bug8423-1.4/doc/snmp.txt

Propchange: team/murf/bug8423-1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/murf/bug8423-1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/murf/bug8423-1.4/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Dec  6 14:07:40 2006
@@ -1,1 +1,1 @@
-/branches/1.4:1-48224
+/branches/1.4:1-48306

Modified: team/murf/bug8423-1.4/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8423-1.4/apps/app_voicemail.c?view=diff&rev=48335&r1=48334&r2=48335
==============================================================================
--- team/murf/bug8423-1.4/apps/app_voicemail.c (original)
+++ team/murf/bug8423-1.4/apps/app_voicemail.c Wed Dec  6 14:07:40 2006
@@ -142,6 +142,7 @@
 /* Don't modify these here; set your umask at runtime instead */
 #define	VOICEMAIL_DIR_MODE	0777
 #define	VOICEMAIL_FILE_MODE	0666
+#define	CHUNKSIZE	65536
 
 #define VOICEMAIL_CONFIG "voicemail.conf"
 #define ASTERISK_USERNAME "asterisk"
@@ -1088,6 +1089,7 @@
 				goto yuck;
 			}
 			if (!strcasecmp(coltitle, "recording")) {
+				off_t offset;
 				res = SQLGetData(stmt, x + 1, SQL_BINARY, NULL, 0, &colsize2);
 				fdlen = colsize2;
 				if (fd > -1) {
@@ -1098,24 +1100,27 @@
 						fd = -1;
 						continue;
 					}
-					if (fd > -1) {
-						if ((fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == -1) {
+					/* Read out in small chunks */
+					for (offset = 0; offset < colsize2; offset += CHUNKSIZE) {
+						/* +1 because SQLGetData likes null-terminating binary data */
+						if ((fdm = mmap(NULL, CHUNKSIZE + 1, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset)) == (void *)-1) {
 							ast_log(LOG_WARNING, "Could not mmap the output file: %s (%d)\n", strerror(errno), errno);
 							SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 							ast_odbc_release_obj(obj);
 							goto yuck;
+						} else {
+							res = SQLGetData(stmt, x + 1, SQL_BINARY, fdm, CHUNKSIZE + 1, NULL);
+							munmap(fdm, 0);
+							if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+								ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
+								unlink(full_fn);
+								SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+								ast_odbc_release_obj(obj);
+								goto yuck;
+							}
 						}
 					}
-				}
-				if (fdm) {
-					memset(fdm, 0, fdlen);
-					res = SQLGetData(stmt, x + 1, SQL_BINARY, fdm, fdlen, &colsize2);
-					if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
-						ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
-						SQLFreeHandle (SQL_HANDLE_STMT, stmt);
-						ast_odbc_release_obj(obj);
-						goto yuck;
-					}
+					truncate(full_fn, fdlen);
 				}
 			} else {
 				res = SQLGetData(stmt, x + 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
@@ -1136,8 +1141,6 @@
 yuck:	
 	if (f)
 		fclose(f);
-	if (fdm)
-		munmap(fdm, fdlen);
 	if (fd > -1)
 		close(fd);
 	return x - 1;
@@ -7876,6 +7879,8 @@
 				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3 "Saving message as is\n");
 				ast_stream_and_wait(chan, "vm-msgsaved", chan->language, "");
+				STORE(recordfile, vmu->mailbox, vmu->context, -1, chan, vmu, fmt, duration, vms);
+				DISPOSE(recordfile, -1);
 				cmd = 't';
 				return res;
 			}

Modified: team/murf/bug8423-1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8423-1.4/channels/chan_sip.c?view=diff&rev=48335&r1=48334&r2=48335
==============================================================================
--- team/murf/bug8423-1.4/channels/chan_sip.c (original)
+++ team/murf/bug8423-1.4/channels/chan_sip.c Wed Dec  6 14:07:40 2006
@@ -244,6 +244,21 @@
 	AST_FAILURE = -1,
 };
 
+/*! \brief States for the INVITE transaction, not the dialog 
+	\note this is for the INVITE that sets up the dialog
+*/
+enum invitestates {
+	INV_NONE = 0,	        /*!< No state at all, maybe not an INVITE dialog */
+	INV_CALLING = 1,	/*!< Invite sent, no answer */
+	INV_PROCEEDING = 2,	/*!< We got/sent 1xx message */
+	INV_EARLY_MEDIA = 3,    /*!< We got 18x message with to-tag back */
+	INV_COMPLETED = 4,	/*!< Got final response with error. Wait for ACK, then CONFIRMED */
+	INV_CONFIRMED = 5,	/*!< Confirmed response - we've got an ack (Incoming calls only) */
+	INV_TERMINATED = 6,	/*!< Transaction done - either successful (AST_STATE_UP) or failed, but done 
+			    	     The only way out of this is a BYE from one side */
+	INV_CANCELLED = 7,	/*!< Transaction cancelled by client or server in non-terminated state */
+};
+
 /* Do _NOT_ make any changes to this enum, or the array following it;
    if you think you are doing the right thing, you are probably
    not doing the right thing. If you think there are changes
@@ -703,7 +718,7 @@
 #define SIP_REALTIME		(1 << 11)	/*!< Flag for realtime users */
 #define SIP_USECLIENTCODE	(1 << 12)	/*!< Trust X-ClientCode info message */
 #define SIP_OUTGOING		(1 << 13)	/*!< Direction of the last transaction in this dialog */
-#define SIP_CAN_BYE		(1 << 14)	/*!< Can we send BYE on this dialog? */
+#define SIP_FREE_BIT		(1 << 14)	/*!< ---- */
 #define SIP_DEFER_BYE_ON_TRANSFER	(1 << 15)	/*!< Do not hangup at first ast_hangup */
 #define SIP_DTMF		(3 << 16)	/*!< DTMF Support: four settings, uses two bits */
 #define SIP_DTMF_RFC2833	(0 << 16)	/*!< DTMF Support: RTP DTMF - "rfc2833" */
@@ -877,6 +892,7 @@
 static struct sip_pvt {
 	ast_mutex_t lock;			/*!< Dialog private lock */
 	int method;				/*!< SIP method that opened this dialog */
+	enum invitestates invitestate;		/*!< The state of the INVITE transaction only */
 	AST_DECLARE_STRING_FIELDS(
 		AST_STRING_FIELD(callid);	/*!< Global CallID */
 		AST_STRING_FIELD(randdata);	/*!< Random data */
@@ -1593,6 +1609,13 @@
 		ast_verbose("%d headers, %d lines\n", p->initreq.headers, p->initreq.lines);
 }
 
+static void sip_alreadygone(struct sip_pvt *dialog)
+{
+	if (option_debug > 2)
+		ast_log(LOG_DEBUG, "Setting SIP_ALREADYGONE on dialog %s\n", dialog->callid);
+	ast_set_flag(&dialog->flags[0], SIP_ALREADYGONE);
+}
+
 
 /*! \brief returns true if 'name' (with optional trailing whitespace)
  * matches the sip method 'id'.
@@ -1871,7 +1894,7 @@
 			ast_mutex_lock(&pkt->owner->lock);
 		}
 		if (pkt->owner->owner) {
-			ast_set_flag(&pkt->owner->flags[0], SIP_ALREADYGONE);
+			sip_alreadygone(pkt->owner);
 			ast_log(LOG_WARNING, "Hanging up call %s - no reply to our critical packet.\n", pkt->owner->callid);
 			ast_queue_hangup(pkt->owner->owner);
 			ast_channel_unlock(pkt->owner->owner);
@@ -2802,6 +2825,7 @@
 			if (option_debug > 1)
 				ast_log(LOG_DEBUG,"Our T38 capability (%d), joint T38 capability (%d)\n", p->t38.capability, p->t38.jointcapability);
 			transmit_invite(p, SIP_INVITE, 1, 2);
+			p->invitestate = INV_CALLING;
 
 			/* Initialize auto-congest time */
 			p->initid = ast_sched_add(sched, p->maxtime ? (p->maxtime * 4) : SIP_TRANS_TIMEOUT, auto_congest, p);
@@ -3269,7 +3293,7 @@
 		return 0;
 	}
 	/* If the call is not UP, we need to send CANCEL instead of BYE */
-	if (ast->_state == AST_STATE_RING || ast->_state == AST_STATE_RINGING) {
+	if (ast->_state == AST_STATE_RING || ast->_state == AST_STATE_RINGING || p->invitestate < INV_COMPLETED) {
 		needcancel = TRUE;
 		if (option_debug > 3)
 			ast_log(LOG_DEBUG, "Hanging up channel in state %s (not UP)\n", ast_state2str(ast->_state));
@@ -3293,7 +3317,7 @@
 	*/
 	if (ast_test_flag(&p->flags[0], SIP_ALREADYGONE))
 		needdestroy = 1;	/* Set destroy flag at end of this function */
-	else
+	else if (p->invitestate != INV_CALLING)
 		sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 
 	/* Start the process if it's not already started */
@@ -3304,7 +3328,8 @@
 				__sip_pretend_ack(p);
 
 				/* if we can't send right now, mark it pending */
-				if (!ast_test_flag(&p->flags[0], SIP_CAN_BYE)) {
+				if (p->invitestate == INV_CALLING) {
+					/* We can't send anything in CALLING state */
 					ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
 					/* Do we need a timer here if we don't hear from them at all? */
 				} else {
@@ -3354,6 +3379,7 @@
 				   but we can't send one while we have "INVITE" outstanding. */
 				ast_set_flag(&p->flags[0], SIP_PENDINGBYE);	
 				ast_clear_flag(&p->flags[0], SIP_NEEDREINVITE);	
+				sip_cancel_destroy(p);
 			}
 		}
 	}
@@ -3608,6 +3634,7 @@
 	switch(condition) {
 	case AST_CONTROL_RINGING:
 		if (ast->_state == AST_STATE_RING) {
+			p->invitestate = INV_EARLY_MEDIA;
 			if (!ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) ||
 			    (ast_test_flag(&p->flags[0], SIP_PROG_INBAND) == SIP_PROG_INBAND_NEVER)) {				
 				/* Send 180 ringing if out-of-band seems reasonable */
@@ -3624,7 +3651,8 @@
 	case AST_CONTROL_BUSY:
 		if (ast->_state != AST_STATE_UP) {
 			transmit_response(p, "486 Busy Here", &p->initreq);
-			ast_set_flag(&p->flags[0], SIP_ALREADYGONE);	
+			p->invitestate = INV_TERMINATED;
+			sip_alreadygone(p);
 			ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);
 			break;
 		}
@@ -3633,7 +3661,8 @@
 	case AST_CONTROL_CONGESTION:
 		if (ast->_state != AST_STATE_UP) {
 			transmit_response(p, "503 Service Unavailable", &p->initreq);
-			ast_set_flag(&p->flags[0], SIP_ALREADYGONE);	
+			p->invitestate = INV_TERMINATED;
+			sip_alreadygone(p);
 			ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);
 			break;
 		}
@@ -3644,6 +3673,7 @@
 		    !ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) &&
 		    !ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
 			transmit_response(p, "100 Trying", &p->initreq);
+			p->invitestate = INV_PROCEEDING;  
 			break;
 		}
 		res = -1;
@@ -3652,6 +3682,7 @@
 		if ((ast->_state != AST_STATE_UP) &&
 		    !ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) &&
 		    !ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
+			p->invitestate = INV_EARLY_MEDIA;
 			transmit_response_with_sdp(p, "183 Session Progress", &p->initreq, XMIT_UNRELIABLE);
 			ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);	
 			break;
@@ -7374,6 +7405,9 @@
 {
 	struct sip_request resp;
 
+	if (sipmethod == SIP_ACK)
+		p->invitestate = INV_CONFIRMED;
+
 	reqprep(&resp, p, sipmethod, seqno, newbranch);
 	add_header_contentLength(&resp, 0);
 	return send_request(p, &resp, reliable, seqno ? seqno : p->ocseq);
@@ -11462,7 +11496,7 @@
 {
 	if (ast_test_flag(&p->flags[0], SIP_PENDINGBYE)) {
 		/* if we can't BYE, then this is really a pending CANCEL */
-		if (!ast_test_flag(&p->flags[0], SIP_CAN_BYE))
+		if (p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA)
 			transmit_request(p, SIP_CANCEL, p->ocseq, XMIT_RELIABLE, FALSE);
 			/* Actually don't destroy us yet, wait for the 487 on our original 
 			   INVITE, but do set an autodestruct just in case we never get it. */
@@ -11513,6 +11547,15 @@
 	if (resp > 100 && resp < 200 && resp!=101 && resp != 180 && resp != 183)
 		resp = 183;
 
+ 	/* Any response between 100 and 199 is PROCEEDING */
+ 	if (resp >= 100 && resp < 200 && p->invitestate == INV_CALLING)
+ 		p->invitestate = INV_PROCEEDING;
+ 
+ 	/* Final response, not 200 ? */
+ 	if (resp >= 300 && (p->invitestate == INV_CALLING || p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA ))
+ 		p->invitestate = INV_COMPLETED;
+ 		
+
 	switch (resp) {
 	case 100:	/* Trying */
 	case 101:	/* Dialog establishment */
@@ -11531,13 +11574,13 @@
 			}
 		}
 		if (find_sdp(req)) {
+			p->invitestate = INV_EARLY_MEDIA;
 			res = process_sdp(p, req);
 			if (!ast_test_flag(req, SIP_PKT_IGNORE) && p->owner) {
 				/* Queue a progress frame only if we have SDP in 180 */
 				ast_queue_control(p->owner, AST_CONTROL_PROGRESS);
 			}
 		}
-		ast_set_flag(&p->flags[0], SIP_CAN_BYE);
 		check_pendings(p);
 		break;
 
@@ -11546,13 +11589,13 @@
 			sip_cancel_destroy(p);
 		/* Ignore 183 Session progress without SDP */
 		if (find_sdp(req)) {
+			p->invitestate = INV_EARLY_MEDIA;
 			res = process_sdp(p, req);
 			if (!ast_test_flag(req, SIP_PKT_IGNORE) && p->owner) {
 				/* Queue a progress frame */
 				ast_queue_control(p->owner, AST_CONTROL_PROGRESS);
 			}
 		}
-		ast_set_flag(&p->flags[0], SIP_CAN_BYE);
 		check_pendings(p);
 		break;
 
@@ -11653,8 +11696,8 @@
 				ast_set_flag(&p->flags[0], SIP_PENDINGBYE);	
 		}
 		/* If I understand this right, the branch is different for a non-200 ACK only */
+		p->invitestate = INV_TERMINATED;
 		transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, TRUE);
-		ast_set_flag(&p->flags[0], SIP_CAN_BYE);
 		check_pendings(p);
 		break;
 	case 407: /* Proxy authentication */
@@ -11672,7 +11715,7 @@
 			if ((p->authtries == MAX_AUTHTRIES) || do_proxy_auth(p, req, authenticate, authorization, SIP_INVITE, 1)) {
 				ast_log(LOG_NOTICE, "Failed to authenticate on INVITE to '%s'\n", get_header(&p->initreq, "From"));
 				ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
-				ast_set_flag(&p->flags[0], SIP_ALREADYGONE);	
+				sip_alreadygone(p);
 				if (p->owner)
 					ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
 			}
@@ -11686,14 +11729,14 @@
 		if (!ast_test_flag(req, SIP_PKT_IGNORE) && p->owner)
 			ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
 		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
-		ast_set_flag(&p->flags[0], SIP_ALREADYGONE);	
+		sip_alreadygone(p);
 		break;
 
 	case 404: /* Not found */
 		transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
 		if (p->owner && !ast_test_flag(req, SIP_PKT_IGNORE))
 			ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
-		ast_set_flag(&p->flags[0], SIP_ALREADYGONE);	
+		sip_alreadygone(p);
 		break;
 
 	case 481: /* Call leg does not exist */
@@ -12150,7 +12193,6 @@
 				/* Fatal response */
 				if ((option_verbose > 2) && (resp != 487))
 					ast_verbose(VERBOSE_PREFIX_3 "Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(p->sa.sin_addr));
-				ast_set_flag(&p->flags[0], SIP_ALREADYGONE);	
 	
 				stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */
 
@@ -12209,7 +12251,7 @@
 				/* ACK on invite */
 				if (sipmethod == SIP_INVITE) 
 					transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
-				ast_set_flag(&p->flags[0], SIP_ALREADYGONE);	
+				sip_alreadygone(p);
 				if (!p->owner)
 					ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 			} else if ((resp >= 100) && (resp < 200)) {
@@ -13254,6 +13296,7 @@
 			if (option_debug > 1)
 				ast_log(LOG_DEBUG, "%s: New call is still down.... Trying... \n", c->name);
 			transmit_response(p, "100 Trying", req);
+			p->invitestate = INV_PROCEEDING;
 			ast_setstate(c, AST_STATE_RING);
 			if (strcmp(p->exten, ast_pickup_ext())) {	/* Call to extension -start pbx on this call */
 				enum ast_pbx_result res;
@@ -13263,6 +13306,7 @@
 				switch(res) {
 				case AST_PBX_FAILED:
 					ast_log(LOG_WARNING, "Failed to start PBX :(\n");
+					p->invitestate = INV_COMPLETED;
 					if (ast_test_flag(req, SIP_PKT_IGNORE))
 						transmit_response(p, "503 Unavailable", req);
 					else
@@ -13270,6 +13314,7 @@
 					break;
 				case AST_PBX_CALL_LIMIT:
 					ast_log(LOG_WARNING, "Failed to start PBX (call limit reached) \n");
+					p->invitestate = INV_COMPLETED;
 					if (ast_test_flag(req, SIP_PKT_IGNORE))
 						transmit_response(p, "480 Temporarily Unavailable", req);
 					else
@@ -13297,7 +13342,7 @@
 						transmit_response(p, "503 Unavailable", req);	/* OEJ - Right answer? */
 					else
 						transmit_response_reliable(p, "503 Unavailable", req);
-					ast_set_flag(&p->flags[0], SIP_ALREADYGONE);	
+					sip_alreadygone(p);
 					/* Unlock locks so ast_hangup can do its magic */
 					ast_mutex_unlock(&p->lock);
 					c->hangupcause = AST_CAUSE_CALL_REJECTED;
@@ -13306,6 +13351,7 @@
 					ast_setstate(c, AST_STATE_DOWN);
 					c->hangupcause = AST_CAUSE_NORMAL_CLEARING;
 				}
+				p->invitestate = INV_COMPLETED;
 				ast_hangup(c);
 				ast_mutex_lock(&p->lock);
 				c = NULL;
@@ -13313,9 +13359,11 @@
 			break;
 		case AST_STATE_RING:
 			transmit_response(p, "100 Trying", req);
+			p->invitestate = INV_PROCEEDING;
 			break;
 		case AST_STATE_RINGING:
 			transmit_response(p, "180 Ringing", req);
+			p->invitestate = INV_PROCEEDING;
 			break;
 		case AST_STATE_UP:
 			if (option_debug > 1)
@@ -13401,6 +13449,7 @@
 					transmit_response_with_sdp(p, "200 OK", req, XMIT_CRITICAL);
 
 			}
+			p->invitestate = INV_TERMINATED;
 			break;
 		default:
 			ast_log(LOG_WARNING, "Don't know how to handle INVITE in state %d\n", c->_state);
@@ -13421,6 +13470,7 @@
 				transmit_response(p, msg, req);
 			else
 				transmit_response_reliable(p, msg, req);
+			p->invitestate = INV_COMPLETED;
 			sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 		}
 	}
@@ -13616,7 +13666,7 @@
 		transmit_response(p, "603 Declined (No dialog)", req);
 		if (!ast_test_flag(req, SIP_PKT_IGNORE)) {
 			append_history(p, "Xfer", "Refer failed. Outside of dialog.");
-			ast_set_flag(&p->flags[0], SIP_ALREADYGONE);	
+			sip_alreadygone(p);
 			ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 		}
 		return 0;
@@ -13875,7 +13925,8 @@
 {
 		
 	check_via(p, req);
-	ast_set_flag(&p->flags[0], SIP_ALREADYGONE);	
+	sip_alreadygone(p);
+	p->invitestate = INV_CANCELLED;
 	
 	if (p->owner && p->owner->_state == AST_STATE_UP) {
 		/* This call is up, cancel is ignored, we need a bye */
@@ -13908,12 +13959,14 @@
 	struct ast_channel *bridged_to;
 	
 	/* If we have an INCOMING invite that we haven't answered, terminate that transaction */
-	if (p->pendinginvite && !ast_test_flag(&p->flags[0], SIP_OUTGOING) && !ast_test_flag(req, SIP_PKT_IGNORE) && !p->owner)
+	if (p->pendinginvite && !ast_test_flag(&p->flags[0], SIP_OUTGOING) && !ast_test_flag(req, SIP_PKT_IGNORE) && !p->owner) 
 		transmit_response_reliable(p, "487 Request Terminated", &p->initreq);
+
+	p->invitestate = INV_TERMINATED;
 
 	copy_request(&p->initreq, req);
 	check_via(p, req);
-	ast_set_flag(&p->flags[0], SIP_ALREADYGONE);	
+	sip_alreadygone(p);
 
 	/* Get RTCP quality before end of call */
 	if (!ast_test_flag(&p->flags[0], SIP_NO_HISTORY) || p->owner) {
@@ -14479,6 +14532,7 @@
 	case SIP_ACK:
 		/* Make sure we don't ignore this */
 		if (seqno == p->pendinginvite) {
+			p->invitestate = INV_CONFIRMED;
 			p->pendinginvite = 0;
 			__sip_ack(p, seqno, FLAG_RESPONSE, 0);
 			if (find_sdp(req)) {

Modified: team/murf/bug8423-1.4/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/bug8423-1.4/configs/sip.conf.sample?view=diff&rev=48335&r1=48334&r2=48335
==============================================================================
--- team/murf/bug8423-1.4/configs/sip.conf.sample (original)
+++ team/murf/bug8423-1.4/configs/sip.conf.sample Wed Dec  6 14:07:40 2006
@@ -194,7 +194,7 @@
 ;notifyhold = yes		; Notify subscriptions on HOLD state (default: no)
 				; Turning on notifyringing and notifyhold will add a lot
 				; more database transactions if you are using realtime.
-;limitonpeer = yes		; Apply call limits on peers only. This will improve 
+;limitonpeers = yes		; Apply call limits on peers only. This will improve 
 				; status notification when you are using type=friend
 				; Inbound calls, that really apply to the user part
 				; of a friend will now be added to and compared with
@@ -208,6 +208,8 @@
 ; both parties have T38 support enabled in their Asterisk configuration 
 ; This has to be enabled in the general section for all devices to work. You can then
 ; disable it on a per device basis. 
+;
+; T.38 faxing only works in SIP to SIP calls, with no local or agent channel being used.
 ;
 ; t38pt_udptl = yes            ; Default false
 ;

Modified: team/murf/bug8423-1.4/configs/voicemail.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/bug8423-1.4/configs/voicemail.conf.sample?view=diff&rev=48335&r1=48334&r2=48335
==============================================================================
--- team/murf/bug8423-1.4/configs/voicemail.conf.sample (original)
+++ team/murf/bug8423-1.4/configs/voicemail.conf.sample Wed Dec  6 14:07:40 2006
@@ -83,6 +83,12 @@
 ;fromstring=The Asterisk PBX
 ; Permit finding entries for forward/compose from the directory
 ;usedirectory=yes
+; Voicemail can be stored in a database using the ODBC driver.
+; The value of odbcstorage is the database connection configured
+; in res_odbc.conf.
+;odbcstorage=asterisk
+; The default table for ODBC voicemail storage is voicemessages.
+;odbctable=voicemessages
 ;
 ; Change the from, body and/or subject, variables:
 ;     VM_NAME, VM_DUR, VM_MSGNUM, VM_MAILBOX, VM_CALLERID, VM_CIDNUM,

Modified: team/murf/bug8423-1.4/configure
URL: http://svn.digium.com/view/asterisk/team/murf/bug8423-1.4/configure?view=diff&rev=48335&r1=48334&r2=48335
==============================================================================
--- team/murf/bug8423-1.4/configure (original)
+++ team/murf/bug8423-1.4/configure Wed Dec  6 14:07:40 2006
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 47758 .
+# From configure.ac Revision: 48279 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.60a.
 #
@@ -31046,30 +31046,17 @@
 
    if test ! x"${CURL}" = xNo; then
    # check for version
-      if test "${host_os}" = "SunOS"; then
-            if [ 0x`curl-config --vernum` -ge 0x70907 ]; then
-	        CURL_INCLUDE=$(${CURL} --cflags)
-		CURL_LIB=$(${CURL} --libs)
-		PBX_CURL=1
+      if test $(printf "%d" 0x$(curl-config --vernum)) -ge $(printf "%d" 0x070907); then
+         CURL_INCLUDE=$(${CURL} --cflags)
+         CURL_LIB=$(${CURL} --libs)
+         PBX_CURL=1
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_CURL 1
 _ACEOF
 
-	    fi
-	 else
-	    if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
-	        CURL_INCLUDE=$(${CURL} --cflags)
-		CURL_LIB=$(${CURL} --libs)
-		PBX_CURL=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CURL 1
-_ACEOF
-
-	    fi
-	fi
-    fi
+      fi
+   fi
 fi
 
 ac_config_files="$ac_config_files build_tools/menuselect-deps makeopts channels/h323/Makefile"

Modified: team/murf/bug8423-1.4/configure.ac
URL: http://svn.digium.com/view/asterisk/team/murf/bug8423-1.4/configure.ac?view=diff&rev=48335&r1=48334&r2=48335
==============================================================================
--- team/murf/bug8423-1.4/configure.ac (original)
+++ team/murf/bug8423-1.4/configure.ac Wed Dec  6 14:07:40 2006
@@ -1033,22 +1033,13 @@
    AC_PATH_TOOL([CURL], [curl-config], No)
    if test ! x"${CURL}" = xNo; then
    # check for version
-      if test "${host_os}" = "SunOS"; then
-            if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
-	        CURL_INCLUDE=$(${CURL} --cflags)
-		CURL_LIB=$(${CURL} --libs)
-		PBX_CURL=1
-		AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
-	    fi
-	 else
-	    if [[[ 0x`curl-config --vernum` -ge 0x70907 ]]]; then
-	        CURL_INCLUDE=$(${CURL} --cflags)
-		CURL_LIB=$(${CURL} --libs)
-		PBX_CURL=1
-		AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
-	    fi
-	fi
-    fi
+      if test $(printf "%d" 0x$(curl-config --vernum)) -ge $(printf "%d" 0x070907); then
+         CURL_INCLUDE=$(${CURL} --cflags)
+         CURL_LIB=$(${CURL} --libs)
+         PBX_CURL=1
+         AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
+      fi
+   fi
 fi
 
 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])

Modified: team/murf/bug8423-1.4/doc/snmp.txt
URL: http://svn.digium.com/view/asterisk/team/murf/bug8423-1.4/doc/snmp.txt?view=diff&rev=48335&r1=48334&r2=48335
==============================================================================
--- team/murf/bug8423-1.4/doc/snmp.txt (original)
+++ team/murf/bug8423-1.4/doc/snmp.txt Wed Dec  6 14:07:40 2006
@@ -8,8 +8,11 @@
 Note that on some (many?) Linux-distributions the dependency list in
 the net-snmp-devel list is not complete, and additional RPMs will need
 to be installed.  This is typically seen as attempts to build res_snmp
-as net-snmp-devel is available, but then failures to find certain
-libraries.
+as net-snmp-devel is available, but then fails to find certain
+libraries.  The packages may include the following:
+	* bzip2-devel
+	* lm_sensors-devel
+	* newt-devel
 
 SNMP support comes in two varieties -- as a sub-agent to a running SNMP
 daemon using the AgentX protocol, or as a full standalone agent.  If



More information about the asterisk-commits mailing list