[asterisk-commits] oej: branch oej/pinefrog-1.4 r289948 - in /team/oej/pinefrog-1.4: ./ apps/ ch...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Oct 2 02:52:31 CDT 2010


Author: oej
Date: Sat Oct  2 02:52:25 2010
New Revision: 289948

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=289948
Log:
Resolve conflict, restore automerge. Get a life. Enjoy the weekend. Have fun.

Modified:
    team/oej/pinefrog-1.4/   (props changed)
    team/oej/pinefrog-1.4/apps/app_voicemail.c
    team/oej/pinefrog-1.4/channels/chan_sip.c
    team/oej/pinefrog-1.4/include/asterisk/rtp.h
    team/oej/pinefrog-1.4/main/rtp.c

Propchange: team/oej/pinefrog-1.4/
------------------------------------------------------------------------------
    automerge = http://www.codename-pineapple.org/

Propchange: team/oej/pinefrog-1.4/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Oct  2 02:52:25 2010
@@ -1,1 +1,1 @@
-/branches/1.4:1-289755
+/branches/1.4:1-289947

Modified: team/oej/pinefrog-1.4/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-1.4/apps/app_voicemail.c?view=diff&rev=289948&r1=289947&r2=289948
==============================================================================
--- team/oej/pinefrog-1.4/apps/app_voicemail.c (original)
+++ team/oej/pinefrog-1.4/apps/app_voicemail.c Sat Oct  2 02:52:25 2010
@@ -3934,18 +3934,12 @@
 		recipmsgnum++;
 	} while (recipmsgnum < recip->maxmsg);
 	if (recipmsgnum < recip->maxmsg - (imbox ? 0 : inprocess_count(vmu->mailbox, vmu->context, 0))) {
-		if (EXISTS(fromdir, msgnum, frompath, chan->language)) {
-			COPY(fromdir, msgnum, todir, recipmsgnum, recip->mailbox, recip->context, frompath, topath);
-		} else {
-			/* For ODBC storage, if the file we want to copy isn't yet in the database, then the SQL
-			 * copy will fail. Instead, we need to create a local copy, store it, and delete the local
-			 * copy. We don't have to #ifdef this because if file storage reaches this point, there's a
-			 * much worse problem happening and IMAP storage doesn't call this function
-			 */
-			copy_plain_file(frompath, topath);
-			STORE(todir, recip->mailbox, recip->context, recipmsgnum, chan, recip, fmt, duration, NULL);
-			vm_delete(topath);
-		}
+		/* If we are prepending a message for ODBC, then the message already
+		 * exists in the database, but we want to force copying from the
+		 * filesystem (since only the FS contains the prepend). */
+		copy_plain_file(frompath, topath);
+		STORE(todir, recip->mailbox, recip->context, recipmsgnum, chan, recip, fmt, duration, NULL);
+		vm_delete(topath);
 	} else {
 		ast_log(LOG_ERROR, "Recipient mailbox %s@%s is full\n", recip->mailbox, recip->context);
 		res = -1;

Modified: team/oej/pinefrog-1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-1.4/channels/chan_sip.c?view=diff&rev=289948&r1=289947&r2=289948
==============================================================================
--- team/oej/pinefrog-1.4/channels/chan_sip.c (original)
+++ team/oej/pinefrog-1.4/channels/chan_sip.c Sat Oct  2 02:52:25 2010
@@ -4209,7 +4209,7 @@
 		break;
 	case SIP_DTMF_RFC2833:
 		if (p->rtp)
-			ast_rtp_senddigit_end(p->rtp, digit);
+			ast_rtp_senddigit_end_with_duration(p->rtp, digit, duration);
 		break;
 	case SIP_DTMF_INBAND:
 		res = -1; /* Tell Asterisk to stop inband indications */

Modified: team/oej/pinefrog-1.4/include/asterisk/rtp.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-1.4/include/asterisk/rtp.h?view=diff&rev=289948&r1=289947&r2=289948
==============================================================================
--- team/oej/pinefrog-1.4/include/asterisk/rtp.h (original)
+++ team/oej/pinefrog-1.4/include/asterisk/rtp.h Sat Oct  2 02:52:25 2010
@@ -193,6 +193,7 @@
 int ast_rtp_senddigit_begin(struct ast_rtp *rtp, char digit);
 
 int ast_rtp_senddigit_end(struct ast_rtp *rtp, char digit);
+int ast_rtp_senddigit_end_with_duration(struct ast_rtp *rtp, char digit, unsigned int duration);
 
 int ast_rtp_sendcng(struct ast_rtp *rtp, int level);
 

Modified: team/oej/pinefrog-1.4/main/rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-1.4/main/rtp.c?view=diff&rev=289948&r1=289947&r2=289948
==============================================================================
--- team/oej/pinefrog-1.4/main/rtp.c (original)
+++ team/oej/pinefrog-1.4/main/rtp.c Sat Oct  2 02:52:25 2010
@@ -213,6 +213,7 @@
 static int ast_rtcp_write_empty(struct ast_rtp *rtp, int fd);
 static int p2p_rtcp_callback(int *id, int fd, short events, void *cbdata);
 static unsigned int calc_txstamp(struct ast_rtp *rtp, struct timeval *delivery);
+int ast_rtp_senddigit_end_with_duration(struct ast_rtp *rtp, char digit, unsigned int duration);
 
 #define FLAG_3389_WARNING		(1 << 0)
 #define FLAG_NAT_ACTIVE			(3 << 1)
@@ -2820,12 +2821,18 @@
 	return 0;
 }
 
+int ast_rtp_senddigit_end(struct ast_rtp *rtp, char digit)
+{
+	return ast_rtp_senddigit_end_with_duration(rtp, digit, 0);
+}
+
 /*! \brief Send end packets for DTMF */
-int ast_rtp_senddigit_end(struct ast_rtp *rtp, char digit)
+int ast_rtp_senddigit_end_with_duration(struct ast_rtp *rtp, char digit, unsigned int duration)
 {
 	unsigned int *rtpheader;
 	int hdrlen = 12, res = 0, i = 0;
 	char data[256];
+	unsigned int measured_samples;
 	
 	/* If no address, then bail out */
 	if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port)
@@ -2847,6 +2854,13 @@
 	}
 
 	rtp->dtmfmute = ast_tvadd(ast_tvnow(), ast_tv(0, 500000));
+
+	if (duration > 0 && (measured_samples = duration * rtp_get_rate(rtp->f.subclass) / 1000) > rtp->send_duration) {
+		if (option_debug > 1) {
+			ast_log(LOG_DEBUG, "Adjusting final end duration from %u to %u\n", rtp->send_duration, measured_samples);
+		}
+		rtp->send_duration = measured_samples;
+	}
 
 	rtpheader = (unsigned int *)data;
 	rtpheader[1] = htonl(rtp->lastdigitts);




More information about the asterisk-commits mailing list