[asterisk-commits] murf: branch group/bug7433 r48256 - in /team/group/bug7433: ./ apps/ channels...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Dec 4 21:15:35 MST 2006


Author: murf
Date: Mon Dec  4 22:15:35 2006
New Revision: 48256

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48256
Log:
Merged revisions 48088,48095,48101,48105,48107,48113,48115,48129,48135,48143,48147,48152,48155,48158,48162,48166,48168,48177,48179,48184-48186,48190,48193,48195,48199,48219,48223,48228,48230,48234,48237,48247-48248,48252,48254 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r48088 | file | 2006-11-28 09:57:16 -0700 (Tue, 28 Nov 2006) | 10 lines

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

........
r48087 | file | 2006-11-28 11:56:01 -0500 (Tue, 28 Nov 2006) | 2 lines

According to the research I have done we never needed to include compiler.h in the first place so let's not! (issue #8430 reported by edguy3)

........

................
r48095 | qwell | 2006-11-28 11:26:53 -0700 (Tue, 28 Nov 2006) | 2 lines

Export several more variables in top level Makefile.  Inspired by issue 8438.

................
r48101 | file | 2006-11-28 21:26:53 -0700 (Tue, 28 Nov 2006) | 2 lines

Don't crash if the mailstream was not created.

................
r48105 | oej | 2006-11-29 01:03:36 -0700 (Wed, 29 Nov 2006) | 2 lines

Clarify RTP timers. Sorry, grandma.

................
r48107 | file | 2006-11-29 09:50:33 -0700 (Wed, 29 Nov 2006) | 10 lines

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

........
r48106 | file | 2006-11-29 11:47:10 -0500 (Wed, 29 Nov 2006) | 2 lines

If the frame was duplicated before writing out then we need to free it. (issue #8429 reported by edguy3)

........

................
r48113 | oej | 2006-11-29 12:56:56 -0700 (Wed, 29 Nov 2006) | 14 lines

Explain the use device status system implemented in SIP for subscriptions,
queues and manager a bit better.

Like in 1.2, you will get more detailed information if you set a call 
limit for a device. When the call limit is reached, the status system will
report a device as busy.

For queues, setting a call limit per SIP device is propably a requirement.

In most cases, it will work much better if you only use type=peer and not
type=friend. We might decide to backport the new setting from trunk to
apply all call limits to the peer part of a friend only.


................
r48115 | file | 2006-11-29 14:05:17 -0700 (Wed, 29 Nov 2006) | 2 lines

Use MAILTMPLEN instead of sizeof in mm_login. (issue #8420 reported by slimey)

................
r48129 | oej | 2006-11-30 02:12:30 -0700 (Thu, 30 Nov 2006) | 3 lines

Clean up bad dialogs properly. Caused by GS 487 adapter without CSEQ on separate line 
in the REGISTER request. Imported from 1.2.

................
r48135 | oej | 2006-11-30 07:29:39 -0700 (Thu, 30 Nov 2006) | 3 lines

Explain status reports and
make codefreeze more happy :-)

................
r48143 | file | 2006-11-30 10:57:35 -0700 (Thu, 30 Nov 2006) | 10 lines

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

........
r48142 | file | 2006-11-30 12:55:23 -0500 (Thu, 30 Nov 2006) | 2 lines

Document 'port' for SIP peers, came up because of the current mailing list thread. (issue #8450 reported by blitzrage)

........

................
r48147 | file | 2006-11-30 11:19:55 -0700 (Thu, 30 Nov 2006) | 9 lines

Blocked revisions 48146 via svnmerge

........
r48146 | file | 2006-11-30 13:17:54 -0500 (Thu, 30 Nov 2006) | 2 lines

Remember the pointer to the allocated block of memory so that we can free it and not cause a memory leak. (issue #8449 reported by arkadia)

........

................
r48152 | file | 2006-11-30 11:47:40 -0700 (Thu, 30 Nov 2006) | 10 lines

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

........
r48151 | file | 2006-11-30 13:42:45 -0500 (Thu, 30 Nov 2006) | 2 lines

Print certain CDR messages out at the NOTICE level versus WARNING since they can occur when used with the CDR applications and are perfectly fine. (issue #8367 reported by dartvader)

........

................
r48155 | file | 2006-11-30 12:05:14 -0700 (Thu, 30 Nov 2006) | 10 lines

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

........
r48154 | file | 2006-11-30 14:04:11 -0500 (Thu, 30 Nov 2006) | 2 lines

Do not listen for DTMF on the bridge that comes into existence when ParkedCall is executed. This means native bridging can now occur for this. (issue #8406 reported by kebl0155)

........

................
r48158 | file | 2006-11-30 13:07:55 -0700 (Thu, 30 Nov 2006) | 10 lines

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

........
r48157 | file | 2006-11-30 15:06:43 -0500 (Thu, 30 Nov 2006) | 2 lines

Only print out debug message if bridged channel is not NULL. (issue #8412 reported by jubilex)

........

................
r48162 | file | 2006-11-30 13:28:19 -0700 (Thu, 30 Nov 2006) | 9 lines

Blocked revisions 48161 via svnmerge

........
r48161 | file | 2006-11-30 15:27:29 -0500 (Thu, 30 Nov 2006) | 2 lines

Don't write AST_FRAME_NULL or AST_FRAME_IAX frames out to the channel driver. (issue #8390 reported by hselasky)

........

................
r48166 | oej | 2006-11-30 13:51:04 -0700 (Thu, 30 Nov 2006) | 2 lines

Issue 8319 - change noncecount before using it.

................
r48168 | file | 2006-11-30 14:18:24 -0700 (Thu, 30 Nov 2006) | 2 lines

Do not do a partial bridge for Google Talk since we need to handle STUN. (issue #8448 reported by phsultan)

................
r48177 | oej | 2006-12-01 10:41:56 -0700 (Fri, 01 Dec 2006) | 5 lines

- Backport of the "limitonpeers" patch from trunk, to fix a lot of issues with queues and SIP device states
- Remove support for T.38 early media, since it's impossible.

(Two patches in one - extra friday evening offer due to being off line from svn today... :-)

................
r48179 | tilghman | 2006-12-01 12:38:59 -0700 (Fri, 01 Dec 2006) | 2 lines

Double-unlock error (reported by blitzrage on IRC)

................
r48184 | qwell | 2006-12-01 13:19:44 -0700 (Fri, 01 Dec 2006) | 6 lines

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

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

................
r48185 | qwell | 2006-12-01 13:24:32 -0700 (Fri, 01 Dec 2006) | 2 lines

erm, hmm...I typod a merge...that went...strangely

................
r48186 | qwell | 2006-12-01 13:25:51 -0700 (Fri, 01 Dec 2006) | 10 lines

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

........
r48183 | qwell | 2006-12-01 14:19:10 -0600 (Fri, 01 Dec 2006) | 2 lines

Fix a small typo - issue 8848, reported by pabelanger

........

................
r48190 | russell | 2006-12-01 16:16:28 -0700 (Fri, 01 Dec 2006) | 12 lines

FreeBSD 6.1 does not include wget by default.  However, it has fetch which will
work just fine for our purposes of downloading the sounds packages.  So, check
for both wget and fetch and the configure script and use what was found to
download them.  If neither one was found, and sound packages are selected that
must be downloaded, the install process will print out an informative error
message indicating the situation.

Also, fix a couple places where "make" was hard coded into some output messages
by replacing them with the $(MAKE) variable.

(issue #8451, initial patch by pabelanger, with additional modifications by me)

................
r48193 | kpfleming | 2006-12-01 16:37:28 -0700 (Fri, 01 Dec 2006) | 10 lines

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

........
r48192 | kpfleming | 2006-12-01 17:30:59 -0600 (Fri, 01 Dec 2006) | 2 lines

if Dial() is going to send music-on-hold to the calling party, it has to send PROGRESS first to ensure that the reverse audio path has been setup first (BE-106)

........

................
r48195 | russell | 2006-12-01 20:50:58 -0700 (Fri, 01 Dec 2006) | 3 lines

Backport the comment containing the warning regarding the limitations on the
usage of this function.  It is thread safe, but not technically reentrant.

................
r48199 | oej | 2006-12-02 04:32:51 -0700 (Sat, 02 Dec 2006) | 11 lines

- Disable RTP hold timers while T.38 fax transmission happens
- Encapsulate RTP timers in the rtp structure so we have one for video and one for audio
   The video one is not used in 1.4, really. Will be used for RTP keepalives when we can send
   something that video phones support in the RTP stream.
   I now this is a big architectual change at this stage for 1.4, but decided it was needed
   to avoid future bug reports.
- Document the RTP NAT keepalive option in sip.conf.sample

Issue 7679 in the bug tracker. Please test.


................
r48219 | oej | 2006-12-02 14:45:58 -0700 (Sat, 02 Dec 2006) | 3 lines

- Removing one of two pieces of code to handle 481 response on INVITE
- Move handling of REFER response to handle_response_refer()

................
r48223 | russell | 2006-12-02 23:34:14 -0700 (Sat, 02 Dec 2006) | 3 lines

When "fetch" is in use, instead of "wget", --continue is not a valid option.
(issue #8451)

................
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

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

Modified:
    team/group/bug7433/   (props changed)
    team/group/bug7433/Makefile
    team/group/bug7433/apps/app_dial.c
    team/group/bug7433/apps/app_voicemail.c
    team/group/bug7433/channels/chan_gtalk.c
    team/group/bug7433/channels/chan_iax2.c
    team/group/bug7433/channels/chan_phone.c
    team/group/bug7433/channels/chan_sip.c
    team/group/bug7433/configs/extensions.conf.sample
    team/group/bug7433/configs/sip.conf.sample
    team/group/bug7433/configs/voicemail.conf.sample
    team/group/bug7433/configure
    team/group/bug7433/configure.ac
    team/group/bug7433/doc/manager.txt
    team/group/bug7433/doc/snmp.txt
    team/group/bug7433/include/asterisk/rtp.h
    team/group/bug7433/include/asterisk/utils.h
    team/group/bug7433/main/cdr.c
    team/group/bug7433/main/cli.c
    team/group/bug7433/main/rtp.c
    team/group/bug7433/makeopts.in
    team/group/bug7433/res/res_features.c
    team/group/bug7433/sounds/Makefile

Propchange: team/group/bug7433/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/group/bug7433/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/group/bug7433/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Dec  4 22:15:35 2006
@@ -1,1 +1,1 @@
-/branches/1.4:1-48075
+/branches/1.4:1-48255

Modified: team/group/bug7433/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/Makefile?view=diff&rev=48256&r1=48255&r2=48256
==============================================================================
--- team/group/bug7433/Makefile (original)
+++ team/group/bug7433/Makefile Mon Dec  4 22:15:35 2006
@@ -37,6 +37,11 @@
 export ASTVARLIBDIR
 export ASTDATADIR
 export ASTLOGDIR
+export ASTLIBDIR
+export ASTMANDIR
+export ASTHEADERDIR
+export ASTBINDIR
+export ASTSBINDIR
 export AGI_DIR
 export ASTCONFPATH
 export NOISY_BUILD
@@ -52,6 +57,7 @@
 export PROC
 export SOLINK
 export STRIP
+export DOWNLOAD
 
 # even though we could use '-include makeopts' here, use a wildcard
 # lookup anyway, so that make won't try to build makeopts if it doesn't
@@ -268,14 +274,14 @@
 	@echo " + Asterisk has successfully been built, and +"  
 	@echo " + can be installed by running:              +"
 	@echo " +                                           +"
-	@echo " +               make install                +"  
+	@echo " +               $(MAKE) install                +"  
 	@echo " +-------------------------------------------+"  
 
 _all: cleantest $(SUBDIRS)
 
 makeopts: configure
 	@echo "****"
-	@echo "**** The configure script must be executed before running 'make'."
+	@echo "**** The configure script must be executed before running '$(MAKE)'."
 	@echo "****"
 	@exit 1
 

Modified: team/group/bug7433/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/apps/app_dial.c?view=diff&rev=48256&r1=48255&r2=48256
==============================================================================
--- team/group/bug7433/apps/app_dial.c (original)
+++ team/group/bug7433/apps/app_dial.c Mon Dec  4 22:15:35 2006
@@ -1231,6 +1231,7 @@
 		if (ast_test_flag(outgoing, OPT_MUSICBACK)) {
 			moh = 1;
 			ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK], NULL);
+			ast_indicate(chan, AST_CONTROL_PROGRESS);
 		} else if (ast_test_flag(outgoing, OPT_RINGBACK)) {
 			ast_indicate(chan, AST_CONTROL_RINGING);
 			sentringing++;

Modified: team/group/bug7433/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/apps/app_voicemail.c?view=diff&rev=48256&r1=48255&r2=48256
==============================================================================
--- team/group/bug7433/apps/app_voicemail.c (original)
+++ team/group/bug7433/apps/app_voicemail.c Mon Dec  4 22:15:35 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;
@@ -4648,7 +4651,7 @@
 	if(option_debug > 2)
 		ast_log(LOG_DEBUG,"Before init_mailstream, user is %s\n",vmu->imapuser);
 	ret = init_mailstream(vms, box);
-	if (ret != 0) {
+	if (ret != 0 || !vms->mailstream) {
 		ast_log (LOG_ERROR,"Could not initialize mailstream\n");
 		return -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;
 			}
@@ -8345,15 +8350,16 @@
 
 	if(option_debug > 3)
 		ast_log(LOG_DEBUG, "Entering callback mm_login\n");
-	ast_copy_string(user, mb->user,sizeof(user));
+
+	ast_copy_string(user, mb->user, MAILTMPLEN);
 
 	/* We should only do this when necessary */
 	if (!ast_strlen_zero(authpassword)) {
-		ast_copy_string(pwd, authpassword, sizeof(pwd));
+		ast_copy_string(pwd, authpassword, MAILTMPLEN);
 	} else {
 		AST_LIST_TRAVERSE(&users, vmu, list) {
 			if(!strcasecmp(mb->user, vmu->imapuser)) {
-				ast_copy_string(pwd, vmu->imappassword, sizeof(pwd));
+				ast_copy_string(pwd, vmu->imappassword, MAILTMPLEN);
 				break;
 			}
 		}

Modified: team/group/bug7433/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/channels/chan_gtalk.c?view=diff&rev=48256&r1=48255&r2=48256
==============================================================================
--- team/group/bug7433/channels/chan_gtalk.c (original)
+++ team/group/bug7433/channels/chan_gtalk.c Mon Dec  4 22:15:35 2006
@@ -163,7 +163,6 @@
 };
 
 static const char desc[] = "Gtalk Channel";
-static const char type[] = "Gtalk";
 
 static int usecnt = 0;
 AST_MUTEX_DEFINE_STATIC(usecnt_lock);
@@ -195,7 +194,7 @@
 
 /*! \brief PBX interface structure for channel registration */
 static const struct ast_channel_tech gtalk_tech = {
-	.type = type,
+	.type = "Gtalk",
 	.description = "Gtalk Channel Driver",
 	.capabilities = ((AST_FORMAT_MAX_AUDIO << 1) - 1),
 	.requester = gtalk_request,
@@ -223,7 +222,7 @@
 
 /*! \brief RTP driver interface */
 static struct ast_rtp_protocol gtalk_rtp = {
-	type: "gtalk",
+	type: "Gtalk",
 	get_rtp_info: gtalk_get_rtp_peer,
 	set_rtp_peer: gtalk_set_rtp_peer,
 	get_codec: gtalk_get_codec,
@@ -922,10 +921,12 @@
 	fmt = ast_best_codec(tmp->nativeformats);
 
 	if (i->rtp) {
+		ast_rtp_setstun(i->rtp, 1);
 		tmp->fds[0] = ast_rtp_fd(i->rtp);
 		tmp->fds[1] = ast_rtcp_fd(i->rtp);
 	}
 	if (i->vrtp) {
+		ast_rtp_setstun(i->rtp, 1);
 		tmp->fds[2] = ast_rtp_fd(i->vrtp);
 		tmp->fds[3] = ast_rtcp_fd(i->vrtp);
 	}
@@ -1796,7 +1797,7 @@
 
 	/* Make sure we can register our channel type */
 	if (ast_channel_register(&gtalk_tech)) {
-		ast_log(LOG_ERROR, "Unable to register channel class %s\n", type);
+		ast_log(LOG_ERROR, "Unable to register channel class %s\n", gtalk_tech.type);
 		return -1;
 	}
 	return 0;

Modified: team/group/bug7433/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/channels/chan_iax2.c?view=diff&rev=48256&r1=48255&r2=48256
==============================================================================
--- team/group/bug7433/channels/chan_iax2.c (original)
+++ team/group/bug7433/channels/chan_iax2.c Mon Dec  4 22:15:35 2006
@@ -6935,7 +6935,7 @@
 					if (!strcmp(ies.called_number, ast_parking_ext())) {
 						if (iax_park(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->owner)) {
 							ast_log(LOG_WARNING, "Failed to park call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
-						} else
+						} else if (ast_bridged_channel(iaxs[fr->callno]->owner))
 							ast_log(LOG_DEBUG, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
 					} else {
 						if (ast_async_goto(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->context, ies.called_number, 1))

Modified: team/group/bug7433/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/channels/chan_phone.c?view=diff&rev=48256&r1=48255&r2=48256
==============================================================================
--- team/group/bug7433/channels/chan_phone.c (original)
+++ team/group/bug7433/channels/chan_phone.c Mon Dec  4 22:15:35 2006
@@ -48,11 +48,6 @@
 #include <linux/telephony.h>
 /* Still use some IXJ specific stuff */
 #include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
-# include <linux/compiler.h>
-#endif
-#endif
 #include <linux/ixjuser.h>
 
 #include "asterisk/lock.h"

Modified: team/group/bug7433/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/channels/chan_sip.c?view=diff&rev=48256&r1=48255&r2=48256
==============================================================================
--- team/group/bug7433/channels/chan_sip.c (original)
+++ team/group/bug7433/channels/chan_sip.c Mon Dec  4 22:15:35 2006
@@ -948,8 +948,6 @@
 	time_t lastrtprx;			/*!< Last RTP received */
 	time_t lastrtptx;			/*!< Last RTP sent */
 	int rtptimeout;				/*!< RTP timeout time */
-	int rtpholdtimeout;			/*!< RTP timeout when on hold */
-	int rtpkeepalive;			/*!< Send RTP packets for keepalive */
 	struct sockaddr_in recv;		/*!< Received as */
 	struct in_addr ourip;			/*!< Our IP */
 	struct ast_channel *owner;		/*!< Who owns us (if we have an owner) */
@@ -2593,17 +2591,21 @@
 	if (dialog->rtp) {
 		ast_rtp_setdtmf(dialog->rtp, ast_test_flag(&dialog->flags[0], SIP_DTMF) != SIP_DTMF_INFO);
 		ast_rtp_setdtmfcompensate(dialog->rtp, ast_test_flag(&dialog->flags[1], SIP_PAGE2_RFC2833_COMPENSATE));
+		ast_rtp_set_rtptimeout(dialog->rtp, peer->rtptimeout);
+		ast_rtp_set_rtpholdtimeout(dialog->rtp, peer->rtpholdtimeout);
+		ast_rtp_set_rtpkeepalive(dialog->rtp, peer->rtpkeepalive);
+		/* Set Frame packetization */
+		ast_rtp_codec_setpref(dialog->rtp, &dialog->prefs);
+		dialog->autoframing = peer->autoframing;
 	}
 	if (dialog->vrtp) {
 		ast_rtp_setdtmf(dialog->vrtp, 0);
 		ast_rtp_setdtmfcompensate(dialog->vrtp, 0);
-	}
-
-	/* Set Frame packetization */
-	if (dialog->rtp) {
-		ast_rtp_codec_setpref(dialog->rtp, &dialog->prefs);
-		dialog->autoframing = peer->autoframing;
-	}
+		ast_rtp_set_rtptimeout(dialog->vrtp, peer->rtptimeout);
+		ast_rtp_set_rtpholdtimeout(dialog->vrtp, peer->rtpholdtimeout);
+		ast_rtp_set_rtpkeepalive(dialog->vrtp, peer->rtpkeepalive);
+	}
+
 	ast_string_field_set(dialog, peername, peer->username);
 	ast_string_field_set(dialog, authname, peer->username);
 	ast_string_field_set(dialog, username, peer->username);
@@ -2642,8 +2644,6 @@
 		dialog->noncodeccapability &= ~AST_RTP_DTMF;
 	ast_string_field_set(dialog, context, peer->context);
 	dialog->rtptimeout = peer->rtptimeout;
-	dialog->rtpholdtimeout = peer->rtpholdtimeout;
-	dialog->rtpkeepalive = peer->rtpkeepalive;
 	if (peer->call_limit)
 		ast_set_flag(&dialog->flags[0], SIP_CALL_LIMIT);
 	dialog->maxcallbitrate = peer->maxcallbitrate;
@@ -2945,7 +2945,7 @@
 static int update_call_counter(struct sip_pvt *fup, int event)
 {
 	char name[256];
-	int *inuse=NULL, *call_limit=NULL, *inringing=NULL;
+	int *inuse = NULL, *call_limit = NULL, *inringing = NULL;
 	int outgoing = ast_test_flag(&fup->flags[0], SIP_OUTGOING);
 	struct sip_user *u = NULL;
 	struct sip_peer *p = NULL;
@@ -3473,15 +3473,12 @@
 	case AST_FRAME_MODEM:
 		if (p) {
 			ast_mutex_lock(&p->lock);
-			if (p->udptl) {
-				if ((ast->_state != AST_STATE_UP) &&
-					!ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) && 
-				    !ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
-					transmit_response_with_t38_sdp(p, "183 Session Progress", &p->initreq, XMIT_UNRELIABLE);
-					ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);
-				}
+			/* UDPTL requires two-way communication, so early media is not needed here.
+				we simply forget the frames if we get modem frames before the bridge is up.
+				Fax will re-transmit.
+			*/
+			if (p->udptl && ast->_state != AST_STATE_UP) 
 				res = ast_udptl_write(p->udptl, frame);
-			}
 			ast_mutex_unlock(&p->lock);
 		}
 		break;
@@ -4176,16 +4173,19 @@
 		ast_rtp_setdtmf(p->rtp, ast_test_flag(&p->flags[0], SIP_DTMF) != SIP_DTMF_INFO);
 		ast_rtp_setdtmfcompensate(p->rtp, ast_test_flag(&p->flags[1], SIP_PAGE2_RFC2833_COMPENSATE));
 		ast_rtp_settos(p->rtp, global_tos_audio);
+		ast_rtp_set_rtptimeout(p->rtp, global_rtptimeout);
+		ast_rtp_set_rtpholdtimeout(p->rtp, global_rtpholdtimeout);
+		ast_rtp_set_rtpkeepalive(p->rtp, global_rtpkeepalive);
 		if (p->vrtp) {
 			ast_rtp_settos(p->vrtp, global_tos_video);
 			ast_rtp_setdtmf(p->vrtp, 0);
 			ast_rtp_setdtmfcompensate(p->vrtp, 0);
+			ast_rtp_set_rtptimeout(p->vrtp, global_rtptimeout);
+			ast_rtp_set_rtpholdtimeout(p->vrtp, global_rtpholdtimeout);
+			ast_rtp_set_rtpkeepalive(p->vrtp, global_rtpkeepalive);
 		}
 		if (p->udptl)
 			ast_udptl_settos(p->udptl, global_tos_audio);
-		p->rtptimeout = global_rtptimeout;
-		p->rtpholdtimeout = global_rtpholdtimeout;
-		p->rtpkeepalive = global_rtpkeepalive;
 		p->maxcallbitrate = default_maxcallbitrate;
 	}
 
@@ -7232,7 +7232,8 @@
 		ast_string_field_set(p, domain, r->domain);
 		ast_string_field_set(p, opaque, r->opaque);
 		ast_string_field_set(p, qop, r->qop);
-		p->noncecount = r->noncecount++;
+		r->noncecount++;
+		p->noncecount = r->noncecount;
 
 		memset(digest,0,sizeof(digest));
 		if(!build_reply_digest(p, sipmethod, digest, sizeof(digest)))
@@ -10188,6 +10189,7 @@
 	ast_cli(fd, "  T1 minimum:             %d\n", global_t1min);
 	ast_cli(fd, "  Relax DTMF:             %s\n", global_relaxdtmf ? "Yes" : "No");
 	ast_cli(fd, "  Compact SIP headers:    %s\n", compactheaders ? "Yes" : "No");
+	ast_cli(fd, "  RTP Keepalive:          %d %s\n", global_rtpkeepalive, global_rtpkeepalive ? "" : "(Disabled)" );
 	ast_cli(fd, "  RTP Timeout:            %d %s\n", global_rtptimeout, global_rtptimeout ? "" : "(Disabled)" );
 	ast_cli(fd, "  RTP Hold Timeout:       %d %s\n", global_rtpholdtimeout, global_rtpholdtimeout ? "" : "(Disabled)");
 	ast_cli(fd, "  MWI NOTIFY mime type:   %s\n", default_notifymime);
@@ -11602,6 +11604,9 @@
 				if (bridgepvt->udptl) {
 					if (p->t38.state == T38_PEER_REINVITE) {
 						sip_handle_t38_reinvite(bridgepeer, p, 0);
+						ast_rtp_set_rtptimers_onhold(p->rtp);
+						if (p->vrtp)
+							ast_rtp_set_rtptimers_onhold(p->vrtp);	/* Turn off RTP timers while we send fax */
 					} else if (p->t38.state == T38_DISABLED && bridgepeer && (bridgepvt->t38.state == T38_ENABLED)) {
 						ast_log(LOG_WARNING, "RTP re-inivte after T38 session not handled yet !\n");
 						/* Insted of this we should somehow re-invite the other side of the bridge to RTP */
@@ -11694,9 +11699,12 @@
 		break;
 
 	case 481: /* Call leg does not exist */
-		/* Could be REFER or INVITE */
+		/* Could be REFER caused INVITE with replaces */
 		ast_log(LOG_WARNING, "Re-invite to non-existing call leg on other UA. SIP dialog '%s'. Giving up.\n", p->callid);
 		transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
+		if (p->owner)
+			ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+		sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 		break;
 
 	case 491: /* Pending */
@@ -11756,7 +11764,16 @@
 			ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
 		}
 		break;
-
+	case 481: /* Call leg does not exist */
+
+		/* A transfer with Replaces did not work */
+		/* OEJ: We should Set flag, cancel the REFER, go back
+		to original call - but right now we can't */
+		ast_log(LOG_WARNING, "Remote host can't match REFER request to call '%s'. Giving up.\n", p->callid);
+		if (p->owner)
+			ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+		break;
 
 	case 500:   /* Server error */
 	case 501:   /* Method not implemented */
@@ -12091,21 +12108,9 @@
 			break;
 		case 481: /* Call leg does not exist */
 			if (sipmethod == SIP_INVITE) {
-				/* First we ACK */
-				transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
-				if (option_debug)
-					ast_log(LOG_DEBUG, "Got 481 on Invite. Assuming INVITE with REPLACEs failed to '%s'\n", get_header(&p->initreq, "From"));
-				if (owner)
-					ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
-				sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+				handle_response_invite(p, resp, rest, req, seqno);
 			} else if (sipmethod == SIP_REFER) {
-				/* A transfer with Replaces did not work */
-				/* OEJ: We should Set flag, cancel the REFER, go back
-				to original call - but right now we can't */
-				ast_log(LOG_WARNING, "Remote host can't match request %s to call '%s'. Giving up.\n", sip_methods[sipmethod].text, p->callid);
-				if (owner)
-					ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
-				ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+				handle_response_refer(p, resp, rest, req, seqno);
 			} else if (sipmethod == SIP_BYE) {
 				/* The other side has no transaction to bye,
 				just assume it's all right then */
@@ -14330,7 +14335,7 @@
 		error = 1;
 	}
 	if (error) {
-		if (!p->initreq.header)	/* New call */
+		if (!p->initreq.headers)	/* New call */
 			ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	/* Make sure we destroy this dialog */
 		return -1;
 	}
@@ -14720,23 +14725,23 @@
 			    (sip->owner->_state == AST_STATE_UP) &&
 			    !sip->redirip.sin_addr.s_addr) {
 				if (sip->lastrtptx &&
-				    sip->rtpkeepalive &&
-				    (t > sip->lastrtptx + sip->rtpkeepalive)) {
+				    ast_rtp_get_rtpkeepalive(sip->rtp) &&
+				    (t > sip->lastrtptx + ast_rtp_get_rtpkeepalive(sip->rtp))) {
 					/* Need to send an empty RTP packet */
 					sip->lastrtptx = time(NULL);
 					ast_rtp_sendcng(sip->rtp, 0);
 				}
 				if (sip->lastrtprx &&
-				    (sip->rtptimeout || sip->rtpholdtimeout) &&
-				    (t > sip->lastrtprx + sip->rtptimeout)) {
+					(ast_rtp_get_rtptimeout(sip->rtp) || ast_rtp_get_rtpholdtimeout(sip->rtp)) &&
+				    (t > sip->lastrtprx + ast_rtp_get_rtptimeout(sip->rtp))) {
 					/* Might be a timeout now -- see if we're on hold */
 					struct sockaddr_in sin;
 					ast_rtp_get_peer(sip->rtp, &sin);
 					if (sin.sin_addr.s_addr || 
-					    (sip->rtpholdtimeout && 
-					     (t > sip->lastrtprx + sip->rtpholdtimeout))) {
+					    (ast_rtp_get_rtpholdtimeout(sip->rtp) &&
+					     (t > sip->lastrtprx + ast_rtp_get_rtpholdtimeout(sip->rtp)))) {
 						/* Needs a hangup */
-						if (sip->rtptimeout) {
+						if (ast_rtp_get_rtptimeout(sip->rtp)) {
 							while (sip->owner && ast_channel_trylock(sip->owner)) {
 								ast_mutex_unlock(&sip->lock);
 								usleep(1);
@@ -14757,8 +14762,12 @@
 								   has already been requested and we don't want to
 								   repeatedly request hangups
 								*/
-								sip->rtptimeout = 0;
-								sip->rtpholdtimeout = 0;
+								ast_rtp_set_rtptimeout(sip->rtp, 0);
+								ast_rtp_set_rtpholdtimeout(sip->rtp, 0);
+								if (sip->vrtp) {
+									ast_rtp_set_rtptimeout(sip->vrtp, 0);
+									ast_rtp_set_rtpholdtimeout(sip->vrtp, 0);
+								}
 							}
 						}
 					}
@@ -16021,6 +16030,8 @@
 			compactheaders = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "notifymimetype")) {
 			ast_copy_string(default_notifymime, v->value, sizeof(default_notifymime));
+		} else if (!strcasecmp(v->name, "limitonpeers")) {
+			global_limitonpeers = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "notifyringing")) {
 			global_notifyringing = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "limitpeersonly")) {

Modified: team/group/bug7433/configs/extensions.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/configs/extensions.conf.sample?view=diff&rev=48256&r1=48255&r2=48256
==============================================================================
--- team/group/bug7433/configs/extensions.conf.sample (original)
+++ team/group/bug7433/configs/extensions.conf.sample Mon Dec  4 22:15:35 2006
@@ -167,7 +167,7 @@
 ;
 ; List canonical entries here
 ;
-;exten => 12564286000,1,Macro(std-exten,6000,IAX2/foo)
+;exten => 12564286000,1,Macro(stdexten,6000,IAX2/foo)
 ;exten => _125642860XX,1,Dial(IAX2/otherbox/${EXTEN:7})
 
 [dundi-e164-customers]

Modified: team/group/bug7433/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/configs/sip.conf.sample?view=diff&rev=48256&r1=48255&r2=48256
==============================================================================
--- team/group/bug7433/configs/sip.conf.sample (original)
+++ team/group/bug7433/configs/sip.conf.sample Mon Dec  4 22:15:35 2006
@@ -35,6 +35,7 @@
 				; Realms MUST be globally unique according to RFC 3261
 				; Set this to your host name or domain name
 bindport=5060			; UDP Port to bind to (SIP standard port is 5060)
+				; bindport is the local UDP port that Asterisk will listen on
 bindaddr=0.0.0.0		; IP address to bind to (0.0.0.0 binds to all)
 srvlookup=yes			; Enable DNS SRV lookups on outbound calls
 				; Note: Asterisk only uses the first host 
@@ -90,10 +91,6 @@
 ;language=en			; Default language setting for all users/peers
 				; This may also be set for individual users/peers
 ;relaxdtmf=yes			; Relax dtmf handling
-;rtptimeout=60			; Terminate call if 60 seconds of no RTP activity
-				; when we're not on hold
-;rtpholdtimeout=300		; Terminate call if 300 seconds of no RTP activity
-				; when we're on hold (must be > rtptimeout)
 ;trustrpid = no			; If Remote-Party-ID should be trusted
 ;sendrpid = yes			; If Remote-Party-ID should be sent
 ;progressinband=never		; If we should generate in-band ringing always
@@ -155,6 +152,21 @@
 ;
 ;regcontext=sipregistrations
 ;
+;--------------------------- RTP timers ----------------------------------------------------
+; These timers are currently used for both audio and video streams. The RTP timeouts
+; are only applied to the audio channel.
+; The settings are settable in the global section as well as per device
+;
+;rtptimeout=60			; Terminate call if 60 seconds of no RTP or RTCP activity
+				; on the audio channel
+				; when we're not on hold. This is to be able to hangup
+				; a call in the case of a phone disappearing from the net,
+				; like a powerloss or grandma tripping over a cable.
+;rtpholdtimeout=300		; Terminate call if 300 seconds of no RTP or RTCP activity
+				; on the audio channel
+				; when we're on hold (must be > rtptimeout)
+;rtpkeepalive=<secs>		; Send keepalives in the RTP stream to keep NAT open
+				; (default is off - zero)
 ;--------------------------- SIP DEBUGGING ---------------------------------------------------
 ;sipdebug = yes			; Turn on SIP debugging by default, from
 				; the moment the channel loads this configuration
@@ -168,6 +180,15 @@
 ; You can subscribe to the status of extensions with a "hint" priority
 ; (See extensions.conf.sample for examples)
 ; chan_sip support two major formats for notifications: dialog-info and SIMPLE 
+;
+; You will get more detailed reports (busy etc) if you have a call limit set
+; for a device. When the call limit is filled, we will indicate busy. Note that
+; you need at least 2 in order to be able to do attended transfers.
+;
+; For queues, you will need this level of detail in status reporting, regardless
+; if you use SIP subscriptions. Queues and manager use the same internal interface
+; for reading status information.
+;
 ; Note: Subscriptions does not work if you have a realtime dialplan and use the
 ; realtime switch.
 ;
@@ -179,13 +200,20 @@
 ;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 
+				; 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
+				; the peer limit instead of applying two call limits,
+				; one for the peer and one for the user.
 
 ;----------------------------------------- T.38 FAX PASSTHROUGH SUPPORT -----------------------
 ;
 ; This setting is available in the [general] section as well as in device configurations.
 ; Setting this to yes, enables T.38 fax (UDPTL) passthrough on SIP to SIP calls, provided
-; both parties have T38 support enabled in their Asterisk configuration (either general or
-; peer/user/friend sections)
+; 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. 
 ;
 ; t38pt_udptl = yes            ; Default false
 ;
@@ -476,8 +504,9 @@
 ;usereqphone=yes			; This provider requires ";user=phone" on URI
 ;call-limit=5				; permit only 5 simultaneous outgoing calls to this peer
 ;outboundproxy=proxy.provider.domain	; send outbound signaling to this proxy, not directly to the peer
-				; Call-limits will not be enforced on real-time peers,
-				; since they are not stored in-memory
+					; Call-limits will not be enforced on real-time peers,
+					; since they are not stored in-memory
+;port=80				; The port number we want to connect to on the remote side
 
 ;------------------------------------------------------------------------------
 ; Definitions of locally connected SIP devices

Modified: team/group/bug7433/configs/voicemail.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/configs/voicemail.conf.sample?view=diff&rev=48256&r1=48255&r2=48256
==============================================================================
--- team/group/bug7433/configs/voicemail.conf.sample (original)
+++ team/group/bug7433/configs/voicemail.conf.sample Mon Dec  4 22:15:35 2006
@@ -83,6 +83,12 @@
 ;fromstring=The Asterisk PBX
 ; Permit finding entries for forward/compose from the directory
 ;usedirectory=yes

[... 639 lines stripped ...]


More information about the asterisk-commits mailing list