[asterisk-commits] branch group/new_loader_completion r29504 - in /team/group/new_loader_complet...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 22 12:21:17 MST 2006


Author: kpfleming
Date: Mon May 22 14:21:17 2006
New Revision: 29504

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

Modified:
    team/group/new_loader_completion/   (props changed)
    team/group/new_loader_completion/app.c
    team/group/new_loader_completion/apps/app_dial.c
    team/group/new_loader_completion/apps/app_directed_pickup.c
    team/group/new_loader_completion/apps/app_meetme.c
    team/group/new_loader_completion/apps/app_queue.c
    team/group/new_loader_completion/apps/app_record.c
    team/group/new_loader_completion/build_tools/cflags.xml
    team/group/new_loader_completion/channels/chan_local.c
    team/group/new_loader_completion/channels/chan_misdn.c
    team/group/new_loader_completion/channels/chan_sip.c
    team/group/new_loader_completion/channels/misdn/chan_misdn_config.h
    team/group/new_loader_completion/channels/misdn_config.c
    team/group/new_loader_completion/codecs/codec_alaw.c
    team/group/new_loader_completion/configs/features.conf.sample
    team/group/new_loader_completion/configs/func_odbc.conf.sample
    team/group/new_loader_completion/configs/misdn.conf.sample
    team/group/new_loader_completion/funcs/func_odbc.c
    team/group/new_loader_completion/include/asterisk/channel.h
    team/group/new_loader_completion/res/res_features.c

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
    automerge = yes

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

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

Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon May 22 14:21:17 2006
@@ -1,1 +1,1 @@
-/trunk:1-29097
+/trunk:1-29503

Modified: team/group/new_loader_completion/app.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/app.c?rev=29504&r1=29503&r2=29504&view=diff
==============================================================================
--- team/group/new_loader_completion/app.c (original)
+++ team/group/new_loader_completion/app.c Mon May 22 14:21:17 2006
@@ -549,8 +549,7 @@
 		sfmt[fmtcnt++] = ast_strdupa(fmt);
 	}
 
-	time(&start);
-	end = start;  /* pre-initialize end to be same as start in case we never get into loop */
+	end = start = time(NULL);  /* pre-initialize end to be same as start in case we never get into loop */
 	for (x = 0; x < fmtcnt; x++) {
 		others[x] = ast_writefile(prepend ? prependfile : recordfile, sfmt[x], comment, O_TRUNC, 0, 0700);
 		if (option_verbose > 2)
@@ -670,7 +669,7 @@
 				}
 			}
 			if (maxtime) {
-				time(&end);
+				end = time(NULL);
 				if (maxtime < (end - start)) {
 					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "Took too long, cutting it short...\n");
@@ -689,7 +688,8 @@
 		} else {
 			ast_frfree(f);
 		}
-		if (end == start) time(&end);
+		if (end == start)
+			end = time(NULL);
 	} else {
 		ast_log(LOG_WARNING, "Error creating writestream '%s', format '%s'\n", recordfile, sfmt[x]);
 	}
@@ -931,7 +931,7 @@
 	close(fd);
 
 	snprintf(s, strlen(path) + 9, "%s/.lock", path);
-	time(&start);
+	start = time(NULL);
 	while (((res = link(fs, s)) < 0) && (errno == EEXIST) && (time(NULL) - start < 5))
 		usleep(1);
 	if (res) {

Modified: team/group/new_loader_completion/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/app_dial.c?rev=29504&r1=29503&r2=29504&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/app_dial.c (original)
+++ team/group/new_loader_completion/apps/app_dial.c Mon May 22 14:21:17 2006
@@ -183,7 +183,11 @@
 "    w    - Allow the called party to enable recording of the call by sending\n"
 "           the DTMF sequence defined for one-touch recording in features.conf.\n"
 "    W    - Allow the calling party to enable recording of the call by sending\n"
-"           the DTMF sequence defined for one-touch recording in features.conf.\n";
+"           the DTMF sequence defined for one-touch recording in features.conf.\n"
+"    k    - Allow the called party to enable parking of the call by sending\n"
+"           the DTMF sequence defined for call parking in features.conf.\n"
+"    K    - Allow the calling party to enable parking of the call by sending\n"
+"           the DTMF sequence defined for call parking in features.conf.\n";
 
 /* RetryDial App by Anthony Minessale II <anthmct at yahoo.com> Jan/2005 */
 static char *rapp = "RetryDial";
@@ -227,6 +231,8 @@
 	OPT_CALLER_MONITOR =	(1 << 22),
 	OPT_GOTO =		(1 << 23),
 	OPT_OPERMODE = 		(1 << 24),
+	OPT_CALLEE_PARK =	(1 << 25),
+	OPT_CALLER_PARK =	(1 << 26),
 } dial_exec_option_flags;
 
 #define DIAL_STILLGOING			(1 << 30)
@@ -272,6 +278,8 @@
 	AST_APP_OPTION('T', OPT_CALLER_TRANSFER),
 	AST_APP_OPTION('w', OPT_CALLEE_MONITOR),
 	AST_APP_OPTION('W', OPT_CALLER_MONITOR),
+	AST_APP_OPTION('k', OPT_CALLEE_PARK),
+	AST_APP_OPTION('K', OPT_CALLER_PARK),
 });
 
 /* We define a custom "local user" structure because we
@@ -440,6 +448,7 @@
 						       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
 						       OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
 						       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
+						       OPT_CALLEE_PARK | OPT_CALLER_PARK |
 						       DIAL_NOFORWARDHTML);
 				}
 				continue;
@@ -550,6 +559,7 @@
 							       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
 							       OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
 							       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
+							       OPT_CALLEE_PARK | OPT_CALLER_PARK |
 							       DIAL_NOFORWARDHTML);
 						/* Setup early media if appropriate */
 						ast_rtp_early_media(in, peer);
@@ -1015,6 +1025,7 @@
 				       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
 				       OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
 				       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
+				       OPT_CALLEE_PARK | OPT_CALLER_PARK |
 				       OPT_RINGBACK | OPT_MUSICBACK | OPT_FORCECLID);
 			ast_set2_flag(tmp, args.url, DIAL_NOFORWARDHTML);	
 		}
@@ -1496,6 +1507,10 @@
 				ast_set_flag(&(config.features_callee), AST_FEATURE_AUTOMON);
 			if (ast_test_flag(peerflags, OPT_CALLER_MONITOR)) 
 				ast_set_flag(&(config.features_caller), AST_FEATURE_AUTOMON);
+			if (ast_test_flag(peerflags, OPT_CALLEE_PARK))
+				ast_set_flag(&(config.features_callee), AST_FEATURE_PARKCALL);
+			if (ast_test_flag(peerflags, OPT_CALLER_PARK))
+				ast_set_flag(&(config.features_caller), AST_FEATURE_PARKCALL);
 
 			config.timelimit = timelimit;
 			config.play_warning = play_warning;

Modified: team/group/new_loader_completion/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/app_directed_pickup.c?rev=29504&r1=29503&r2=29504&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/app_directed_pickup.c (original)
+++ team/group/new_loader_completion/apps/app_directed_pickup.c Mon May 22 14:21:17 2006
@@ -20,7 +20,7 @@
  *
  * \brief Directed Call Pickup Support
  *
- * \author Joshua Colp <jcolp at asterlink.com>
+ * \author Joshua Colp <jcolp at digium.com>
  *
  * \ingroup applications
  */
@@ -42,12 +42,16 @@
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
 
+#define PICKUPMARK "PICKUPMARK"
+
 static const char *app = "Pickup";
 static const char *synopsis = "Directed Call Pickup";
 static const char *descrip =
 "  Pickup(extension[@context][&extension2 at context...]): This application can pickup any ringing channel\n"
 "that is calling the specified extension. If no context is specified, the current\n"
-"context will be used.\n";
+"context will be used. If you use the special string \"PICKUPMARK\" for the context parameter, for example\n"
+"10 at PICKUPMARK, this application tries to find a channel which has defined a channel variable with the same context\n"
+"as \"extension\".";
 
 
 static int pickup_exec(struct ast_channel *chan, void *data)
@@ -57,6 +61,7 @@
 	struct ast_channel *origin = NULL, *target = NULL;
 	char *tmp = NULL, *exten = NULL, *context = NULL, *rest=data;
 	char workspace[256] = "";
+	const char *tmp2 = NULL;
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Pickup requires an argument (extension) !\n");
@@ -76,8 +81,21 @@
 		if (context)
 			*context++ = '\0';
 
-		/* Find a channel to pickup */
-		origin = ast_get_channel_by_exten_locked(exten, context);
+		/* If the context is the pickup mark, iterate through all channels finding the right origin one */
+		if (!strcmp(context, PICKUPMARK)) {
+			while ((origin = ast_channel_walk_locked(origin))) {
+				if (origin) {
+					tmp2 = pbx_builtin_getvar_helper(origin, PICKUPMARK);
+					if (tmp2 && !strcmp(tmp2, exten))
+						break;
+					ast_mutex_unlock(&origin->lock);
+				}
+			}
+		} else {
+			/* Use the classic mode of searching */
+			origin = ast_get_channel_by_exten_locked(exten, context);
+		}
+
 		if (origin) {
 			ast_cdr_getvar(origin->cdr, "dstchannel", &tmp, workspace,
 					sizeof(workspace), 0, 0);

Modified: team/group/new_loader_completion/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/app_meetme.c?rev=29504&r1=29503&r2=29504&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/app_meetme.c (original)
+++ team/group/new_loader_completion/apps/app_meetme.c Mon May 22 14:21:17 2006
@@ -63,6 +63,118 @@
 #include "asterisk/translate.h"
 #include "asterisk/ulaw.h"
 
+#include "enter.h"
+#include "leave.h"
+
+#define CONFIG_FILE_NAME "meetme.conf"
+
+/*! each buffer is 20ms, so this is 640ms total */
+#define DEFAULT_AUDIO_BUFFERS  32
+
+enum {
+	ADMINFLAG_MUTED =  (1 << 1), /*!< User is muted */
+	ADMINFLAG_KICKME = (1 << 2)  /*!< User has been kicked */
+};
+
+#define MEETME_DELAYDETECTTALK     300
+#define MEETME_DELAYDETECTENDTALK  1000
+
+#define AST_FRAME_BITS  32
+
+enum volume_action {
+	VOL_UP,
+	VOL_DOWN
+};
+
+enum entrance_sound {
+	ENTER,
+	LEAVE
+};
+
+enum recording_state {
+	MEETME_RECORD_OFF,
+	MEETME_RECORD_STARTED,
+	MEETME_RECORD_ACTIVE,
+	MEETME_RECORD_TERMINATE
+};
+
+#define CONF_SIZE  320
+
+enum {
+	/*! user has admin access on the conference */
+	CONFFLAG_ADMIN = (1 << 0),
+	/*! If set the user can only receive audio from the conference */
+	CONFFLAG_MONITOR = (1 << 1),
+	/*! If set asterisk will exit conference when '#' is pressed */
+	CONFFLAG_POUNDEXIT = (1 << 2),
+	/*! If set asterisk will provide a menu to the user when '*' is pressed */
+	CONFFLAG_STARMENU = (1 << 3),
+	/*! If set the use can only send audio to the conference */
+	CONFFLAG_TALKER = (1 << 4),
+	/*! If set there will be no enter or leave sounds */
+	CONFFLAG_QUIET = (1 << 5),
+	/*! If set, when user joins the conference, they will be told the number 
+	 *  of users that are already in */
+	CONFFLAG_ANNOUNCEUSERCOUNT = (1 << 6),
+	/*! Set to run AGI Script in Background */
+	CONFFLAG_AGI = (1 << 7),
+	/*! Set to have music on hold when user is alone in conference */
+	CONFFLAG_MOH = (1 << 8),
+	/*! If set the MeetMe will return if all marked with this flag left */
+	CONFFLAG_MARKEDEXIT = (1 << 9),
+	/*! If set, the MeetMe will wait until a marked user enters */
+	CONFFLAG_WAITMARKED = (1 << 10),
+	/*! If set, the MeetMe will exit to the specified context */
+	CONFFLAG_EXIT_CONTEXT = (1 << 11),
+	/*! If set, the user will be marked */
+	CONFFLAG_MARKEDUSER = (1 << 12),
+	/*! If set, user will be ask record name on entry of conference */
+	CONFFLAG_INTROUSER = (1 << 13),
+	/*! If set, the MeetMe will be recorded */
+	CONFFLAG_RECORDCONF = (1<< 14),
+	/*! If set, the user will be monitored if the user is talking or not */
+	CONFFLAG_MONITORTALKER = (1 << 15),
+	CONFFLAG_DYNAMIC = (1 << 16),
+	CONFFLAG_DYNAMICPIN = (1 << 17),
+	CONFFLAG_EMPTY = (1 << 18),
+	CONFFLAG_EMPTYNOPIN = (1 << 19),
+	CONFFLAG_ALWAYSPROMPT = (1 << 20),
+	/*! If set, treats talking users as muted users */
+	CONFFLAG_OPTIMIZETALKER = (1 << 21),
+	/*! If set, won't speak the extra prompt when the first person 
+	 *  enters the conference */
+	CONFFLAG_NOONLYPERSON = (1 << 22),
+	CONFFLAG_INTROUSERNOREVIEW = (1 << 23)
+	/*! If set, user will be asked to record name on entry of conference 
+	 *  without review */
+};
+
+AST_APP_OPTIONS(meetme_opts, {
+	AST_APP_OPTION('A', CONFFLAG_MARKEDUSER ),
+	AST_APP_OPTION('a', CONFFLAG_ADMIN ),
+	AST_APP_OPTION('b', CONFFLAG_AGI ),
+	AST_APP_OPTION('c', CONFFLAG_ANNOUNCEUSERCOUNT ),
+	AST_APP_OPTION('D', CONFFLAG_DYNAMICPIN ),
+	AST_APP_OPTION('d', CONFFLAG_DYNAMIC ),
+	AST_APP_OPTION('E', CONFFLAG_EMPTYNOPIN ),
+	AST_APP_OPTION('e', CONFFLAG_EMPTY ),
+	AST_APP_OPTION('i', CONFFLAG_INTROUSER ),
+	AST_APP_OPTION('I', CONFFLAG_INTROUSERNOREVIEW ),
+	AST_APP_OPTION('M', CONFFLAG_MOH ),
+	AST_APP_OPTION('m', CONFFLAG_MONITOR ),
+	AST_APP_OPTION('o', CONFFLAG_OPTIMIZETALKER ),
+	AST_APP_OPTION('P', CONFFLAG_ALWAYSPROMPT ),
+	AST_APP_OPTION('p', CONFFLAG_POUNDEXIT ),
+	AST_APP_OPTION('q', CONFFLAG_QUIET ),
+	AST_APP_OPTION('r', CONFFLAG_RECORDCONF ),
+	AST_APP_OPTION('s', CONFFLAG_STARMENU ),
+	AST_APP_OPTION('T', CONFFLAG_MONITORTALKER ),
+	AST_APP_OPTION('t', CONFFLAG_TALKER ),
+	AST_APP_OPTION('w', CONFFLAG_WAITMARKED ),
+	AST_APP_OPTION('X', CONFFLAG_EXIT_CONTEXT ),
+	AST_APP_OPTION('x', CONFFLAG_MARKEDEXIT ),
+	AST_APP_OPTION('1', CONFFLAG_NOONLYPERSON ),
+});
 
 static const char *app = "MeetMe";
 static const char *app2 = "MeetMeCount";
@@ -137,30 +249,27 @@
 "      'N' -- Mute entire conference (except admin)\n"
 "";
 
-#define CONFIG_FILE_NAME "meetme.conf"
-
-
 struct ast_conference {
-	ast_mutex_t playlock;				/* Conference specific lock (players) */
-	ast_mutex_t listenlock;				/* Conference specific lock (listeners) */
-	char confno[AST_MAX_EXTENSION];		/* Conference */
-	struct ast_channel *chan;		/* Announcements channel */
-	struct ast_channel *lchan;		/* Listen/Record channel */
-	int fd;					/* Announcements fd */
-	int zapconf;				/* Zaptel Conf # */
-	int users;				/* Number of active users */
-	int markedusers;			/* Number of marked users */
-	time_t start;				/* Start time (s) */
-	int refcount;				/* reference count of usage */
-	unsigned int recording:2;				/* recording status */
-	unsigned int isdynamic:1;				/* Created on the fly? */
-	unsigned int locked:1;				/* Is the conference locked? */
-	pthread_t recordthread;			/* thread for recording */
-	pthread_attr_t attr;			/* thread attribute */
-	const char *recordingfilename;		/* Filename to record the Conference into */
-	const char *recordingformat;			/* Format to record the Conference in */
-	char pin[AST_MAX_EXTENSION];		/* If protected by a PIN */
-	char pinadmin[AST_MAX_EXTENSION];	/* If protected by a admin PIN */
+	ast_mutex_t playlock;                   /*!< Conference specific lock (players) */
+	ast_mutex_t listenlock;                 /*!< Conference specific lock (listeners) */
+	char confno[AST_MAX_EXTENSION];         /*!< Conference */
+	struct ast_channel *chan;               /*!< Announcements channel */
+	struct ast_channel *lchan;              /*!< Listen/Record channel */
+	int fd;                                 /*!< Announcements fd */
+	int zapconf;                            /*!< Zaptel Conf # */
+	int users;                              /*!< Number of active users */
+	int markedusers;                        /*!< Number of marked users */
+	time_t start;                           /*!< Start time (s) */
+	int refcount;                           /*!< reference count of usage */
+	enum recording_state recording:2;               /*!< recording status */
+	unsigned int isdynamic:1;               /*!< Created on the fly? */
+	unsigned int locked:1;                  /*!< Is the conference locked? */
+	pthread_t recordthread;                 /*!< thread for recording */
+	pthread_attr_t attr;                    /*!< thread attribute */
+	const char *recordingfilename;          /*!< Filename to record the Conference into */
+	const char *recordingformat;            /*!< Format to record the Conference in */
+	char pin[AST_MAX_EXTENSION];            /*!< If protected by a PIN */
+	char pinadmin[AST_MAX_EXTENSION];       /*!< If protected by a admin PIN */
 	struct ast_frame *transframe[32];
 	struct ast_frame *origframe;
 	struct ast_trans_pvt *transpath[32];
@@ -171,111 +280,52 @@
 static AST_LIST_HEAD_STATIC(confs, ast_conference);
 
 struct volume {
-	int desired;				/* Desired volume adjustment */
-	int actual;				/* Actual volume adjustment (for channels that can't adjust) */
+	int desired;                            /*!< Desired volume adjustment */
+	int actual;                             /*!< Actual volume adjustment (for channels that can't adjust) */
 };
 
 struct ast_conf_user {
-	int user_no;				/* User Number */
-	int userflags;				/* Flags as set in the conference */
-	int adminflags;				/* Flags set by the Admin */
-	struct ast_channel *chan;		/* Connected channel */
-	int talking;				/* Is user talking */
-	int zapchannel;				/* Is a Zaptel channel */
-	char usrvalue[50];			/* Custom User Value */
-	char namerecloc[AST_MAX_EXTENSION];	/* Name Recorded file Location */
-	time_t jointime;			/* Time the user joined the conference */
+	int user_no;                            /*!< User Number */
+	int userflags;                          /*!< Flags as set in the conference */
+	int adminflags;                         /*!< Flags set by the Admin */
+	struct ast_channel *chan;               /*!< Connected channel */
+	int talking;                            /*!< Is user talking */
+	int zapchannel;                         /*!< Is a Zaptel channel */
+	char usrvalue[50];                      /*!< Custom User Value */
+	char namerecloc[AST_MAX_EXTENSION];     /*!< Name Recorded file Location */
+	time_t jointime;                        /*!< Time the user joined the conference */
 	struct volume talk;
 	struct volume listen;
 	AST_LIST_ENTRY(ast_conf_user) list;
 };
 
-static int audio_buffers;			/* The number of audio buffers to be allocated on pseudo channels
-						   when in a conference
-						*/
-
-#define DEFAULT_AUDIO_BUFFERS 32		/* each buffer is 20ms, so this is 640ms total */
-
-#define ADMINFLAG_MUTED (1 << 1)		/* User is muted */
-#define ADMINFLAG_KICKME (1 << 2)		/* User is kicked */
-#define MEETME_DELAYDETECTTALK 		300
-#define MEETME_DELAYDETECTENDTALK 	1000
-
-#define AST_FRAME_BITS 32
-
-enum volume_action {
-	VOL_UP,
-	VOL_DOWN,
+/*! The number of audio buffers to be allocated on pseudo channels
+ *  when in a conference */
+static int audio_buffers;
+
+/*! Map 'volume' levels from -5 through +5 into
+ *  decibel (dB) settings for channel drivers
+ *  Note: these are not a straight linear-to-dB
+ *  conversion... the numbers have been modified
+ *  to give the user a better level of adjustability
+ */
+static signed char gain_map[] = {
+	-15,
+	-13,
+	-10,
+	-6,
+	0,
+	0,
+	0,
+	6,
+	10,
+	13,
+	15,
 };
 
+
 static int admin_exec(struct ast_channel *chan, void *data);
-
 static void *recordthread(void *args);
-
-#include "enter.h"
-#include "leave.h"
-
-#define ENTER	0
-#define LEAVE	1
-
-#define MEETME_RECORD_OFF	0
-#define MEETME_RECORD_STARTED	1
-#define MEETME_RECORD_ACTIVE	2
-#define MEETME_RECORD_TERMINATE	3
-
-#define CONF_SIZE 320
-
-#define CONFFLAG_ADMIN	(1 << 1)		/* If set the user has admin access on the conference */
-#define CONFFLAG_MONITOR (1 << 2)		/* If set the user can only receive audio from the conference */
-#define CONFFLAG_POUNDEXIT (1 << 3)		/* If set asterisk will exit conference when '#' is pressed */
-#define CONFFLAG_STARMENU (1 << 4)		/* If set asterisk will provide a menu to the user when '*' is pressed */
-#define CONFFLAG_TALKER (1 << 5)		/* If set the use can only send audio to the conference */
-#define CONFFLAG_QUIET (1 << 6)			/* If set there will be no enter or leave sounds */
-#define CONFFLAG_ANNOUNCEUSERCOUNT (1 << 7)	/* If set, when user joins the conference, they will be told the number of users that are already in */
-#define CONFFLAG_AGI (1 << 8)			/* Set to run AGI Script in Background */
-#define CONFFLAG_MOH (1 << 9)			/* Set to have music on hold when user is alone in conference */
-#define CONFFLAG_MARKEDEXIT (1 << 10)		/* If set the MeetMe will return if all marked with this flag left */
-#define CONFFLAG_WAITMARKED (1 << 11)		/* If set, the MeetMe will wait until a marked user enters */
-#define CONFFLAG_EXIT_CONTEXT (1 << 12)		/* If set, the MeetMe will exit to the specified context */
-#define CONFFLAG_MARKEDUSER (1 << 13)		/* If set, the user will be marked */
-#define CONFFLAG_INTROUSER (1 << 14)		/* If set, user will be ask record name on entry of conference */
-#define CONFFLAG_RECORDCONF (1<< 15)		/* If set, the MeetMe will be recorded */
-#define CONFFLAG_MONITORTALKER (1 << 16)	/* If set, the user will be monitored if the user is talking or not */
-#define CONFFLAG_DYNAMIC (1 << 17)
-#define CONFFLAG_DYNAMICPIN (1 << 18)
-#define CONFFLAG_EMPTY (1 << 19)
-#define CONFFLAG_EMPTYNOPIN (1 << 20)
-#define CONFFLAG_ALWAYSPROMPT (1 << 21)
-#define CONFFLAG_OPTIMIZETALKER (1 << 22)	/* If set, treats talking users as muted users */
-#define CONFFLAG_NOONLYPERSON (1 << 23)		/* If set, won't speak the extra prompt when the first person enters the conference */
-#define CONFFLAG_INTROUSERNOREVIEW (1 << 24)	/* If set, user will be asked to record name on entry of conference without review */
-
-AST_APP_OPTIONS(meetme_opts, {
-	AST_APP_OPTION('A', CONFFLAG_MARKEDUSER ),
-	AST_APP_OPTION('a', CONFFLAG_ADMIN ),
-	AST_APP_OPTION('b', CONFFLAG_AGI ),
-	AST_APP_OPTION('c', CONFFLAG_ANNOUNCEUSERCOUNT ),
-	AST_APP_OPTION('D', CONFFLAG_DYNAMICPIN ),
-	AST_APP_OPTION('d', CONFFLAG_DYNAMIC ),
-	AST_APP_OPTION('E', CONFFLAG_EMPTYNOPIN ),
-	AST_APP_OPTION('e', CONFFLAG_EMPTY ),
-	AST_APP_OPTION('i', CONFFLAG_INTROUSER ),
-	AST_APP_OPTION('I', CONFFLAG_INTROUSERNOREVIEW ),
-	AST_APP_OPTION('M', CONFFLAG_MOH ),
-	AST_APP_OPTION('m', CONFFLAG_MONITOR ),
-	AST_APP_OPTION('o', CONFFLAG_OPTIMIZETALKER ),
-	AST_APP_OPTION('P', CONFFLAG_ALWAYSPROMPT ),
-	AST_APP_OPTION('p', CONFFLAG_POUNDEXIT ),
-	AST_APP_OPTION('q', CONFFLAG_QUIET ),
-	AST_APP_OPTION('r', CONFFLAG_RECORDCONF ),
-	AST_APP_OPTION('s', CONFFLAG_STARMENU ),
-	AST_APP_OPTION('T', CONFFLAG_MONITORTALKER ),
-	AST_APP_OPTION('t', CONFFLAG_TALKER ),
-	AST_APP_OPTION('w', CONFFLAG_WAITMARKED ),
-	AST_APP_OPTION('X', CONFFLAG_EXIT_CONTEXT ),
-	AST_APP_OPTION('x', CONFFLAG_MARKEDEXIT ),
-	AST_APP_OPTION('1', CONFFLAG_NOONLYPERSON ),
-});
 
 static char *istalking(int x)
 {
@@ -313,26 +363,6 @@
 
 	return 0;
 }
-
-/* Map 'volume' levels from -5 through +5 into
-   decibel (dB) settings for channel drivers
-   Note: these are not a straight linear-to-dB
-   conversion... the numbers have been modified
-   to give the user a better level of adjustability
-*/
-static signed char gain_map[] = {
-	-15,
-	-13,
-	-10,
-	-6,
-	0,
-	0,
-	0,
-	6,
-	10,
-	13,
-	15,
-};
 
 static int set_talk_volume(struct ast_conf_user *user, int volume)
 {
@@ -425,7 +455,7 @@
 	ast_channel_setoption(user->chan, AST_OPTION_RXGAIN, &zero_volume, sizeof(zero_volume), 0);
 }
 
-static void conf_play(struct ast_channel *chan, struct ast_conference *conf, int sound)
+static void conf_play(struct ast_channel *chan, struct ast_conference *conf, enum entrance_sound sound)
 {
 	unsigned char *data;
 	int len;
@@ -540,20 +570,6 @@
 	return cnf;
 }
 
-static int confs_show(int fd, int argc, char **argv)
-{
-	ast_cli(fd, "Deprecated! Please use 'meetme' instead.\n");
-
-	return RESULT_SUCCESS;
-}
-
-static char show_confs_usage[] =
-"Deprecated! Please use 'meetme' instead.\n";
-
-static struct ast_cli_entry cli_show_confs = {
-	{ "show", "conferences", NULL }, confs_show,
-	"Show status of conferences", show_confs_usage, NULL };
-	
 static int conf_cmd(int fd, int argc, char **argv) {
 	/* Process the command */
 	struct ast_conference *cnf;
@@ -670,7 +686,7 @@
 					user->chan->name,
 					user->userflags & CONFFLAG_ADMIN ? "(Admin)" : "",
 					user->userflags & CONFFLAG_MONITOR ? "(Listen only)" : "",
-					user->adminflags & ADMINFLAG_MUTED ? "(Admn Muted)" : "",
+					user->adminflags & ADMINFLAG_MUTED ? "(Admin Muted)" : "",
 					istalking(user->talking), hr, min, sec);
 			else 
 				ast_cli(fd, "%d!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n",
@@ -2391,8 +2407,7 @@
 {
 	int res;
 	
-	res = ast_cli_unregister(&cli_show_confs);
-	res |= ast_cli_unregister(&cli_conf);
+	res = ast_cli_unregister(&cli_conf);
 	res |= ast_unregister_application(app3);
 	res |= ast_unregister_application(app2);
 	res |= ast_unregister_application(app);
@@ -2408,8 +2423,7 @@
 
 	load_config();
 
-	res = ast_cli_register(&cli_show_confs);
-	res |= ast_cli_register(&cli_conf);
+	res = ast_cli_register(&cli_conf);
 	res |= ast_register_application(app3, admin_exec, synopsis3, descrip3);
 	res |= ast_register_application(app2, count_exec, synopsis2, descrip2);
 	res |= ast_register_application(app, conf_exec, synopsis, descrip);

Modified: team/group/new_loader_completion/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/app_queue.c?rev=29504&r1=29503&r2=29504&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/app_queue.c (original)
+++ team/group/new_loader_completion/apps/app_queue.c Mon May 22 14:21:17 2006
@@ -1260,8 +1260,8 @@
 
 			/* Take us out of the queue */
 			manager_event(EVENT_FLAG_CALL, "Leave",
-				"Channel: %s\r\nQueue: %s\r\nCount: %d\r\n",
-				qe->chan->name, q->name,  q->count);
+				"Channel: %s\r\nQueue: %s\r\nCount: %d\r\nUniqueid: %s\r\n",
+				qe->chan->name, q->name,  q->count, qe->chan->uniqueid);
 			if (option_debug)
 				ast_log(LOG_DEBUG, "Queue '%s' Leave, Channel '%s'\n", q->name, qe->chan->name );
 			/* Take us out of the queue */

Modified: team/group/new_loader_completion/apps/app_record.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/app_record.c?rev=29504&r1=29503&r2=29504&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/app_record.c (original)
+++ team/group/new_loader_completion/apps/app_record.c Mon May 22 14:21:17 2006
@@ -62,7 +62,8 @@
 "     'n' : do not answer, but record anyway if line not yet answered\n"
 "     'q' : quiet (do not play a beep tone)\n"
 "     's' : skip recording if the line is not yet answered\n"
-"     't' : use alternate '*' terminator key instead of default '#'\n"
+"     't' : use alternate '*' terminator key (DTMF) instead of default '#'\n"
+"     'x' : ignore all terminator keys (DTMF) and keep recording until hangup\n"
 "\n"
 "If filename contains '%d', these characters will be replaced with a number\n"
 "incremented by one each time the file is recorded. \n\n"
@@ -166,6 +167,8 @@
 				option_append = 1;
 			if (strchr(options, 't'))
 				terminator = '*';
+			if (strchr(options, 'x'))
+				terminator = 0;
 			if (strchr(options, 'q'))
 				option_quiet = 1;
 		}

Modified: team/group/new_loader_completion/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/build_tools/cflags.xml?rev=29504&r1=29503&r2=29504&view=diff
==============================================================================
--- team/group/new_loader_completion/build_tools/cflags.xml (original)
+++ team/group/new_loader_completion/build_tools/cflags.xml Mon May 22 14:21:17 2006
@@ -1,4 +1,6 @@
 	<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" force_clean_on_change="yes">
+		<member name="DEBUG_CHANNEL_LOCKS" displayname="Debug Channel Locking">
+		</member>
 		<member name="DEBUG_SCHEDULER" displayname="Enable Scheduler Debugging Output">
 		</member>
 		<member name="DEBUG_THREADS" displayname="Enable Thread Debugging">

Modified: team/group/new_loader_completion/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_local.c?rev=29504&r1=29503&r2=29504&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_local.c (original)
+++ team/group/new_loader_completion/channels/chan_local.c Mon May 22 14:21:17 2006
@@ -371,7 +371,7 @@
 	p->chan->cid.cid_name = ast_strdup(p->owner->cid.cid_name);
 	p->chan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis);
 	p->chan->cid.cid_ani = ast_strdup(p->owner->cid.cid_ani);
-
+	p->chan->cid.cid_pres = p->owner->cid.cid_pres;
 	ast_string_field_set(p->chan, language, p->owner->language);
 	ast_string_field_set(p->chan, accountcode, p->owner->accountcode);
 	p->chan->cdrflags = p->owner->cdrflags;

Modified: team/group/new_loader_completion/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_misdn.c?rev=29504&r1=29503&r2=29504&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_misdn.c (original)
+++ team/group/new_loader_completion/channels/chan_misdn.c Mon May 22 14:21:17 2006
@@ -279,6 +279,10 @@
 static int *misdn_debug_only;
 static int max_ports;
 
+static int *misdn_in_calls;
+static int *misdn_out_calls;
+
+
 struct chan_list dummy_cl;
 
 struct chan_list *cl_te=NULL;
@@ -309,6 +313,11 @@
 
 
 void debug_numplan(int port, int numplan, char *type);
+
+
+int add_out_calls(int port);
+int add_in_calls(int port);
+
 
 /*************** Helpers *****************/
 
@@ -646,6 +655,39 @@
 		misdn_debug[i] = cfg_debug;
 		misdn_debug_only[i] = 0;
 	}
+
+#ifdef M_TIMER
+	if (misdn_sched) 
+		sched_context_destroy(misdn_sched);
+	
+	misdn_sched=sched_context_create();
+
+	if (!misdn_sched) {
+		ast_log(LOG_ERROR,"Couldn't create scheduler\n");
+		return -1;
+	}
+
+	/* Loop through all ports and find out which one should be 
+	 * watched regarding the l1 */
+	int port; 
+	int dotimer=0;
+	for (	port=misdn_cfg_get_next_port(0);
+		port>0;
+		port=misdn_cfg_get_next_port(port)) {
+		int l1timer;
+		misdn_cfg_get( port, MISDN_CFG_L1_TIMER, &l1timer, sizeof(l1timer));
+		if (l1timer>0) {
+			ast_sched_add(misdn_sched, l1timer*1000, l1_timer_cb, &port);
+			dotimer=1;
+;		}
+	}
+
+	if (dotimer) {
+		/*start timer thread*/
+		pthread_create( &misdn_timer, NULL, (void*)misdn_timerd, NULL);
+	}
+#endif
+
 }
 
 static int misdn_reload (int fd, int argc, char *argv[])
@@ -779,6 +821,24 @@
 
 }
 
+
+static int misdn_show_ports_stats (int fd, int argc, char *argv[])
+{
+	int port;
+
+	ast_cli(fd, "Port\tin_calls\tout_calls\n");
+	
+	for (port=misdn_cfg_get_next_port(0); port > 0;
+	     port=misdn_cfg_get_next_port(port)) {
+		ast_cli(fd,"%d\t%d\t\t%d\n",port,misdn_in_calls[port],misdn_out_calls[port]);
+	}
+	ast_cli(fd,"\n");
+	
+	return 0;
+
+}
+
+
 static int misdn_show_port (int fd, int argc, char *argv[])
 {
 	int port;
@@ -1076,6 +1136,14 @@
   "Usage: misdn show stacks\n"
 };
 
+static struct ast_cli_entry cli_show_ports_stats =
+{ {"misdn","show","ports","stats", NULL},
+  misdn_show_ports_stats,
+  "Shows chan_misdns call statistics per port", 
+  "Usage: misdn show port stats\n"
+};
+
+
 static struct ast_cli_entry cli_show_port =
 { {"misdn","show","port", NULL},
   misdn_show_port,
@@ -1522,6 +1590,14 @@
 	port=newbc->port;
 	strncpy(newbc->dad,ext,sizeof( newbc->dad));
 	strncpy(ast->exten,ext,sizeof(ast->exten));
+
+	int exceed;
+	if ((exceed=add_out_calls(port))) {
+		char tmp[16];
+		sprintf(tmp,"%d",exceed);
+		pbx_builtin_setvar_helper(ast,"MAX_OVERFLOW",tmp);
+		return -1;
+	}
 	
 	chan_misdn_log(1, port, "* CALL: %s\n",dest);
 	
@@ -2741,6 +2817,13 @@
 		} else {
 			if (!bc->nojitter)
 				chan_misdn_log(5,bc->port,"Jitterbuffer already destroyed.\n");
+		}
+
+
+		if (ch->orginator == ORG_AST) {
+			misdn_out_calls[bc->port]--;
+		} else {
+			misdn_in_calls[bc->port]--;
 		}
 		
 		if (ch) {
@@ -2971,6 +3054,40 @@
 }
 
 
+int add_in_calls(int port)
+{
+	int max_in_calls;
+	
+	misdn_cfg_get( port, MISDN_CFG_MAX_IN, &max_in_calls, sizeof(max_in_calls));
+
+	misdn_in_calls[port]++;
+
+	if (max_in_calls >=0 && max_in_calls<misdn_in_calls[port]) {
+		ast_log(LOG_NOTICE,"Marking Incoming Call on port[%d]\n",port);
+		return misdn_in_calls[port]-max_in_calls;
+	}
+	
+	return 0;
+}
+
+int add_out_calls(int port)
+{
+	int max_out_calls;
+	
+	misdn_cfg_get( port, MISDN_CFG_MAX_OUT, &max_out_calls, sizeof(max_out_calls));
+	
+
+	if (max_out_calls >=0 && max_out_calls<=misdn_out_calls[port]) {
+		ast_log(LOG_NOTICE,"Rejecting Outgoing Call on port[%d]\n",port);
+		return (misdn_out_calls[port]+1)-max_out_calls;
+	}
+
+	misdn_out_calls[port]++;
+	
+	return 0;
+}
+
+
 
 /************************************************************/
 /*  Receive Events from isdn_lib  here                     */
@@ -3168,12 +3285,14 @@
 		chan_misdn_log(1, bc->port, " --> Ignoring Call, its not in our MSN List\n");
 		return RESPONSE_IGNORE_SETUP; /*  Ignore MSNs which are not in our List */
 	}
+
 	
 	print_bearer(bc);
     
 	{
 		struct chan_list *ch=init_chan_list(ORG_MISDN);
 		struct ast_channel *chan;
+		int exceed;
 
 		if (!ch) { chan_misdn_log(-1, bc->port, "cb_events: malloc for chan_list failed!\n"); return 0;}
 		
@@ -3184,6 +3303,12 @@
 
 		chan=misdn_new(ch, AST_STATE_RESERVED,bc->dad, bc->oad, AST_FORMAT_ALAW, bc->port, bc->channel);
 		ch->ast = chan;
+
+		if ((exceed=add_in_calls(bc->port))) {
+			char tmp[16];
+			sprintf(tmp,"%d",exceed);
+			pbx_builtin_setvar_helper(chan,"MAX_OVERFLOW",tmp);
+		}
 
 		read_config(ch, ORG_MISDN);
 		
@@ -3678,6 +3803,21 @@
 
 /** TE STUFF END **/
 
+#ifdef M_TIMER
+/* timer thread */
+pthread_t misdn_timer;
+struct sched_context *misdn_sched;
+
+void misdn_timerd(void *arg)
+{
+
+	
+}
+
+
+/* timer thread end */
+#endif
+
 /******************************************
  *
  *   Asterisk Channel Endpoint END
@@ -3707,6 +3847,7 @@
 	ast_cli_unregister(&cli_show_cl);
 	ast_cli_unregister(&cli_show_config);
 	ast_cli_unregister(&cli_show_port);
+	ast_cli_unregister(&cli_show_ports_stats);
 	ast_cli_unregister(&cli_show_stacks);
 	ast_cli_unregister(&cli_restart_port);
 	ast_cli_unregister(&cli_port_up);
@@ -3763,7 +3904,15 @@
 		if (strlen(tempbuf))
 			tracing = 1;
 	}
-
+	
+	misdn_in_calls = (int *)malloc(sizeof(int) * (max_ports+1));
+	misdn_out_calls = (int *)malloc(sizeof(int) * (max_ports+1));
+
+	for (i=1; i <= max_ports; i++) {
+		misdn_in_calls[i]=0;
+		misdn_out_calls[i]=0;
+	}
+	
 	ast_mutex_init(&cl_te_lock);
 	ast_mutex_init(&release_lock_mutex);
 
@@ -3804,6 +3953,7 @@
 	ast_cli_register(&cli_show_config);
 	ast_cli_register(&cli_show_port);
 	ast_cli_register(&cli_show_stacks);
+	ast_cli_register(&cli_show_ports_stats);
 
 	ast_cli_register(&cli_restart_port);
 	ast_cli_register(&cli_port_up);
@@ -3832,6 +3982,9 @@
 
 
 	misdn_cfg_get( 0, MISDN_GEN_TRACEFILE, global_tracefile, BUFFERSIZE);
+
+
+
 	
 	chan_misdn_log(0, 0, "-- mISDN Channel Driver Registred -- (BE AWARE THIS DRIVER IS EXPERIMENTAL!)\n");
 

Modified: team/group/new_loader_completion/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_sip.c?rev=29504&r1=29503&r2=29504&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_sip.c (original)
+++ team/group/new_loader_completion/channels/chan_sip.c Mon May 22 14:21:17 2006
@@ -1049,14 +1049,14 @@
 /*--- Transmitting responses and requests */
 static int __sip_xmit(struct sip_pvt *p, char *data, int len);
 static int __sip_reliable_xmit(struct sip_pvt *p, int seqno, int resp, char *data, int len, int fatal, int sipmethod);
-static int __transmit_response(struct sip_pvt *p, const char *msg, struct sip_request *req, enum xmittype reliable);
-static int transmit_response(struct sip_pvt *p, char *msg, struct sip_request *req);
-static int transmit_response_reliable(struct sip_pvt *p, const char *msg, struct sip_request *req);
-static int transmit_response_with_date(struct sip_pvt *p, char *msg, struct sip_request *req);
-static int transmit_response_with_sdp(struct sip_pvt *p, char *msg, struct sip_request *req, enum xmittype reliable);
-static int transmit_response_with_unsupported(struct sip_pvt *p, const char *msg, struct sip_request *req, const char *unsupported);
-static int transmit_response_with_auth(struct sip_pvt *p, const char *msg, struct sip_request *req, const char *rand, enum xmittype reliable, const char *header, int stale);
-static int transmit_response_with_allow(struct sip_pvt *p, char *msg, struct sip_request *req, enum xmittype reliable);
+static int __transmit_response(struct sip_pvt *p, const char *msg, const struct sip_request *req, enum xmittype reliable);
+static int transmit_response(struct sip_pvt *p, const char *msg, const struct sip_request *req);
+static int transmit_response_reliable(struct sip_pvt *p, const char *msg, const struct sip_request *req);
+static int transmit_response_with_date(struct sip_pvt *p, const char *msg, const struct sip_request *req);
+static int transmit_response_with_sdp(struct sip_pvt *p, const char *msg, const struct sip_request *req, enum xmittype reliable);
+static int transmit_response_with_unsupported(struct sip_pvt *p, const char *msg, const struct sip_request *req, const char *unsupported);
+static int transmit_response_with_auth(struct sip_pvt *p, const char *msg, const struct sip_request *req, const char *rand, enum xmittype reliable, const char *header, int stale);
+static int transmit_response_with_allow(struct sip_pvt *p, const char *msg, const struct sip_request *req, enum xmittype reliable);
 static int transmit_request(struct sip_pvt *p, int sipmethod, int inc, enum xmittype reliable, int newbranch);
 static int transmit_request_with_auth(struct sip_pvt *p, int sipmethod, int inc, enum xmittype reliable, int newbranch);
 static int transmit_invite(struct sip_pvt *p, int sipmethod, int sendsdp, int init);
@@ -1066,11 +1066,11 @@
 static int transmit_message_with_text(struct sip_pvt *p, const char *text);
 static int transmit_refer(struct sip_pvt *p, const char *dest);
 static int transmit_state_notify(struct sip_pvt *p, int state, int full);
-static int transmit_register(struct sip_registry *r, int sipmethod, char *auth, char *authheader);
+static int transmit_register(struct sip_registry *r, int sipmethod, const char *auth, const char *authheader);
 static int retrans_pkt(void *data);
 static int send_response(struct sip_pvt *p, struct sip_request *req, enum xmittype reliable, int seqno);
 static int send_request(struct sip_pvt *p, struct sip_request *req, enum xmittype reliable, int seqno);
-static void copy_request(struct sip_request *dst, struct sip_request *src);
+static void copy_request(struct sip_request *dst, const struct sip_request *src);
 
 /*--- Dialog management */
 static struct sip_pvt *sip_alloc(ast_string_field callid, struct sockaddr_in *sin,
@@ -1170,14 +1170,14 @@
 static void append_date(struct sip_request *req);	/* Append date to SIP packet */
 static int determine_firstline_parts(struct sip_request *req);
 static const struct cfsubscription_types *find_subscription_type(enum subscriptiontype subtype);
-static const char *gettag(const struct sip_request *req, char *header, char *tagbuf, int tagbufsize);
+static const char *gettag(const struct sip_request *req, const char *header, char *tagbuf, int tagbufsize);

[... 1098 lines stripped ...]


More information about the asterisk-commits mailing list