[svn-commits] oej: branch oej/codename-pineapple r46374 - in /team/oej/codename-pineapple: ...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Oct 28 01:52:37 MST 2006


Author: oej
Date: Sat Oct 28 03:52:17 2006
New Revision: 46374

URL: http://svn.digium.com/view/asterisk?rev=46374&view=rev
Log:
Documentation and update to trunk, reset automerge

Modified:
    team/oej/codename-pineapple/   (props changed)
    team/oej/codename-pineapple/CHANGES
    team/oej/codename-pineapple/apps/app_alarmreceiver.c
    team/oej/codename-pineapple/apps/app_externalivr.c
    team/oej/codename-pineapple/apps/app_festival.c
    team/oej/codename-pineapple/apps/app_meetme.c
    team/oej/codename-pineapple/apps/app_osplookup.c
    team/oej/codename-pineapple/apps/app_page.c
    team/oej/codename-pineapple/apps/app_queue.c
    team/oej/codename-pineapple/apps/app_rpt.c
    team/oej/codename-pineapple/apps/app_sms.c
    team/oej/codename-pineapple/apps/app_voicemail.c
    team/oej/codename-pineapple/channels/chan_misdn.c
    team/oej/codename-pineapple/channels/chan_sip.c
    team/oej/codename-pineapple/channels/chan_sip3.c
    team/oej/codename-pineapple/channels/chan_zap.c
    team/oej/codename-pineapple/channels/misdn/chan_misdn_config.h
    team/oej/codename-pineapple/channels/misdn/isdn_lib.c
    team/oej/codename-pineapple/channels/misdn/isdn_lib.h
    team/oej/codename-pineapple/channels/misdn/isdn_msg_parser.c
    team/oej/codename-pineapple/channels/misdn_config.c
    team/oej/codename-pineapple/channels/sip3/sip3.h
    team/oej/codename-pineapple/configs/misdn.conf.sample
    team/oej/codename-pineapple/configs/queues.conf.sample
    team/oej/codename-pineapple/configs/voicemail.conf.sample
    team/oej/codename-pineapple/contrib/asterisk-ng-doxygen
    team/oej/codename-pineapple/contrib/scripts/astgenkey.8
    team/oej/codename-pineapple/main/asterisk.c
    team/oej/codename-pineapple/main/manager.c
    team/oej/codename-pineapple/main/pbx.c
    team/oej/codename-pineapple/main/rtp.c
    team/oej/codename-pineapple/main/say.c
    team/oej/codename-pineapple/main/translate.c
    team/oej/codename-pineapple/res/res_agi.c
    team/oej/codename-pineapple/res/res_musiconhold.c

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

Propchange: team/oej/codename-pineapple/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Oct 28 03:52:17 2006
@@ -1,1 +1,1 @@
-/trunk:1-46325
+/trunk:1-46373

Modified: team/oej/codename-pineapple/CHANGES
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/CHANGES?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/CHANGES (original)
+++ team/oej/codename-pineapple/CHANGES Sat Oct 28 03:52:17 2006
@@ -1,7 +1,9 @@
 Changes since Asterisk 1.4-beta was branched:
-  * rev.45982: enable https support for builtin web server.
+  * Added the ability to customize which sound files are used for some of the
+    prompts within the Voicemail application by changing them in voicemail.conf
+  * enable https support for builtin web server.
      See configs/http.conf.sample for details.
-  * rev.45945: add a new option, match_auth_username, to sip.conf,
+  * add a new option, match_auth_username, to sip.conf,
      to improve the matching of incoming requests.
      If set, and the incoming request carries authentication info,
      the username to match in the users list is taken from there
@@ -48,3 +50,7 @@
      and numeric representation of type of calling number value.
   * Added 'C' option to Meetme which causes a caller to continue in the dialplan
      when kicked out.
+  * Added option to run macro when a queue member is connected to a caller, 
+     see queues.conf.sample for details.
+  * Added QUEUE_VARIABLES function to set queue variables added setqueuevar and 
+    setqueueentryvar options for each queue, see queues.conf.sample for details.

Modified: team/oej/codename-pineapple/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_alarmreceiver.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/apps/app_alarmreceiver.c (original)
+++ team/oej/codename-pineapple/apps/app_alarmreceiver.c Sat Oct 28 03:52:17 2006
@@ -660,7 +660,7 @@
 		return -1;
 	}
 
-	/* Set default values for this invokation of the application */
+	/* Set default values for this invocation of the application */
 	
 	ast_copy_string(signalling_type, ADEMCO_CONTACT_ID, sizeof(signalling_type));
 

Modified: team/oej/codename-pineapple/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_externalivr.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/apps/app_externalivr.c (original)
+++ team/oej/codename-pineapple/apps/app_externalivr.c Sat Oct 28 03:52:17 2006
@@ -323,7 +323,7 @@
 			close(i);
 		execv(argv[0], argv);
 		fprintf(stderr, "Failed to execute '%s': %s\n", argv[0], strerror(errno));
-		exit(1);
+		_exit(1);
 	} else {
 		/* parent process */
 		int child_events_fd = child_stdin[1];

Modified: team/oej/codename-pineapple/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_festival.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/apps/app_festival.c (original)
+++ team/oej/codename-pineapple/apps/app_festival.c Sat Oct 28 03:52:17 2006
@@ -73,7 +73,7 @@
 {
     /* Receive file (probably a waveform file) from socket using   */
     /* Festival key stuff technique, but long winded I know, sorry */
-    /* but will receive any file without closeing the stream or    */
+    /* but will receive any file without closing the stream or    */
     /* using OOB data                                              */
     static char *file_stuff_key = "ft_StUfF_key"; /* must == Festival's key */
     char *buff;

Modified: team/oej/codename-pineapple/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_meetme.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/apps/app_meetme.c (original)
+++ team/oej/codename-pineapple/apps/app_meetme.c Sat Oct 28 03:52:17 2006
@@ -364,7 +364,7 @@
 	ASTOBJ_CONTAINER_COMPONENTS(struct ast_sla_station);
 };
 
-/*! SLA - Shared Line Apperance object. These consist of one trunk (outbound line)
+/*! SLA - Shared Line Appearance object. These consist of one trunk (outbound line)
 	and stations that receive incoming calls and place outbound calls over the trunk 
 */
 struct ast_sla {
@@ -1090,7 +1090,7 @@
 	time(&user->jointime);
 
 	if (conf->locked && (!(confflags & CONFFLAG_ADMIN))) {
-		/* Sorry, but this confernce is locked! */	
+		/* Sorry, but this conference is locked! */	
 		if (!ast_streamfile(chan, "conf-locked", chan->language))
 			ast_waitstream(chan, "");
 		goto outrun;

Modified: team/oej/codename-pineapple/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_osplookup.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/apps/app_osplookup.c (original)
+++ team/oej/codename-pineapple/apps/app_osplookup.c Sat Oct 28 03:52:17 2006
@@ -131,7 +131,7 @@
 /* OSP Module Global Variables */
 AST_MUTEX_DEFINE_STATIC(osplock);				/* Lock of OSP provider list */
 static int osp_initialized = 0;					/* Init flag */
-static int osp_hardware = 0;					/* Hardware accelleration flag */
+static int osp_hardware = 0;					/* Hardware acceleration flag */
 static struct osp_provider* ospproviders = NULL;		/* OSP provider list */
 static unsigned int osp_tokenformat = TOKEN_ALGO_SIGNED;	/* Token format supported */
 
@@ -1484,7 +1484,7 @@
 		t = ast_variable_retrieve(cfg, OSP_GENERAL_CAT, "accelerate");
 		if (t && ast_true(t)) {
 			if ((error = OSPPInit(1)) != OSPC_ERR_NO_ERROR) {
-				ast_log(LOG_WARNING, "OSP: Unable to enable hardware accelleration\n");
+				ast_log(LOG_WARNING, "OSP: Unable to enable hardware acceleration\n");
 				OSPPInit(0);
 			} else {
 				osp_hardware = 1;

Modified: team/oej/codename-pineapple/apps/app_page.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_page.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/apps/app_page.c (original)
+++ team/oej/codename-pineapple/apps/app_page.c Sat Oct 28 03:52:17 2006
@@ -60,7 +60,7 @@
 "caller is dumped into the conference as a speaker and the room is\n"
 "destroyed when the original caller leaves.  Valid options are:\n"
 "        d - full duplex audio\n"
-"	 q - quiet, do not play beep to caller\n"
+"        q - quiet, do not play beep to caller\n"
 "        r - record the page into a file (see 'r' for app_meetme)\n";
 
 

Modified: team/oej/codename-pineapple/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_queue.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/apps/app_queue.c (original)
+++ team/oej/codename-pineapple/apps/app_queue.c Sat Oct 28 03:52:17 2006
@@ -127,7 +127,7 @@
 static char *synopsis = "Queue a call for a call queue";
 
 static char *descrip =
-"  Queue(queuename[|options[|URL][|announceoverride][|timeout][|AGI]):\n"
+"  Queue(queuename[|options[|URL][|announceoverride][|timeout][|AGI][|macro]):\n"
 "Queues an incoming call in a particular call queue as defined in queues.conf.\n"
 "This application will return to the dialplan if the queue does not exist, or\n"
 "any of the join options cause the caller to not enter the queue.\n"
@@ -150,6 +150,8 @@
 "it.\n"
 "  The optional AGI parameter will setup an AGI script to be executed on the \n"
 "calling party's channel once they are connected to a queue member.\n"
+"  The optional macro parameter will run a macro on the \n"
+"calling party's channel once they are connected to a queue member.\n"
 "  The timeout will cause the queue to fail out after a specified number of\n"
 "seconds, checked between each queues.conf 'timeout' and 'retry' cycle.\n"
 "  This application sets the following channel variable upon completion:\n"
@@ -353,6 +355,8 @@
 	unsigned int leavewhenempty:2;
 	unsigned int ringinuse:1;
 	unsigned int setinterfacevar:1;
+	unsigned int setqueuevar:1;
+	unsigned int setqueueentryvar:1;
 	unsigned int reportholdtime:1;
 	unsigned int wrapped:1;
 	unsigned int timeoutrestart:1;
@@ -370,6 +374,7 @@
 	int callscompletedinsl;             /*!< Number of calls answered with servicelevel*/
 	char monfmt[8];                     /*!< Format to use when recording calls */
 	int montype;                        /*!< Monitor type  Monitor vs. MixMonitor */
+	char membermacro[32];               /*!< Macro to run upon member connection */
 	char sound_next[80];                /*!< Sound file: "Your call is now first in line" (def. queue-youarenext) */
 	char sound_thereare[80];            /*!< Sound file: "There are currently" (def. queue-thereare) */
 	char sound_calls[80];               /*!< Sound file: "calls waiting to speak to a representative." (def. queue-callswaiting)*/
@@ -438,6 +443,26 @@
 	}
 
 	return -1;
+}
+
+static void set_queue_variables(struct queue_ent *qe)
+{
+
+	char interfacevar[256]="";
+	float sl = 0;
+        
+	if (qe->parent->setqueuevar) {
+	sl = 0;
+	if (qe->parent->callscompleted > 0) 
+		sl = 100 * ((float) qe->parent->callscompletedinsl / (float) qe->parent->callscompleted);
+
+	snprintf(interfacevar,sizeof(interfacevar),
+		"QUEUEMAX=%d|QUEUESTRATEGY=%s|QUEUECALLS=%d|QUEUEHOLDTIME=%d|QUEUECOMPLETED=%d|QUEUEABANDONED=%d|QUEUESRVLEVEL=%d|QUEUESRVLEVELPERF=%2.1f",
+		qe->parent->maxlen, int2strat(qe->parent->strategy), qe->parent->count, qe->parent->holdtime, qe->parent->callscompleted,
+		qe->parent->callsabandoned,  qe->parent->servicelevel, sl);
+	
+	pbx_builtin_setvar(qe->chan, interfacevar); 
+	}
 }
 
 /*! \brief Insert the 'new' entry after the 'prev' entry of queue 'q' */
@@ -646,8 +671,11 @@
 	q->servicelevel = 0;
 	q->ringinuse = 1;
 	q->setinterfacevar = 0;
+	q->setqueuevar = 0;
+	q->setqueueentryvar = 0;
 	q->autofill = autofill_default;
 	q->montype = montype_default;
+	q->membermacro[0] = '\0';
 	q->moh[0] = '\0';
 	q->announce[0] = '\0';
 	q->context[0] = '\0';
@@ -782,10 +810,16 @@
 		q->ringinuse = ast_true(val);
 	} else if (!strcasecmp(param, "setinterfacevar")) {
 		q->setinterfacevar = ast_true(val);
+	} else if (!strcasecmp(param, "setqueuevar")) {
+		q->setqueuevar = ast_true(val);
+	} else if (!strcasecmp(param, "setqueueentryvar")) {
+		q->setqueueentryvar = ast_true(val);
 	} else if (!strcasecmp(param, "monitor-join")) {
 		q->monjoin = ast_true(val);
 	} else if (!strcasecmp(param, "monitor-format")) {
 		ast_copy_string(q->monfmt, val, sizeof(q->monfmt));
+	} else if (!strcasecmp(param, "membermacro")) {
+		ast_copy_string(q->membermacro, val, sizeof(q->membermacro));
 	} else if (!strcasecmp(param, "queue-youarenext")) {
 		ast_copy_string(q->sound_next, val, sizeof(q->sound_next));
 	} else if (!strcasecmp(param, "queue-thereare")) {
@@ -1809,6 +1843,7 @@
 static void record_abandoned(struct queue_ent *qe)
 {
 	ast_mutex_lock(&qe->parent->lock);
+	set_queue_variables(qe);
 	manager_event(EVENT_FLAG_AGENT, "QueueCallerAbandon",
 		"Queue: %s\r\n"
 		"Uniqueid: %s\r\n"
@@ -2261,7 +2296,7 @@
 	return 0;
 }
 
-static int try_calling(struct queue_ent *qe, const char *options, char *announceoverride, const char *url, int *go_on, const char *agi)
+static int try_calling(struct queue_ent *qe, const char *options, char *announceoverride, const char *url, int *go_on, const char *agi, const char *macro)
 {
 	struct member *cur;
 	struct callattempt *outgoing = NULL; /* the list of calls we are building */
@@ -2269,6 +2304,7 @@
 	char oldexten[AST_MAX_EXTENSION]="";
 	char oldcontext[AST_MAX_CONTEXT]="";
 	char queuename[256]="";
+	char interfacevar[256]="";
 	struct ast_channel *peer;
 	struct ast_channel *which;
 	struct callattempt *lpeer;
@@ -2284,6 +2320,7 @@
 	struct ast_bridge_config bridge_config;
 	char nondataquality = 1;
 	char *agiexec = NULL;
+	char *macroexec = NULL;
 	int ret = 0;
 	const char *monitorfilename;
 	const char *monitor_exec;
@@ -2295,7 +2332,6 @@
 	char *p;
 	char vars[2048];
 	int forwardsallowed = 1;
-
 	memset(&bridge_config, 0, sizeof(bridge_config));
 	time(&now);
 		
@@ -2578,10 +2614,65 @@
 				ast_log(LOG_DEBUG, "app_queue: sendurl=%s.\n", url);
 			ast_channel_sendurl(peer, url);
 		}
+		
+		ast_mutex_lock(&qe->parent->lock);
+		/* if setinterfacevar is defined, make member variables available to the channel */
+		/* use  pbx_builtin_setvar to set a load of variables with one call */
 		if (qe->parent->setinterfacevar) {
-				pbx_builtin_setvar_helper(qe->chan, "MEMBERINTERFACE", member->interface);
-				pbx_builtin_setvar_helper(qe->chan, "MEMBERNAME", member->membername);
-		}
+			snprintf(interfacevar,sizeof(interfacevar), "MEMBERINTERFACE=%s|MEMBERNAME=%s|MEMBERCALLS=%d|MEMBERLASTCALL=%ld|MEMBERPENALTY=%d|MEMBERDYNAMIC=%d",
+				member->interface, member->membername, member->calls, member->lastcall, member->penalty, member->dynamic);
+		 	pbx_builtin_setvar(qe->chan, interfacevar);
+		}
+		
+		/* if setqueueentryvar is defined, make queue entry (i.e. the caller) variables available to the channel */
+		/* use  pbx_builtin_setvar to set a load of variables with one call */
+		if (qe->parent->setqueueentryvar) {
+			snprintf(interfacevar,sizeof(interfacevar), "QEHOLDTIME=%ld|QEORIGINALPOS=%d",
+				(long)time(NULL) - qe->start, qe->opos);
+			pbx_builtin_setvar(qe->chan, interfacevar);
+		}
+	
+		/* try to set queue variables if configured to do so*/
+		set_queue_variables(qe);
+		ast_mutex_unlock(&qe->parent->lock);
+		
+		/* run a macro for this connection if defined. The macro simply returns, no action is taken on the result */
+		/* use macro from dialplan if passed as a option, otherwise use the default queue macro */
+		if (!ast_strlen_zero(macro)) {
+				macroexec = ast_strdupa(macro);
+		} else {
+			if (qe->parent->membermacro)
+				macroexec = ast_strdupa(qe->parent->membermacro);
+		}
+
+		if (!ast_strlen_zero(macroexec)) {
+			if (option_debug)
+				ast_log(LOG_DEBUG, "app_queue: macro=%s.\n", macroexec);
+			
+			res = ast_autoservice_start(qe->chan);
+			if (res) {
+				ast_log(LOG_ERROR, "Unable to start autoservice on calling channel\n");
+				res = -1;
+			}
+			
+			app = pbx_findapp("Macro");
+			
+			if (app) {
+				res = pbx_exec(qe->chan, app, macroexec);
+				if (option_debug)
+					ast_log(LOG_DEBUG, "Macro exited with status %d\n", res);
+				res = 0;
+			} else {
+				ast_log(LOG_ERROR, "Could not find application Macro\n");
+				res = -1;
+			}
+		
+			if (ast_autoservice_stop(qe->chan) < 0) {
+				ast_log(LOG_ERROR, "Could not stop autoservice on calling channel\n");
+				res = -1;
+			}
+		}
+
 		if (!ast_strlen_zero(agi)) {
 			if (option_debug)
 				ast_log(LOG_DEBUG, "app_queue: agi=%s.\n", agi);
@@ -3270,6 +3361,7 @@
 		AST_APP_ARG(announceoverride);
 		AST_APP_ARG(queuetimeoutstr);
 		AST_APP_ARG(agi);
+		AST_APP_ARG(macro);
 	);
 	/* Our queue entry */
 	struct queue_ent qe;
@@ -3412,7 +3504,7 @@
 				}
 
 				/* Try calling all queue members for 'timeout' seconds */
-				res = try_calling(&qe, args.options, args.announceoverride, args.url, &go_on, args.agi);
+				res = try_calling(&qe, args.options, args.announceoverride, args.url, &go_on, args.agi, args.macro);
 				if (res) {
 					if (res < 0) {
 						if (!qe.handled) {
@@ -3502,6 +3594,9 @@
 			}			
 			ast_stopstream(chan);
 		}
+
+		set_queue_variables(&qe);
+
 		leave_queue(&qe);
 		if (reason != QUEUE_UNKNOWN)
 			set_queue_result(chan, reason);
@@ -3515,12 +3610,14 @@
 	return res;
 }
 
-static int queue_function_qac(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
-{
-	int count = 0;
+static int queue_function_var(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+{
+	int res = -1;
 	struct call_queue *q;
 	struct ast_module_user *lu;
-	struct member *m;
+
+	char interfacevar[256]="";
+        float sl = 0;
 
 	buf[0] = '\0';
 	
@@ -3541,27 +3638,36 @@
 	AST_LIST_UNLOCK(&queues);
 
 	if (q) {
-		for (m = q->members; m; m = m->next) {
-			/* Count the agents who are logged in and presently answering calls */
-			if ((m->status != AST_DEVICE_UNAVAILABLE) && (m->status != AST_DEVICE_INVALID)) {
-				count++;
-			}
-		}
+        	if (q->setqueuevar) {
+		        sl = 0;
+			res = 0;
+
+		        if (q->callscompleted > 0)
+		                sl = 100 * ((float) q->callscompletedinsl / (float) q->callscompleted);
+
+		        snprintf(interfacevar,sizeof(interfacevar),
+                		"QUEUEMAX=%d|QUEUESTRATEGY=%s|QUEUECALLS=%d|QUEUEHOLDTIME=%d|QUEUECOMPLETED=%d|QUEUEABANDONED=%d|QUEUESRVLEVEL=%d|QUEUESRVLEVELPERF=%2.1f",
+		                q->maxlen, int2strat(q->strategy), q->count, q->holdtime, q->callscompleted, q->callsabandoned,  q->servicelevel, sl);
+
+		        pbx_builtin_setvar(chan, interfacevar);
+	        }
+
 		ast_mutex_unlock(&q->lock);
 	} else
 		ast_log(LOG_WARNING, "queue %s was not found\n", data);
 
-	snprintf(buf, len, "%d", count);
+	snprintf(buf, len, "%d", res);
 	ast_module_user_remove(lu);
 
 	return 0;
 }
 
-static int queue_function_queuewaitingcount(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+static int queue_function_qac(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
 {
 	int count = 0;
 	struct call_queue *q;
 	struct ast_module_user *lu;
+	struct member *m;
 
 	buf[0] = '\0';
 	
@@ -3582,6 +3688,47 @@
 	AST_LIST_UNLOCK(&queues);
 
 	if (q) {
+		for (m = q->members; m; m = m->next) {
+			/* Count the agents who are logged in and presently answering calls */
+			if ((m->status != AST_DEVICE_UNAVAILABLE) && (m->status != AST_DEVICE_INVALID)) {
+				count++;
+			}
+		}
+		ast_mutex_unlock(&q->lock);
+	} else
+		ast_log(LOG_WARNING, "queue %s was not found\n", data);
+
+	snprintf(buf, len, "%d", count);
+	ast_module_user_remove(lu);
+
+	return 0;
+}
+
+static int queue_function_queuewaitingcount(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+{
+	int count = 0;
+	struct call_queue *q;
+	struct ast_module_user *lu;
+
+	buf[0] = '\0';
+	
+	if (ast_strlen_zero(data)) {
+		ast_log(LOG_ERROR, "%s requires an argument: queuename\n", cmd);
+		return -1;
+	}
+
+	lu = ast_module_user_add(chan);
+	
+	AST_LIST_LOCK(&queues);
+	AST_LIST_TRAVERSE(&queues, q, list) {
+		if (!strcasecmp(q->name, data)) {
+			ast_mutex_lock(&q->lock);
+			break;
+		}
+	}
+	AST_LIST_UNLOCK(&queues);
+
+	if (q) {
 		count = q->count;
 		ast_mutex_unlock(&q->lock);
 	} else
@@ -3644,6 +3791,24 @@
 
 	return 0;
 }
+
+static struct ast_custom_function queuevar_function = {
+	.name = "QUEUE_VARIABLES",
+	.synopsis = "Return Queue information in variables",
+	.syntax = "QUEUE_VARIABLES(<queuename>)",
+	.desc =
+"Makes the following queue variables available.\n"
+"QUEUEMAX maxmimum number of calls allowed\n"
+"QUEUESTRATEGY the strategy of the queue\n"
+"QUEUECALLS number of calls currently in the queue\n"
+"QUEUEHOLDTIME current average hold time\n"
+"QUEUECOMPLETED number of completed calls for the queue\n"
+"QUEUEABANDONED number of abandoned calls\n"
+"QUEUESRVLEVEL queue service level\n"
+"QUEUESRVLEVELPERF current service level performance\n"
+"Returns 0 if queue is found and setqueuevar is defined, -1 otherwise",
+	.read = queue_function_var,
+};
 
 static struct ast_custom_function queuemembercount_function = {
 	.name = "QUEUE_MEMBER_COUNT",
@@ -4469,6 +4634,7 @@
 	res |= ast_unregister_application(app_upqm);
 	res |= ast_unregister_application(app_ql);
 	res |= ast_unregister_application(app);
+	res |= ast_custom_function_unregister(&queuevar_function);
 	res |= ast_custom_function_unregister(&queuemembercount_function);
 	res |= ast_custom_function_unregister(&queuememberlist_function);
 	res |= ast_custom_function_unregister(&queuewaitingcount_function);
@@ -4500,6 +4666,7 @@
 	res |= ast_manager_register("QueueAdd", EVENT_FLAG_AGENT, manager_add_queue_member, "Add interface to queue.");
 	res |= ast_manager_register("QueueRemove", EVENT_FLAG_AGENT, manager_remove_queue_member, "Remove interface from queue.");
 	res |= ast_manager_register("QueuePause", EVENT_FLAG_AGENT, manager_pause_queue_member, "Makes a queue member temporarily unavailable");
+	res |= ast_custom_function_register(&queuevar_function);
 	res |= ast_custom_function_register(&queuemembercount_function);
 	res |= ast_custom_function_register(&queuememberlist_function);
 	res |= ast_custom_function_register(&queuewaitingcount_function);

Modified: team/oej/codename-pineapple/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_rpt.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/apps/app_rpt.c (original)
+++ team/oej/codename-pineapple/apps/app_rpt.c Sat Oct 28 03:52:17 2006
@@ -766,7 +766,7 @@
 } ;
 
 /*
-* Forward decl's - these suppress compiler warnings when funcs coded further down the file than thier invokation
+* Forward decl's - these suppress compiler warnings when funcs coded further down the file than their invocation
 */
 
 static int setrbi(struct rpt *myrpt);
@@ -1540,7 +1540,7 @@
 	
 	dottime = 900 / speed;
 	
-	/* Establish timing releationships */
+	/* Establish timing relationships */
 	
 	dashtime = 3 * dottime;
 	intralettertime = dottime;
@@ -7238,7 +7238,7 @@
 				service_scan(myrpt);
 			}
 		}
-		if (who == chan) { /* if it was a read from incomming */
+		if (who == chan) { /* if it was a read from incoming */
 			f = ast_read(chan);
 			if (!f) {
 				if (debug)

Modified: team/oej/codename-pineapple/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_sms.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/apps/app_sms.c (original)
+++ team/oej/codename-pineapple/apps/app_sms.c Sat Oct 28 03:52:17 2006
@@ -542,7 +542,7 @@
 		}
 	}
 	while (l--)
-		*o++ = *i++;	  /* not to UTF-8 as explicitely 8 bit coding in DCS */
+		*o++ = *i++;	  /* not to UTF-8 as explicitly 8 bit coding in DCS */
 	*udl = (o - ud);
 }
 

Modified: team/oej/codename-pineapple/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_voicemail.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/apps/app_voicemail.c (original)
+++ team/oej/codename-pineapple/apps/app_voicemail.c Sat Oct 28 03:52:17 2006
@@ -505,6 +505,13 @@
 static int maxgreet;
 static int skipms;
 static int maxlogins;
+
+/* cutom password sounds */
+static char vm_password[80] = "vm-password";
+static char vm_newpassword[80] = "vm-newpassword";
+static char vm_passchanged[80] = "vm-passchanged";
+static char vm_reenterpassword[80] = "vm-reenterpassword";
+static char vm_mismatch[80] = "vm-mismatch";
 
 static struct ast_flags globalflags = {0};
 
@@ -1790,7 +1797,7 @@
 static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *dur, char *date, char *passdata, size_t passdatasize, const char *category)
 {
 	char callerid[256];
-	/* Prepare variables for substition in email body and subject */
+	/* Prepare variables for substitution in email body and subject */
 	pbx_builtin_setvar_helper(ast, "VM_NAME", vmu->fullname);
 	pbx_builtin_setvar_helper(ast, "VM_DUR", dur);
 	snprintf(passdata, passdatasize, "%d", msgnum);
@@ -2901,7 +2908,7 @@
 		msgnum = newmsgs + oldmsgs;
 		ast_log(LOG_NOTICE, "Messagecount set to %d\n",msgnum);
 		snprintf(fn, sizeof(fn), "%s/imap/msg%s%04d", VM_SPOOL_DIR, vmu->mailbox, msgnum);
-		/* set variable for compatability */
+		/* set variable for compatibility */
 		pbx_builtin_setvar_helper(chan, "VM_MESSAGEFILE", "IMAP_STORAGE");
 
 		/* Check if mailbox is full */
@@ -5471,7 +5478,7 @@
 	   so they won't get here again */
 	for (;;) {
 		newpassword[1] = '\0';
-		newpassword[0] = cmd = ast_play_and_wait(chan,"vm-newpassword");
+		newpassword[0] = cmd = ast_play_and_wait(chan, vm_newpassword);
 		if (cmd == '#')
 			newpassword[0] = '\0';
 		if (cmd < 0 || cmd == 't' || cmd == '#')
@@ -5480,7 +5487,7 @@
 		if (cmd < 0 || cmd == 't' || cmd == '#')
 			return cmd;
 		newpassword2[1] = '\0';
-		newpassword2[0] = cmd = ast_play_and_wait(chan,"vm-reenterpassword");
+		newpassword2[0] = cmd = ast_play_and_wait(chan, vm_reenterpassword);
 		if (cmd == '#')
 			newpassword2[0] = '\0';
 		if (cmd < 0 || cmd == 't' || cmd == '#')
@@ -5491,7 +5498,7 @@
 		if (!strcmp(newpassword, newpassword2))
 			break;
 		ast_log(LOG_NOTICE,"Password mismatch for user %s (%s != %s)\n", vms->username, newpassword, newpassword2);
-		cmd = ast_play_and_wait(chan, "vm-mismatch");
+		cmd = ast_play_and_wait(chan, vm_mismatch);
 		if (++tries == 3)
 			return -1;
 	}
@@ -5501,7 +5508,7 @@
 		vm_change_password_shell(vmu,newpassword);
 	if (option_debug)
 		ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword));
-	cmd = ast_play_and_wait(chan,"vm-passchanged");
+	cmd = ast_play_and_wait(chan, vm_passchanged);
 
 	/* If forcename is set, have the user record their name */	
 	if (ast_test_flag(vmu, VM_FORCENAME)) {
@@ -5571,7 +5578,7 @@
 				break;
 			}
 			newpassword[1] = '\0';
-			newpassword[0] = cmd = ast_play_and_wait(chan,"vm-newpassword");
+			newpassword[0] = cmd = ast_play_and_wait(chan, vm_newpassword);
 			if (cmd == '#')
 				newpassword[0] = '\0';
 			else {
@@ -5582,7 +5589,7 @@
 				}
 			}
 			newpassword2[1] = '\0';
-			newpassword2[0] = cmd = ast_play_and_wait(chan,"vm-reenterpassword");
+			newpassword2[0] = cmd = ast_play_and_wait(chan, vm_reenterpassword);
 			if (cmd == '#')
 				newpassword2[0] = '\0';
 			else {
@@ -5595,7 +5602,7 @@
 			}
 			if (strcmp(newpassword, newpassword2)) {
 				ast_log(LOG_NOTICE,"Password mismatch for user %s (%s != %s)\n", vms->username, newpassword, newpassword2);
-				cmd = ast_play_and_wait(chan, "vm-mismatch");
+				cmd = ast_play_and_wait(chan, vm_mismatch);
 				break;
 			}
 			if (ast_strlen_zero(ext_pass_cmd)) 
@@ -5604,7 +5611,7 @@
 				vm_change_password_shell(vmu,newpassword);
 			if (option_debug)
 				ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword));
-			cmd = ast_play_and_wait(chan,"vm-passchanged");
+			cmd = ast_play_and_wait(chan, vm_passchanged);
 			break;
 		case '*': 
 			cmd = 't';
@@ -5854,7 +5861,7 @@
 			/* saved password is blank, so don't bother asking */
 			password[0] = '\0';
 		} else {
-			if (ast_streamfile(chan, "vm-password", chan->language)) {
+			if (ast_streamfile(chan, vm_password, chan->language)) {
 				ast_log(LOG_WARNING, "Unable to stream password file\n");
 				return -1;
 			}
@@ -5908,7 +5915,7 @@
 
 static int vm_execmain(struct ast_channel *chan, void *data)
 {
-	/* XXX This is, admittedly, some pretty horrendus code.  For some
+	/* XXX This is, admittedly, some pretty horrendous code.  For some
 	   reason it just seemed a lot easier to do with GOTO's.  I feel
 	   like I'm back in my GWBASIC days. XXX */
 	int res=-1;
@@ -6429,7 +6436,7 @@
 #endif
 			mail_expunge(vms.mailstream);
 	}
-	/*  before we delete the state, we should copy pertainent info
+	/*  before we delete the state, we should copy pertinent info
 	 *  back to the persistent model */
 	vmstate_delete(&vms);
 #endif
@@ -6844,6 +6851,11 @@
 	const char *extpc;
 	const char *emaildateformatstr;
 	const char *volgainstr;
+	const char *vm_paswd;
+	const char *vm_newpasswd;
+	const char *vm_passchange;
+	const char *vm_reenterpass;
+	const char *vm_mism;
 	int x;
 	int tmpadsi[4];
 
@@ -7082,14 +7094,14 @@
 		}
 		ast_set2_flag((&globalflags), ast_true(astreview), VM_REVIEW);	
 
-		/*Temperary greeting reminder */
+		/*Temporary greeting reminder */
 		if (!(asttempgreetwarn = ast_variable_retrieve(cfg, "general", "tempgreetwarn"))) {
 			if (option_debug)
-				ast_log(LOG_DEBUG, "VM Temperary Greeting Reminder Option disabled globally\n");
+				ast_log(LOG_DEBUG, "VM Temporary Greeting Reminder Option disabled globally\n");
 			asttempgreetwarn = "no";
 		} else {
 			if (option_debug)
-				ast_log(LOG_DEBUG, "VM Temperary Greeting Reminder Option enabled globally\n");
+				ast_log(LOG_DEBUG, "VM Temporary Greeting Reminder Option enabled globally\n");
 		}
 		ast_set2_flag((&globalflags), ast_true(asttempgreetwarn), VM_TEMPGREETWARN);
 
@@ -7167,6 +7179,18 @@
 		} else {
 			exitcontext[0] = '\0';
 		}
+		
+		/* load password sounds configuration */
+		if ((vm_paswd = ast_variable_retrieve(cfg, "general", "vm-password")))
+			ast_copy_string(vm_password, vm_paswd, sizeof(vm_password));
+		if ((vm_newpasswd = ast_variable_retrieve(cfg, "general", "vm-newpassword")))
+			ast_copy_string(vm_newpassword, vm_newpasswd, sizeof(vm_newpassword));
+		if ((vm_passchange = ast_variable_retrieve(cfg, "general", "vm-passchanged")))
+			ast_copy_string(vm_passchanged, vm_passchange, sizeof(vm_passchanged));
+		if ((vm_reenterpass = ast_variable_retrieve(cfg, "general", "vm-reenterpassword")))
+			ast_copy_string(vm_reenterpassword, vm_reenterpass, sizeof(vm_reenterpassword));
+		if ((vm_mism = ast_variable_retrieve(cfg, "general", "vm-mismatch")))
+			ast_copy_string(vm_mismatch, vm_mism, sizeof(vm_mismatch));
 
 		if (!(astdirfwd = ast_variable_retrieve(cfg, "general", "usedirectory"))) 
 			astdirfwd = "no";
@@ -8459,7 +8483,7 @@
 	struct vmstate *vc, *vf = NULL, *vl = NULL;
 	struct vm_state *altvms;
 
-	/* If interactive, we should copy pertainent info
+	/* If interactive, we should copy pertinent info
 	   back to the persistent state (to make update immediate) */
 	if (vms->interactive == 1) {
 		altvms = vms->persist_vms;

Modified: team/oej/codename-pineapple/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_misdn.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/channels/chan_misdn.c (original)
+++ team/oej/codename-pineapple/channels/chan_misdn.c Sat Oct 28 03:52:17 2006
@@ -199,6 +199,9 @@
 	int dropped_frame_cnt;
 
 	int far_alerting;
+
+	int nttimeout;
+
 	int other_pid;
 	struct chan_list *other_ch;
 
@@ -1650,6 +1653,7 @@
 	misdn_cfg_get( port, MISDN_CFG_SENDDTMF, &bc->send_dtmf, sizeof(int));
 
 	misdn_cfg_get( port, MISDN_CFG_NEED_MORE_INFOS, &bc->need_more_infos, sizeof(int));
+	misdn_cfg_get( port, MISDN_CFG_NTTIMEOUT, &ch->nttimeout, sizeof(int));
 	
 	misdn_cfg_get( port, MISDN_CFG_FAR_ALERTING, &ch->far_alerting, sizeof(int));
 
@@ -2741,11 +2745,14 @@
 			*rc=who;
 			break;
 		}
-		
+	
+#if 0
 		if (f->frametype == AST_FRAME_VOICE) {
-			chan_misdn_log(1,0,"Got Voice frame in Bridged state..\n");
+			chan_misdn_log(1, ch1->bc->port, "I SEND: Splitting conference with Number:%d\n", ch1->bc->pid +1);
+	
 			continue;
 		}
+#endif
 
 		if (who == c0) {
 			ast_write(c1,f);
@@ -4264,6 +4271,7 @@
 			ch->state=MISDN_CLEANING;
 	}
 	break;
+	case EVENT_BCHAN_ERROR:
 	case EVENT_CLEANUP:
 	{
 		stop_bc_tones(ch);
@@ -4375,9 +4383,11 @@
 			chan_misdn_log(1,bc->port,"--> state: %s\n",misdn_get_ch_state(ch));
 
 		switch (ch->state) {
-			case MISDN_CALLING:
 			case MISDN_DIALING:
 			case MISDN_PROGRESS:
+				if (bc->nt && !ch->nttimeout) break;
+			
+			case MISDN_CALLING:
 			case MISDN_ALERTING:
 			case MISDN_PROCEEDING:
 			case MISDN_CALLING_ACKNOWLEDGE:

Modified: team/oej/codename-pineapple/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_sip.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/channels/chan_sip.c (original)
+++ team/oej/codename-pineapple/channels/chan_sip.c Sat Oct 28 03:52:17 2006
@@ -5569,6 +5569,7 @@
 			ast_log(LOG_DEBUG, "Strict routing enforced for session %s\n", p->callid);
 	}
 	
+#ifdef SKREP
 	/* Let's try to figure out the direction of this transaction within the dialog */
 	/* If we're sending an ACK, we DID send the INVITE - which means outbound.
 	   INVITE's are outbound transactions, always 
@@ -5576,6 +5577,7 @@
 	if (sipmethod == SIP_ACK || sipmethod == SIP_INVITE)
 		is_outbound = TRUE;
 	/* In other case's, let's follow the flow of the dialog */
+#endif
 
 	if (sipmethod == SIP_CANCEL)
 		c = p->initreq.rlPart2;	/* Use original URI */
@@ -10607,6 +10609,8 @@
 			ast_cli(fd, "  Their Codec Capability:   %d\n", cur->peercapability);
 			ast_cli(fd, "  Joint Codec Capability:   %d\n", cur->jointcapability);
 			ast_cli(fd, "  Format:                 %s\n", ast_getformatname_multiple(formatbuf, sizeof(formatbuf), cur->owner ? cur->owner->nativeformats : 0) );
+			ast_cli(fd, "  T.38 support            %s\n", cur->udptl ? "Yes" : "No");
+			ast_cli(fd, "  Video support           %s\n", cur->vrtp ? "Yes" : "No");
 			ast_cli(fd, "  MaxCallBR:              %d kbps\n", cur->maxcallbitrate);
 			ast_cli(fd, "  Theoretical Address:    %s:%d\n", ast_inet_ntoa(cur->sa.sin_addr), ntohs(cur->sa.sin_port));
 			ast_cli(fd, "  Received Address:       %s:%d\n", ast_inet_ntoa(cur->recv.sin_addr), ntohs(cur->recv.sin_port));

Modified: team/oej/codename-pineapple/channels/chan_sip3.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_sip3.c?rev=46374&r1=46373&r2=46374&view=diff
==============================================================================
--- team/oej/codename-pineapple/channels/chan_sip3.c (original)
+++ team/oej/codename-pineapple/channels/chan_sip3.c Sat Oct 28 03:52:17 2006
@@ -3,6 +3,8 @@
 *
 *  -- Mail bugs to oej at edvina.net, do not file them in the bug tracker
 */
+
+/* To skip to source code, search for "-END-" */
 
 /*
  * Asterisk -- An open source telephony toolkit.
@@ -93,10 +95,25 @@
  * the sip_hangup() function
  */
 
+/*!	\page chan_sip3_00index Chan_sip3: Index over docs
+	\title Chan_sip3 :: Index
+
+	- \ref chan_sip3_start
+	- \ref chan_sip3_objects
+	- \ref chan_sip3_files
+	- \ref chan_sip3_auth
+	- \ref chan_sip3_dialogs
+
+	\par todo Things to do, ideas
+	- \ref chan_sip3_todo
+	- \ref chan_sip3_subs
+
+*/
+
 /*! 
-	\page chan_sip3_start Welcome to Codename Pineapple :: chan_sip3 !
-
-	\title What's this?
+	\page chan_sip3_start Chan_sip3: Welcome to Codename Pineapple !
+
+	\title Chan_sip3: What's this?
 	This is a re-work of the SIP channel in Asterisk. 
 	This channel will not be backwards compatible with the old 
 	sip channel. In order to be more SIP compatible, I will have
@@ -106,7 +123,7 @@
 	** This work is sponsored by voop.com - the Internet Dialtone.
 	   I am open for more sponsors - contact me on oej at edvina.net
 
-	\page chan_sip3_todo Things to do
+	\page chan_sip3_todo Chan_sip3: Things to do
 	Done
 	- removed userconf support (in favour of astum)
 	- added the peermatch branch
@@ -121,7 +138,6 @@
 	- Add astum
 	- Add sipregister branch
 	- Split up source code file
-	- Remove user
 	- Add type=device for peers
 	- Add type=service for register= replacement
 	- Add type=trunk definition, based on domain routing
@@ -140,7 +156,8 @@
 	- change "sip nodebug" to "sip debug off" and "sip debug" to "sip debug on"
 
 	- ... And much more
-
+*/
+/*!
 	\page chan_sip3_objects	Chan_sip3: Devices, trunks and services
 	- \b phones are devices that connect to Asterisk. They register with  
 	Asterisk acting as a SIP location server/registrar and use Asterisk 
@@ -168,6 +185,56 @@
 	instead of just matching on domain and then authenticate.
 
 */
+
+/*!
+	\page chan_sip3_subs Chan_sip3: Subscriptions
+
+	\title Ideas for a new subscription system
+	
+	We need to move out the active subsriptions to a list
+	of their own, like the registry. Do not keep them in
+	the active dialog list, they're active subscriptions.
+
+	Add a list of internal and external subscriptions.
+	We need one object that "watches" URIs or extensions
+	that is connected to subscribers. For several subscribers,
+	we have only one internal or external subscription.
+
+	Should the external subscription system be directly
+	connected or go through the hint subsystem? Will this
+	cause un-needed overhead?
+
+	exten => johnny,hint,sipsubscribe::sip:johnny at johnnysdomain.com
+
+*/
+
+/*!
+	\page chan_sip3_files Chan_sip3: Source code files
+	\title Chan_sip3: Source Code Files
+
+	\b \\channels
+
+	- \b chan_sip3.c	The main source code file for the channel
+				PBX interface
+
+	\b \\channels\\sip3
+	
+	- \b sip3.h		The include file for structures and enums
+	- \b sip3funcs.h	The include file for functions
+	- \b sip3_cliami.c	Manager and CLI functions
+	- \b sip3_sdprtp.c	SDP handling and RTP interface
+	- \b sip3_callerid.c	CallerID, pres and RPID handling
+	- \b sip3_dialog.c	SIP dialog support
+	- \b sip3_auth.c	SIP authentication
+	- \b sip3_config.c	Configuration
+	- \b sip3_domain.c	SIP domain support
+	- \b sip3_subscribe.c	SIP subscription support
+	- \b sip3_parse.c	Parsing stuff
+	- \b sip3_refer.c	SIP transfer support

[... 808 lines stripped ...]


More information about the svn-commits mailing list