[asterisk-commits] oej: branch oej/videocaps r48211 - in /team/oej/videocaps: ./ agi/ apps/ chan...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Dec 2 11:54:42 MST 2006


Author: oej
Date: Sat Dec  2 12:54:41 2006
New Revision: 48211

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48211
Log:
Update to trunk

Removed:
    team/oej/videocaps/main/coef_in.h
    team/oej/videocaps/main/coef_out.h
Modified:
    team/oej/videocaps/   (props changed)
    team/oej/videocaps/Makefile
    team/oej/videocaps/agi/Makefile
    team/oej/videocaps/agi/eagi-sphinx-test.c
    team/oej/videocaps/agi/eagi-test.c
    team/oej/videocaps/apps/app_dial.c
    team/oej/videocaps/apps/app_sms.c
    team/oej/videocaps/apps/app_voicemail.c
    team/oej/videocaps/channels/chan_gtalk.c
    team/oej/videocaps/channels/chan_iax2.c
    team/oej/videocaps/channels/chan_phone.c
    team/oej/videocaps/channels/chan_sip.c
    team/oej/videocaps/channels/chan_zap.c
    team/oej/videocaps/codecs/codec_zap.c
    team/oej/videocaps/configs/extensions.conf.sample
    team/oej/videocaps/configs/http.conf.sample
    team/oej/videocaps/configs/sip.conf.sample
    team/oej/videocaps/configure
    team/oej/videocaps/configure.ac
    team/oej/videocaps/contrib/asterisk-ng-doxygen
    team/oej/videocaps/doc/asterisk-conf.txt
    team/oej/videocaps/doc/manager.txt
    team/oej/videocaps/funcs/func_cdr.c
    team/oej/videocaps/include/asterisk/causes.h
    team/oej/videocaps/include/asterisk/channel.h
    team/oej/videocaps/include/asterisk/devicestate.h
    team/oej/videocaps/include/asterisk/doxyref.h
    team/oej/videocaps/include/asterisk/pbx.h
    team/oej/videocaps/include/asterisk/rtp.h
    team/oej/videocaps/include/asterisk/threadstorage.h
    team/oej/videocaps/include/asterisk/utils.h
    team/oej/videocaps/main/callerid.c
    team/oej/videocaps/main/cdr.c
    team/oej/videocaps/main/channel.c
    team/oej/videocaps/main/cli.c
    team/oej/videocaps/main/devicestate.c
    team/oej/videocaps/main/fskmodem.c
    team/oej/videocaps/main/http.c
    team/oej/videocaps/main/manager.c
    team/oej/videocaps/main/pbx.c
    team/oej/videocaps/main/rtp.c
    team/oej/videocaps/main/tdd.c
    team/oej/videocaps/main/translate.c
    team/oej/videocaps/main/utils.c
    team/oej/videocaps/makeopts.in
    team/oej/videocaps/pbx/pbx_spool.c
    team/oej/videocaps/res/res_features.c
    team/oej/videocaps/res/res_musiconhold.c
    team/oej/videocaps/sounds/Makefile

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Dec  2 12:54:41 2006
@@ -1,1 +1,1 @@
-/trunk:1-47956
+/trunk:1-48207

Modified: team/oej/videocaps/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/Makefile?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/Makefile (original)
+++ team/oej/videocaps/Makefile Sat Dec  2 12:54:41 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/oej/videocaps/agi/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/agi/Makefile?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/agi/Makefile (original)
+++ team/oej/videocaps/agi/Makefile Sat Dec  2 12:54:41 2006
@@ -21,7 +21,7 @@
 
 include $(ASTTOPDIR)/Makefile.rules
 
-all: ##$(AGIS)
+all: #$(AGIS)
 
 strcompat.c: ../main/strcompat.c
 	@cp $< $@

Modified: team/oej/videocaps/agi/eagi-sphinx-test.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/agi/eagi-sphinx-test.c?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/agi/eagi-sphinx-test.c (original)
+++ team/oej/videocaps/agi/eagi-sphinx-test.c Sat Dec  2 12:54:41 2006
@@ -4,6 +4,15 @@
  * This code is released into public domain
  * without any warranty of any kind.
  *
+ */
+
+/*! \file
+ * Extended AGI test application
+ *
+ * This code is released into public domain
+ * without any warranty of any kind.
+ *
+ *	\ingroup agi
  */
 
 #include <stdio.h>

Modified: team/oej/videocaps/agi/eagi-test.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/agi/eagi-test.c?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/agi/eagi-test.c (original)
+++ team/oej/videocaps/agi/eagi-test.c Sat Dec  2 12:54:41 2006
@@ -17,6 +17,15 @@
 #include "asterisk/compat.h"
 
 #define AUDIO_FILENO (STDERR_FILENO + 1)
+
+/*! \file
+ * Extended AGI test application
+ *
+ * This code is released into the public domain
+ * with no warranty of any kind
+ *
+ * \ingroup agi
+ */
 
 static int read_environment(void)
 {

Modified: team/oej/videocaps/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/apps/app_dial.c?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/apps/app_dial.c (original)
+++ team/oej/videocaps/apps/app_dial.c Sat Dec  2 12:54:41 2006
@@ -1441,6 +1441,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/oej/videocaps/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/apps/app_sms.c?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/apps/app_sms.c (original)
+++ team/oej/videocaps/apps/app_sms.c Sat Dec  2 12:54:41 2006
@@ -119,59 +119,59 @@
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 };
 
-#define SMSLEN 160              /* max SMS length */
+#define SMSLEN 160              /*!< max SMS length */
 
 typedef struct sms_s
 {
-	unsigned char hangup;        /* we are done... */
-	unsigned char err;           /* set for any errors */
-	unsigned char smsc:1;        /* we are SMSC */
-	unsigned char rx:1;          /* this is a received message */
-	char queue[30];              /* queue name */
-	char oa[20];                 /* originating address */
-	char da[20];                 /* destination address */
-	time_t scts;                 /* time stamp, UTC */
-	unsigned char pid;           /* protocol ID */
-	unsigned char dcs;           /* data coding scheme */
-	short mr;                    /* message reference - actually a byte, but usde -1 for not set */
-	int udl;                     /* user data length */
-	int udhl;                    /* user data header length */
-	unsigned char srr:1;         /* Status Report request */
-	unsigned char udhi:1;        /* User Data Header required, even if length 0 */
-	unsigned char rp:1;          /* Reply Path */
-	unsigned int vp;             /* validity period in minutes, 0 for not set */
-	unsigned short ud[SMSLEN];   /* user data (message), UCS-2 coded */
-	unsigned char udh[SMSLEN];   /* user data header */
-	char cli[20];                /* caller ID */
-	unsigned char ophase;        /* phase (0-79) for 0 and 1 frequencies (1300Hz and 2100Hz) */
-	unsigned char ophasep;       /* phase (0-79) for 1200 bps */
-	unsigned char obyte;         /* byte being sent */
-	unsigned int opause;         /* silent pause before sending (in sample periods) */
-	unsigned char obitp;         /* bit in byte */
-	unsigned char osync;         /* sync bits to send */
-	unsigned char obytep;        /* byte in data */
-	unsigned char obyten;        /* bytes in data */
-	unsigned char omsg[256];     /* data buffer (out) */
-	unsigned char imsg[200];     /* data buffer (in) */
+	unsigned char hangup;        /*!< we are done... */
+	unsigned char err;           /*!< set for any errors */
+	unsigned char smsc:1;        /*!< we are SMSC */
+	unsigned char rx:1;          /*!< this is a received message */
+	char queue[30];              /*!< queue name */
+	char oa[20];                 /*!< originating address */
+	char da[20];                 /*!< destination address */
+	time_t scts;                 /*!< time stamp, UTC */
+	unsigned char pid;           /*!< protocol ID */
+	unsigned char dcs;           /*!< data coding scheme */
+	short mr;                    /*!< message reference - actually a byte, but usde -1 for not set */
+	int udl;                     /*!< user data length */
+	int udhl;                    /*!< user data header length */
+	unsigned char srr:1;         /*!< Status Report request */
+	unsigned char udhi:1;        /*!< User Data Header required, even if length 0 */
+	unsigned char rp:1;          /*!< Reply Path */
+	unsigned int vp;             /*!< validity period in minutes, 0 for not set */
+	unsigned short ud[SMSLEN];   /*!< user data (message), UCS-2 coded */
+	unsigned char udh[SMSLEN];   /*!< user data header */
+	char cli[20];                /*!< caller ID */
+	unsigned char ophase;        /*!< phase (0-79) for 0 and 1 frequencies (1300Hz and 2100Hz) */
+	unsigned char ophasep;       /*!< phase (0-79) for 1200 bps */
+	unsigned char obyte;         /*!< byte being sent */
+	unsigned int opause;         /*!< silent pause before sending (in sample periods) */
+	unsigned char obitp;         /*!< bit in byte */
+	unsigned char osync;         /*!< sync bits to send */
+	unsigned char obytep;        /*!< byte in data */
+	unsigned char obyten;        /*!< bytes in data */
+	unsigned char omsg[256];     /*!< data buffer (out) */
+	unsigned char imsg[200];     /*!< data buffer (in) */
 	signed long long ims0,
 		imc0,
 		ims1,
-		imc1;                      /* magnitude averages sin/cos 0/1 */
+		imc1;                      /*!< magnitude averages sin/cos 0/1 */
 	unsigned int idle;
-	unsigned short imag;         /* signal level */
+	unsigned short imag;         /*!< signal level */
 	unsigned char ips0,
 		ips1,
 		ipc0,
-		ipc1;                      /* phase sin/cos 0/1 */
-	unsigned char ibitl;         /* last bit */
-	unsigned char ibitc;         /* bit run length count */
-	unsigned char iphasep;       /* bit phase (0-79) for 1200 bps */
-	unsigned char ibitn;         /* bit number in byte being received */
-	unsigned char ibytev;        /* byte value being received */
-	unsigned char ibytep;        /* byte pointer in messafe */
-	unsigned char ibytec;        /* byte checksum for message */
-	unsigned char ierr;          /* error flag */
-	unsigned char ibith;         /* history of last bits */
+		ipc1;                      /*!< phase sin/cos 0/1 */
+	unsigned char ibitl;         /*!< last bit */
+	unsigned char ibitc;         /*!< bit run length count */
+	unsigned char iphasep;       /*!< bit phase (0-79) for 1200 bps */
+	unsigned char ibitn;         /*!< bit number in byte being received */
+	unsigned char ibytev;        /*!< byte value being received */
+	unsigned char ibytep;        /*!< byte pointer in messafe */
+	unsigned char ibytec;        /*!< byte checksum for message */
+	unsigned char ierr;          /*!< error flag */
+	unsigned char ibith;         /*!< history of last bits */
 	unsigned char ibitt;         /* total of 1's in last 3 bites */
 	/* more to go here */
 } sms_t;

Modified: team/oej/videocaps/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/apps/app_voicemail.c?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/apps/app_voicemail.c (original)
+++ team/oej/videocaps/apps/app_voicemail.c Sat Dec  2 12:54:41 2006
@@ -4673,7 +4673,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;
 	}
@@ -6970,22 +6970,13 @@
 			}
 		}
 		AST_LIST_TRAVERSE(&users, vmu, list) {
-			char dirname[256];
-			DIR *vmdir;
-			struct dirent *vment;
-			int vmcount = 0;
-			char count[12];
+			int newmsgs = 0, oldmsgs = 0;
+			char count[12], tmp[256] = "";
 
 			if ((argc == 3) || ((argc == 5) && !strcmp(argv[4],vmu->context))) {
-				make_dir(dirname, 255, vmu->context, vmu->mailbox, "INBOX");
-				if ((vmdir = opendir(dirname))) {
-					/* No matter what the format of VM, there will always be a .txt file for each message. */
-					while ((vment = readdir(vmdir)))
-						if (strlen(vment->d_name) > 7 && !strncmp(vment->d_name + 7,".txt",4))
-							vmcount++;
-					closedir(vmdir);
-				}
-				snprintf(count,sizeof(count),"%d",vmcount);
+				snprintf(tmp, sizeof(tmp), "%s@%s", vmu->mailbox, ast_strlen_zero(vmu->context) ? "default" : vmu->context);
+				inboxcount(tmp, &newmsgs, &oldmsgs);
+				snprintf(count,sizeof(count),"%d",newmsgs);
 				ast_cli(fd, output_format, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count);
 			}
 		}
@@ -8481,15 +8472,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/oej/videocaps/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/channels/chan_gtalk.c?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/channels/chan_gtalk.c (original)
+++ team/oej/videocaps/channels/chan_gtalk.c Sat Dec  2 12:54:41 2006
@@ -163,7 +163,6 @@
 };
 
 static const char desc[] = "Gtalk Channel";
-static const char type[] = "Gtalk";
 
 static int global_capability = AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_GSM | AST_FORMAT_H263;
 
@@ -192,7 +191,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,
@@ -220,7 +219,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,
@@ -921,10 +920,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);
 	}
@@ -1790,7 +1791,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/oej/videocaps/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/channels/chan_iax2.c?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/channels/chan_iax2.c (original)
+++ team/oej/videocaps/channels/chan_iax2.c Sat Dec  2 12:54:41 2006
@@ -1195,6 +1195,20 @@
 	return res;
 }
 
+/*!
+ * \todo XXX Note that this function contains a very expensive operation that
+ * happens for *every* incoming media frame.  It iterates through every
+ * possible call number, locking and unlocking each one, to try to match the
+ * incoming frame to an active call.  Call numbers can be up to 2^15, 32768.
+ * So, for an call with a local call number of 20000, every incoming audio
+ * frame would require 20000 mutex lock and unlock operations.  Ouch.
+ *
+ * It's a shame that IAX2 media frames carry the source call number instead of
+ * the destination call number.  If they did, this lookup wouldn't be needed.
+ * However, it's too late to change that now.  Instead, we need to come up with
+ * a better way of indexing active calls so that these frequent lookups are not
+ * so expensive.
+ */
 static int find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int lockpeer, int sockfd)
 {
 	int res = 0;
@@ -6974,7 +6988,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)) {
 							if (option_debug)
 								ast_log(LOG_DEBUG, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
 						}

Modified: team/oej/videocaps/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/channels/chan_phone.c?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/channels/chan_phone.c (original)
+++ team/oej/videocaps/channels/chan_phone.c Sat Dec  2 12:54:41 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/oej/videocaps/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/channels/chan_sip.c?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/channels/chan_sip.c (original)
+++ team/oej/videocaps/channels/chan_sip.c Sat Dec  2 12:54:41 2006
@@ -980,8 +980,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) */
@@ -2766,21 +2764,25 @@
 	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);
+		ast_rtp_set_rtptimeout(dialog->vrtp, peer->rtptimeout);
+		ast_rtp_set_rtpholdtimeout(dialog->vrtp, peer->rtpholdtimeout);
+		ast_rtp_set_rtpkeepalive(dialog->vrtp, peer->rtpkeepalive);
 	}
 	if (dialog->trtp) {
 		ast_rtp_setdtmf(dialog->trtp, 0);
 		ast_rtp_setdtmfcompensate(dialog->trtp, 0);
 	}
 
-	/* Set Frame packetization */
-	if (dialog->rtp) {
-		ast_rtp_codec_setpref(dialog->rtp, &dialog->prefs);
-		dialog->autoframing = peer->autoframing;
-	}
 	ast_string_field_set(dialog, peername, peer->username);
 	ast_string_field_set(dialog, authname, peer->username);
 	ast_string_field_set(dialog, username, peer->username);
@@ -2818,8 +2820,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);
 	ast_copy_capabilities(&dialog->caps, &peer->caps);
@@ -3157,9 +3157,9 @@
 
 	/* Check the list of users only for incoming calls */
 	if (global_limitonpeers == FALSE && !outgoing && (u = find_user(name, 1)))  {
-			inuse = &u->inUse;
-			call_limit = &u->call_limit;
-			inringing = NULL;
+		inuse = &u->inUse;
+		call_limit = &u->call_limit;
+		inringing = NULL;
 	} else if ( (p = find_peer(ast_strlen_zero(fup->peername) ? name : fup->peername, NULL, 1) ) ) { /* Try to find peer */
 		inuse = &p->inUse;
 		call_limit = &p->call_limit;
@@ -3687,15 +3687,12 @@
 	case AST_FRAME_MODEM:
 		if (p) {
 			sip_pvt_lock(p);
-			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);
-			}
 			sip_pvt_unlock(p);
 		}
 		break;
@@ -4513,10 +4510,16 @@
 		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->trtp) {
 			ast_rtp_settos(p->trtp, global_tos_text);
@@ -4525,9 +4528,6 @@
 		}
 		if (p->udptl)
 			ast_udptl_settos(p->udptl, global_tos_audio);
-		p->rtptimeout = global_rtptimeout;
-		p->rtpholdtimeout = global_rtpholdtimeout;
-		p->rtpkeepalive = global_rtpkeepalive;
 		p->videoupdate = global_videoupdate;
 		ast_copy_capabilities(&p->caps, &global_caps);
 	}
@@ -8121,7 +8121,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)))
@@ -11233,6 +11234,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);
@@ -12634,6 +12636,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 */
@@ -13142,7 +13147,8 @@
 			if (sipmethod == SIP_INVITE) {
 				/* First we ACK */
 				transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
-					ast_log(LOG_WARNING, "INVITE with REPLACEs failed to '%s'\n", get_header(&p->initreq, "From"));
+				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);
@@ -15279,7 +15285,7 @@
 
 			if ((firststate = ast_extension_state(NULL, p->context, p->exten)) < 0) {
 
-				ast_log(LOG_ERROR, "Got SUBSCRIBE for extension %s@%s from %s, but there is no hint for that extension\n", p->exten, p->context, ast_inet_ntoa(p->sa.sin_addr));
+				ast_log(LOG_NOTICE, "Got SUBSCRIBE for extension %s@%s from %s, but there is no hint for that extension.\n", p->exten, p->context, ast_inet_ntoa(p->sa.sin_addr));
 				transmit_response(p, "404 Not found", req);
 				ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 				return 0;
@@ -15372,7 +15378,6 @@
 {
 	/* Called with p->lock held, as well as p->owner->lock if appropriate, keeping things
 	   relatively static */
-	struct sip_request resp;
 	const char *cmd;
 	const char *cseq;
 	const char *useragent;
@@ -15384,9 +15389,6 @@
 	char *e;
 	int error = 0;
 
-	/* Clear out potential response */
-	memset(&resp, 0, sizeof(resp));
-
 	/* Get Method and Cseq */
 	cseq = get_header(req, "Cseq");
 	cmd = req->header[0];
@@ -15401,7 +15403,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;
 	}
@@ -15740,52 +15742,66 @@
 
 
 /*! \brief helper function for the monitoring thread */
-static void check_rtp_timeout(struct sip_pvt *sip, time_t t)
-{
-	if (sip->rtp && sip->owner &&
-	    (sip->owner->_state == AST_STATE_UP) &&
-	    !sip->redirip.sin_addr.s_addr) {
-		if (sip->lastrtptx &&
-		    sip->rtpkeepalive &&
-		    (t > sip->lastrtptx + sip->rtpkeepalive)) {
-			/* 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)) {
-			/* 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))) {
-				/* Needs a hangup */
-				if (sip->rtptimeout) {
-					while (sip->owner && ast_channel_trylock(sip->owner)) {
-						sip_pvt_unlock(sip);
-						usleep(1);
-						sip_pvt_lock(sip);
-					}
-					if (sip->owner) {
-						if (!(ast_rtp_get_bridged(sip->rtp))) {
-							ast_log(LOG_NOTICE,
-								"Disconnecting call '%s' for lack of RTP activity in %ld seconds\n",
-								sip->owner->name,
-								(long) (t - sip->lastrtprx));
-							/* Issue a softhangup */
-							ast_softhangup_nolock(sip->owner, AST_SOFTHANGUP_DEV);
-						} else
-							ast_log(LOG_NOTICE, "'%s' will not be disconnected in %ld seconds because it is directly bridged to another RTP stream\n", sip->owner->name, (long) (t - sip->lastrtprx));
-						ast_channel_unlock(sip->owner);
-						/* forget the timeouts for this call, since a hangup
-						   has already been requested and we don't want to
-						   repeatedly request hangups
-						*/
-						sip->rtptimeout = 0;
-						sip->rtpholdtimeout = 0;
-					}
+static void check_rtp_timeout(struct sip_pvt *dialog, time_t t)
+{
+	/* If we have no RTP or no active owner, no need to check timers */
+	if (!dialog->rtp || !dialog->owner)
+		return;
+	/* If the call is not in UP state or redirected outside Asterisk, no need to check timers */
+	if (dialog->owner->_state != AST_STATE_UP || dialog->redirip.sin_addr.s_addr)
+		return;
+
+	/* If we have no timers set, return now */
+	if (ast_rtp_get_rtpkeepalive(dialog->rtp) == 0 || (ast_rtp_get_rtptimeout(dialog->rtp) == 0 && ast_rtp_get_rtpholdtimeout(dialog->rtp) == 0))
+		return;
+
+	/* Check AUDIO RTP keepalives */
+	if (dialog->lastrtptx && ast_rtp_get_rtpkeepalive(dialog->rtp) &&
+		    (t > dialog->lastrtptx + ast_rtp_get_rtpkeepalive(dialog->rtp))) {
+		/* Need to send an empty RTP packet */
+		dialog->lastrtptx = time(NULL);
+		ast_rtp_sendcng(dialog->rtp, 0);
+	}
+
+	/*! \todo Check video RTP keepalives
+
+		Do we need to move the lastrtptx to the RTP structure to have one for audio and one
+		for video? It really does belong to the RTP structure.
+	*/
+
+	/* Check AUDIO RTP timers */
+	if (dialog->lastrtprx && (ast_rtp_get_rtptimeout(dialog->rtp) || ast_rtp_get_rtpholdtimeout(dialog->rtp)) &&
+		    (t > dialog->lastrtprx + ast_rtp_get_rtptimeout(dialog->rtp))) {
+
+		/* Might be a timeout now -- see if we're on hold */
+		struct sockaddr_in sin;
+		ast_rtp_get_peer(dialog->rtp, &sin);
+		if (sin.sin_addr.s_addr || (ast_rtp_get_rtpholdtimeout(dialog->rtp) &&
+		     (t > dialog->lastrtprx + ast_rtp_get_rtpholdtimeout(dialog->rtp)))) {
+			/* Needs a hangup */
+			if (dialog->rtptimeout) {
+				while (dialog->owner && ast_channel_trylock(dialog->owner)) {
+					sip_pvt_unlock(dialog);
+					usleep(1);
+					sip_pvt_lock(dialog);
+				}
+				if (!(ast_rtp_get_bridged(dialog->rtp))) {
+					ast_log(LOG_NOTICE, "Disconnecting call '%s' for lack of RTP activity in %ld seconds\n",
+						dialog->owner->name, (long) (t - dialog->lastrtprx));
+					/* Issue a softhangup */
+					ast_softhangup_nolock(dialog->owner, AST_SOFTHANGUP_DEV);
+				} else
+					ast_log(LOG_NOTICE, "'%s' will not be disconnected in %ld seconds because it is directly bridged to another RTP stream\n", dialog->owner->name, (long) (t - dialog->lastrtprx));
+				ast_channel_unlock(dialog->owner);
+				/* forget the timeouts for this call, since a hangup
+				   has already been requested and we don't want to
+				   repeatedly request hangups
+				*/
+				ast_rtp_set_rtptimeout(dialog->rtp, 0);
+				ast_rtp_set_rtpholdtimeout(dialog->rtp, 0);
+				if (dialog->vrtp) {
+					ast_rtp_set_rtptimeout(dialog->vrtp, 0);
+					ast_rtp_set_rtpholdtimeout(dialog->vrtp, 0);
 				}
 			}
 		}
@@ -15799,7 +15815,7 @@
 static void *do_monitor(void *data)
 {
 	int res;
-	struct sip_pvt *sip;
+	struct sip_pvt *dialog;
 	struct sip_peer *peer = NULL;
 	time_t t;
 	int fastrestart = FALSE;
@@ -15827,6 +15843,7 @@
 			if (sipsock > -1)
 				sipsock_read_id = ast_io_change(io, sipsock_read_id, sipsock, NULL, 0, NULL);
 		}
+
 		/* Check for dialogs needing to be killed */
 		dialoglist_lock();
 restartsearch:		
@@ -15835,18 +15852,20 @@
 		   of time since the last time we did it (when MWI is being sent, we can
 		   get back to this point every millisecond or less)
 		*/
-		for (sip = dialoglist; !fastrestart && sip; sip = sip->next) {
-			sip_pvt_lock(sip);
+		for (dialog = dialoglist; !fastrestart && dialog; dialog = dialog->next) {
+			sip_pvt_lock(dialog);
 			/* Check RTP timeouts and kill calls if we have a timeout set and do not get RTP */
-			check_rtp_timeout(sip, t);
+			check_rtp_timeout(dialog, t);
 			/* If we have sessions that needs to be destroyed, do it now */
-			if (ast_test_flag(&sip->flags[0], SIP_NEEDDESTROY) && !sip->packets &&
-			    !sip->owner) {
-				sip_pvt_unlock(sip);
-				__sip_destroy(sip, TRUE, FALSE);
+			/* Check if we have outstanding requests not responsed to or an active call
+				- if that's the case, wait with destruction */
+			if (ast_test_flag(&dialog->flags[0], SIP_NEEDDESTROY) && !dialog->packets &&
+			    !dialog->owner) {
+				sip_pvt_unlock(dialog);
+				__sip_destroy(dialog, TRUE, FALSE);
 				goto restartsearch;
 			}
-			sip_pvt_unlock(sip);
+			sip_pvt_unlock(dialog);
 		}
 		dialoglist_unlock();
 
@@ -15855,7 +15874,8 @@
 		res = ast_sched_wait(sched);
 		if ((res < 0) || (res > 1000))
 			res = 1000;
-		/* If we might need to send more mailboxes, don't wait long at all.*/
+
+		/* If we might need to send more mailbox notifications, don't wait long at all.*/
 		if (fastrestart)
 			res = 1;
 		res = ast_io_wait(io, res);
@@ -17144,10 +17164,10 @@
 			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")) {
-			global_limitonpeers = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "notifyhold")) {
 			global_notifyhold = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "alwaysauthreject")) {
@@ -17185,7 +17205,7 @@
 			autocreatepeer = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "match_auth_username")) {
 			global_match_auth_username = ast_true(v->value);
-		} else if (!strcasecmp(v->name, "global_srvlookup")) {
+		} else if (!strcasecmp(v->name, "srvlookup")) {
 			global_srvlookup = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "pedantic")) {
 			pedanticsipchecking = ast_true(v->value);
@@ -18047,6 +18067,7 @@
 			sip_destroy(iterator->call);
 		}
 		ASTOBJ_UNLOCK(iterator);
+	
 	} while(0));
 
 	/* Then, actually destroy users and registry */

Modified: team/oej/videocaps/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/channels/chan_zap.c?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/channels/chan_zap.c (original)
+++ team/oej/videocaps/channels/chan_zap.c Sat Dec  2 12:54:41 2006
@@ -8380,7 +8380,7 @@
 	startcic = linkset->pvts[0]->cic;
 
 	for (i = 0; i < linkset->numchans; i++) {
-		if (linkset->pvts[i+1] && (linkset->pvts[i+1]->cic - linkset->pvts[i]->cic) == 1) {
+		if (linkset->pvts[i+1] && ((linkset->pvts[i+1]->cic - linkset->pvts[i]->cic) == 1) && (linkset->pvts[i]->cic - startcic < 31)) {
 			continue;
 		} else {
 			endcic = linkset->pvts[i]->cic;
@@ -10568,23 +10568,23 @@
 	return RESULT_SUCCESS;
 }
 
-static const char pri_debug_help[] = 
+static char pri_debug_help[] = 
 	"Usage: pri debug span <span>\n"
 	"       Enables debugging on a given PRI span\n";
 	
-static const char pri_no_debug_help[] = 
+static char pri_no_debug_help[] = 
 	"Usage: pri no debug span <span>\n"
 	"       Disables debugging on a given PRI span\n";
 
-static const char pri_really_debug_help[] = 
+static char pri_really_debug_help[] = 
 	"Usage: pri intensive debug span <span>\n"
 	"       Enables debugging down to the Q.921 level\n";
 
-static const char pri_show_span_help[] = 
+static char pri_show_span_help[] = 
 	"Usage: pri show span <span>\n"
 	"       Displays PRI Information on a given PRI span\n";
 
-static const char pri_show_spans_help[] = 
+static char pri_show_spans_help[] = 
 	"Usage: pri show spans\n"
 	"       Displays PRI Information\n";
 
@@ -11556,7 +11556,6 @@
 	return RESULT_SUCCESS;
 }
 
-#if 0
 static int handle_ss7_show_linkset(int fd, int argc, char *argv[])
 {
 	int linkset;
@@ -11573,49 +11572,44 @@
 		return RESULT_SUCCESS;
 	}
 	if (linksets[linkset-1].ss7)
-		ss7 = linksets[linkset-1];
-
-	if (
+		ss7 = &linksets[linkset-1];
+
+	ast_cli(fd, "SS7 linkset %d status: %s\n", linkset, (ss7->state == LINKSET_STATE_UP) ? "Up" : "Down");
 
 	return RESULT_SUCCESS;
 }
-#endif
-
-static const char ss7_debug_help[] = 
+
+static char ss7_debug_help[] = 
 	"Usage: ss7 debug linkset <linkset>\n"
 	"       Enables debugging on a given SS7 linkset\n";
 	
-static const char ss7_no_debug_help[] = 
+static char ss7_no_debug_help[] = 
 	"Usage: ss7 no debug linkset <span>\n"
 	"       Disables debugging on a given SS7 linkset\n";
 
-static const char ss7_block_cic_help[] = 
+static char ss7_block_cic_help[] = 
 	"Usage: ss7 block cic <linkset> <CIC>\n"
 	"       Sends a remote blocking request for the given CIC on the specified linkset\n";
 
-static const char ss7_unblock_cic_help[] = 
+static char ss7_unblock_cic_help[] = 
 	"Usage: ss7 unblock cic <linkset> <CIC>\n"
 	"       Sends a remote unblocking request for the given CIC on the specified linkset\n";
 
-#if 0
-static const char ss7_show_linkset_help[] = 
+static char ss7_show_linkset_help[] = 
 	"Usage: ss7 show linkset <span>\n"
-	"       Disables debugging on a given SS7 linkset\n";
-#endif
+	"       Shows the status of an SS7 linkset.\n";
 
 static struct ast_cli_entry zap_ss7_cli[] = {
 	{ { "ss7", "debug", "linkset", NULL }, handle_ss7_debug,
 	  "Enables SS7 debugging on a linkset", ss7_debug_help, NULL },
 	{ { "ss7", "no", "debug", "linkset", NULL }, handle_ss7_no_debug,
-	  "Disables SS7 debugging on a linkset", ss7_debug_help, NULL },
+	  "Disables SS7 debugging on a linkset", ss7_no_debug_help, NULL },
 	{ { "ss7", "block", "cic", NULL }, handle_ss7_block_cic,
 	  "Disables SS7 debugging on a linkset", ss7_block_cic_help, NULL },
 	{ { "ss7", "unblock", "cic", NULL }, handle_ss7_unblock_cic,
 	  "Disables SS7 debugging on a linkset", ss7_unblock_cic_help, NULL },
-#if 0
 	{ { "ss7", "show", "linkset", NULL }, handle_ss7_show_linkset,
-	  "Disables SS7 debugging on a linkset", ss7_show_linkset_help, NULL },
-#endif
+	  "Shows the status of a linkset", ss7_show_linkset_help, NULL },
 };
 #endif /* HAVE_SS7 */
 

Modified: team/oej/videocaps/codecs/codec_zap.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/codecs/codec_zap.c?view=diff&rev=48211&r1=48210&r2=48211
==============================================================================
--- team/oej/videocaps/codecs/codec_zap.c (original)
+++ team/oej/videocaps/codecs/codec_zap.c Sat Dec  2 12:54:41 2006
@@ -232,7 +232,7 @@
 	return zap_translate(pvt, pvt->t->dstfmt, pvt->t->srcfmt);
 }
 
-static struct ast_frame *g729_fakesrc_sample()
+static struct ast_frame *g729_fakesrc_sample(void)
 {
 	/* Don't bother really trying to test hardware ones. */
 	static struct ast_frame f = {
@@ -244,7 +244,7 @@
 	return &f;
 }
 
-static struct ast_frame *g723_fakesrc_sample()

[... 3392 lines stripped ...]


More information about the asterisk-commits mailing list