[asterisk-commits] branch oej/jitterbuffer-1.2 r29800 - in
/team/oej/jitterbuffer-1.2: ./ apps/ ...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue May 23 12:26:49 MST 2006
Author: russell
Date: Tue May 23 14:26:48 2006
New Revision: 29800
URL: http://svn.digium.com/view/asterisk?rev=29800&view=rev
Log:
Merged revisions 25160,25165,25288,25322,25442,25518,25520,25522,25563,25608,26050,26090,26760,26773,27051,27093,27468,27594,27636,27723,27767,27847,27927,27973,28125,28169,28212,28257,28335,28337,28380,28384,28627,28630,28651,28698,28754,28790,28794,28896,28966,28968,29052,29196,29394,29398,29464,29512,29555,29696,29732-29733,29764 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r25160 | russell | 2006-05-05 22:25:48 -0400 (Fri, 05 May 2006) | 4 lines
fix a problem where the frame's data pointer is overwritten by the newly
allocated data buffer before the data can be copied from it. This is in
the ast_frisolate() function which is rarely used. (issue #6732, stefankroon)
........
r25165 | russell | 2006-05-05 22:32:23 -0400 (Fri, 05 May 2006) | 3 lines
re-add a couple of lines that I shouldn't have removed in the previous commit.
I think I should be going to bed now ...
........
r25288 | bweschke | 2006-05-07 08:48:09 -0400 (Sun, 07 May 2006) | 3 lines
Reset the value of ast_mainpid if we fork so future remote unix connections display the correct PID. #7098 (tzafrir reporting)
........
r25322 | bweschke | 2006-05-07 09:38:11 -0400 (Sun, 07 May 2006) | 3 lines
Fix playback behavior to exit correctly when we receive a hangup during playback of the invalid pin message. #7091 (AntD reporting)
........
r25442 | file | 2006-05-08 07:16:10 -0400 (Mon, 08 May 2006) | 2 lines
Incorrect log statement when playing transfer sounds (issue #7008 reported and fixed by nathan)
........
r25518 | bweschke | 2006-05-08 09:11:32 -0400 (Mon, 08 May 2006) | 3 lines
Don't recheck valid_exit() after getting the result from say_position (which already checks it). Should prevent another loop if the caller hits digits during the position announcement. #6776 (tgj reporting)
........
r25520 | bweschke | 2006-05-08 09:15:30 -0400 (Mon, 08 May 2006) | 3 lines
Oops. :(
........
r25522 | bweschke | 2006-05-08 09:35:17 -0400 (Mon, 08 May 2006) | 3 lines
Make QueueStatusComplete event thread safe by wrapping it inside the queue lock clause already there. #7013 (bziherl reporting)
........
r25563 | bweschke | 2006-05-08 10:12:20 -0400 (Mon, 08 May 2006) | 3 lines
Don't show agents as available when they are in wrap-up time. #6726 (ZX81)
........
r25608 | oej | 2006-05-08 11:09:55 -0400 (Mon, 08 May 2006) | 5 lines
Issue 7103 - mikma
- The header is named "Require"
- Don't reply to ACK
(Not using patch against trunk)
........
r26050 | bweschke | 2006-05-09 09:28:39 -0400 (Tue, 09 May 2006) | 3 lines
Correct memory leak in find_user_realtime #7118 (fnordian)
........
r26090 | bweschke | 2006-05-09 10:18:45 -0400 (Tue, 09 May 2006) | 3 lines
Add the appropriate jumping behavior that is the standard for 1.2.X to SIPGetHeader that is now deprecated in /trunk. #7111 (blitzrage!!!)
........
r26760 | kpfleming | 2006-05-11 04:52:46 -0400 (Thu, 11 May 2006) | 2 lines
ensure that we send a response to REGISTER requests that are successfully authenticated but contain invalid Contact URIs
........
r26773 | kpfleming | 2006-05-11 05:05:22 -0400 (Thu, 11 May 2006) | 2 lines
backport fix from trunk for bug #6934, ensuring that RTP mark bit is changed when SSRC changes
........
r27051 | tilghman | 2006-05-11 19:02:57 -0400 (Thu, 11 May 2006) | 2 lines
Bug 7086 - pbx_checkcondition substitution, so that arbitrary strings are true (for regex)
........
r27093 | tilghman | 2006-05-13 00:08:29 -0400 (Sat, 13 May 2006) | 2 lines
Bug 7134 - File descriptor leak with ODBC storage of voicemail
........
r27468 | kpfleming | 2006-05-16 16:05:17 -0400 (Tue, 16 May 2006) | 2 lines
don't leak frames when deferring DTMF or dropping duplicate ANSWER frames (issue #7041, slightly different fix, reported/patched by clausf)
........
r27594 | file | 2006-05-16 19:31:56 -0400 (Tue, 16 May 2006) | 2 lines
Inherit channel variables during call forwards when going through chan_local (issue #7095 reported by raarts)
........
r27636 | tilghman | 2006-05-16 22:19:50 -0400 (Tue, 16 May 2006) | 2 lines
Bug 7125 - Fix race condition between resequencing and leaving a message
........
r27723 | oej | 2006-05-17 05:21:45 -0400 (Wed, 17 May 2006) | 2 lines
chan_sip did not use the TRANSFER_CONTEXT for transfers, like res_features. Now fixed.
........
r27767 | file | 2006-05-17 11:17:04 -0400 (Wed, 17 May 2006) | 2 lines
OSPNext does not handle success/failure correctly (issue #7147 reported and fixed by eborgstrom)
........
r27847 | file | 2006-05-17 13:07:52 -0400 (Wed, 17 May 2006) | 2 lines
Priority jumping not working on VoiceMail app with new syntax (issue #7164 reported and fixed by alvaro_palma_aste)
........
r27927 | oej | 2006-05-17 15:27:15 -0400 (Wed, 17 May 2006) | 4 lines
Issue #7176 - Crash in expire_register
(We need to find out what's causing peer to be undefined, so this
is just a bandaid, not a real fix)
........
r27973 | file | 2006-05-17 18:34:08 -0400 (Wed, 17 May 2006) | 2 lines
Fix codec priority stuff during authentication (issue #6194 reported by jkoopmann)
........
r28125 | oej | 2006-05-18 08:13:46 -0400 (Thu, 18 May 2006) | 2 lines
Video in meetme? Hmmm. Removed until we do have some code for it.
........
r28169 | file | 2006-05-18 10:27:21 -0400 (Thu, 18 May 2006) | 2 lines
Fix endless looping message by checking value of res before doing retries stuff. (issue #7140 reported by tanischen)
........
r28212 | file | 2006-05-18 12:31:16 -0400 (Thu, 18 May 2006) | 2 lines
Return -1 on error in ODBC messagecount and 0 on success (issue #7133 reported by cfieldmtm)
........
r28257 | tilghman | 2006-05-18 13:27:59 -0400 (Thu, 18 May 2006) | 2 lines
Bug 7167 - HasNewVoicemail and VMCOUNT() didn't work when USE_ODBC_STORAGE was defined
........
r28335 | kpfleming | 2006-05-18 15:16:40 -0400 (Thu, 18 May 2006) | 2 lines
support 'inactive' tag for SDP media streams (simple fix, proper fix will appear in 1.4 release) (issue #7130)
........
r28337 | kpfleming | 2006-05-18 15:35:55 -0400 (Thu, 18 May 2006) | 2 lines
use unsigned counters for handling answer/IE lengths while processing DNS results (issue #7174)
........
r28380 | kpfleming | 2006-05-18 16:24:07 -0400 (Thu, 18 May 2006) | 2 lines
handle incoming multipart/mixed message bodies in SIP and find the SDP, if presnet (issue #7124 reported and patched by eborgstrom, but very different fix)
........
r28384 | kpfleming | 2006-05-18 16:43:42 -0400 (Thu, 18 May 2006) | 2 lines
fix up a few more places to find the SDP properly (fallout from fix for #7124)
........
r28627 | file | 2006-05-19 11:38:59 -0400 (Fri, 19 May 2006) | 2 lines
Treat paused queue members as unreachable (issue #7127 reported by peterh)
........
r28630 | file | 2006-05-19 11:52:09 -0400 (Fri, 19 May 2006) | 2 lines
Backport of fix for issue #6654 that was fixed in trunk but not here
........
r28651 | file | 2006-05-19 12:03:33 -0400 (Fri, 19 May 2006) | 2 lines
When forwarding messages use the context that the active voicemail user was found in. (issue #7010)
........
r28698 | file | 2006-05-19 13:04:02 -0400 (Fri, 19 May 2006) | 2 lines
Make the minidle option actually exist as documented (issue #7159 reported by imran)
........
r28754 | russell | 2006-05-19 15:01:17 -0400 (Fri, 19 May 2006) | 6 lines
This explicit poll is only needed on mac. In fact, it breaks some systems
such as some versions of Fedora, causing 'asterisk -rx' to never exit. This
has been tested on systems showing the asterisk -rx problem, as well as other
unaffected versions of linux, mac osx 10.4, and FreeBSD 6.
(issue #7071)
........
r28790 | russell | 2006-05-19 15:18:41 -0400 (Fri, 19 May 2006) | 3 lines
fix the build of smsq with -Werror. I learned something new about format
strings from this patch! (issue #7141, Mithraen)
........
r28794 | kpfleming | 2006-05-19 15:39:55 -0400 (Fri, 19 May 2006) | 2 lines
use the specified 'subscribecontext' for a peer rather than the context found via the target domain (domain contexts are for calls, not for subscriptions) (issue #7122, reported by raarts)
........
r28896 | kpfleming | 2006-05-19 20:55:31 -0400 (Fri, 19 May 2006) | 2 lines
don't try to predict where the compiler will place things on the stack... put them in the right place explicitly (issues #7029 and #7100, maybe others)
........
r28966 | russell | 2006-05-19 22:31:30 -0400 (Fri, 19 May 2006) | 4 lines
fix a case where code made assumptions about how memory for variables is
allocatted on the stack - this patch is slightly different than the one
that went in for the trunk
........
r28968 | kpfleming | 2006-05-19 22:35:53 -0400 (Fri, 19 May 2006) | 2 lines
don't allow queue member devices to ring longer than the total queue timeout (issue #6423, reported and patched by bcnit)
........
r29052 | russell | 2006-05-20 15:50:41 -0400 (Sat, 20 May 2006) | 3 lines
fix the possibility of writing one byte past the end of a buffer.
(issue #7189, Mithraen)
........
r29196 | bweschke | 2006-05-21 11:16:59 -0400 (Sun, 21 May 2006) | 3 lines
When an application that is executed via applicationmap and exits non-zero, make sure that we pass through the correct return value from the application to make sure a segfault doesn't occur by a bridge trying to continue when it should not. Also, when executing applications via applicationmap, make sure that the application is executed against the channel whose DTMF caused it to be fired off in the first place. (part 1/2 of #7090 - this is the only fix that will be applied to both 1.2 and /trunk) acunningham and blitzrage on testing...
........
r29394 | tilghman | 2006-05-22 10:34:34 -0400 (Mon, 22 May 2006) | 2 lines
Bug 7196 - month range did not work
........
r29398 | tilghman | 2006-05-22 10:59:59 -0400 (Mon, 22 May 2006) | 2 lines
Bug 7194 - spelling fix
........
r29464 | file | 2006-05-22 12:33:03 -0400 (Mon, 22 May 2006) | 2 lines
Preserve presentation bit when going through chan_local (issue #7002 reported by acunningham)
........
r29512 | file | 2006-05-22 16:15:04 -0400 (Mon, 22 May 2006) | 2 lines
Use the correct language when playing the transfer sound (issue #7109 reported by casper)
........
r29555 | file | 2006-05-22 17:27:12 -0400 (Mon, 22 May 2006) | 2 lines
Increase the silence threshold to 128 to "fix" it, so I'm told. (issue #6595 reported by davetroy fixed by casper)
........
r29696 | bweschke | 2006-05-23 11:58:24 -0400 (Tue, 23 May 2006) | 3 lines
Fix a potential leak and correct (hopefully) a segfault under certain conditions. #6784 (vovan and perry testing)
........
r29732 | kpfleming | 2006-05-23 13:15:23 -0400 (Tue, 23 May 2006) | 2 lines
backport some mutex initialization and linked list handling fixes from trunk
........
r29733 | bweschke | 2006-05-23 13:17:02 -0400 (Tue, 23 May 2006) | 3 lines
Sanity check code for an extended failure in trying to obtain a channel lock that may have been obtained elsewhere. Prevents the monitor thread of the SIP module from going into an infinite loop, effectively, breaking SIP until you restart Asterisk or the mutex is unlocked, whichever comes first.
........
r29764 | kpfleming | 2006-05-23 14:16:40 -0400 (Tue, 23 May 2006) | 2 lines
simplify/fix lock retry, and fix comment
........
Modified:
team/oej/jitterbuffer-1.2/ (props changed)
team/oej/jitterbuffer-1.2/apps/app_dial.c
team/oej/jitterbuffer-1.2/apps/app_hasnewvoicemail.c
team/oej/jitterbuffer-1.2/apps/app_meetme.c
team/oej/jitterbuffer-1.2/apps/app_osplookup.c
team/oej/jitterbuffer-1.2/apps/app_queue.c
team/oej/jitterbuffer-1.2/apps/app_sms.c
team/oej/jitterbuffer-1.2/apps/app_sql_postgres.c
team/oej/jitterbuffer-1.2/apps/app_voicemail.c
team/oej/jitterbuffer-1.2/apps/app_waitforsilence.c
team/oej/jitterbuffer-1.2/asterisk.c
team/oej/jitterbuffer-1.2/channel.c
team/oej/jitterbuffer-1.2/channels/chan_agent.c
team/oej/jitterbuffer-1.2/channels/chan_iax2.c
team/oej/jitterbuffer-1.2/channels/chan_local.c
team/oej/jitterbuffer-1.2/channels/chan_sip.c
team/oej/jitterbuffer-1.2/channels/chan_zap.c
team/oej/jitterbuffer-1.2/dnsmgr.c
team/oej/jitterbuffer-1.2/doc/README.variables
team/oej/jitterbuffer-1.2/enum.c
team/oej/jitterbuffer-1.2/frame.c
team/oej/jitterbuffer-1.2/funcs/func_logic.c
team/oej/jitterbuffer-1.2/include/asterisk/linkedlists.h
team/oej/jitterbuffer-1.2/include/asterisk/lock.h
team/oej/jitterbuffer-1.2/pbx.c
team/oej/jitterbuffer-1.2/res/res_features.c
team/oej/jitterbuffer-1.2/rtp.c
team/oej/jitterbuffer-1.2/utils/smsq.c
Propchange: team/oej/jitterbuffer-1.2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue May 23 14:26:48 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-25139
+/branches/1.2:1-29799
Modified: team/oej/jitterbuffer-1.2/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer-1.2/apps/app_dial.c?rev=29800&r1=29799&r2=29800&view=diff
==============================================================================
--- team/oej/jitterbuffer-1.2/apps/app_dial.c (original)
+++ team/oej/jitterbuffer-1.2/apps/app_dial.c Tue May 23 14:26:48 2006
@@ -471,6 +471,8 @@
o->chan = ast_request(tech, in->nativeformats, stuff, &cause);
if (!o->chan)
ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
+ else
+ ast_channel_inherit_variables(in, o->chan);
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", o->chan->name);
@@ -1060,6 +1062,8 @@
tmp->chan = ast_request(tech, chan->nativeformats, stuff, &cause);
if (!tmp->chan)
ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
+ else
+ ast_channel_inherit_variables(chan, tmp->chan);
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", tmp->chan->name);
Modified: team/oej/jitterbuffer-1.2/apps/app_hasnewvoicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer-1.2/apps/app_hasnewvoicemail.c?rev=29800&r1=29799&r2=29800&view=diff
==============================================================================
--- team/oej/jitterbuffer-1.2/apps/app_hasnewvoicemail.c (original)
+++ team/oej/jitterbuffer-1.2/apps/app_hasnewvoicemail.c Tue May 23 14:26:48 2006
@@ -47,6 +47,12 @@
#include "asterisk/utils.h"
#include "asterisk/app.h"
#include "asterisk/options.h"
+#ifdef USE_ODBC_STORAGE
+#include "asterisk/res_odbc.h"
+
+static char odbc_database[80];
+static char odbc_table[80];
+#endif
static char *tdesc = "Indicator for whether a voice mailbox has messages in a given folder.";
static char *app_hasvoicemail = "HasVoicemail";
@@ -77,25 +83,93 @@
LOCAL_USER_DECL;
-static int hasvoicemail_internal(char *context, char *box, char *folder)
-{
- char vmpath[256];
- DIR *vmdir;
- struct dirent *vment;
- int count=0;
-
- snprintf(vmpath,sizeof(vmpath), "%s/voicemail/%s/%s/%s", (char *)ast_config_AST_SPOOL_DIR, context, box, folder);
- if ((vmdir = opendir(vmpath))) {
- /* No matter what the format of VM, there will always be a .txt file for each message. */
- while ((vment = readdir(vmdir))) {
- if (!strncmp(vment->d_name + 7, ".txt", 4)) {
- count++;
- }
- }
- closedir(vmdir);
- }
+#ifdef USE_ODBC_STORAGE
+static int hasvoicemail_internal(const char *context, const char *mailbox, const char *folder)
+{
+ int nummsgs = 0;
+ int res;
+ SQLHSTMT stmt;
+ char sql[256];
+ char rowdata[20];
+
+ if (!folder)
+ folder = "INBOX";
+ /* If no mailbox, return immediately */
+ if (ast_strlen_zero(mailbox))
+ return 0;
+ if (ast_strlen_zero(context))
+ context = "default";
+
+ odbc_obj *obj;
+ obj = fetch_odbc_obj(odbc_database, 0);
+ if (obj) {
+ res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
+ goto yuck;
+ }
+ snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s/voicemail/%s/%s/%s'", odbc_table, ast_config_AST_SPOOL_DIR, context, mailbox, folder);
+ res = SQLPrepare(stmt, sql, SQL_NTS);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ goto yuck;
+ }
+ res = odbc_smart_execute(obj, stmt);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ goto yuck;
+ }
+ res = SQLFetch(stmt);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Fetch error!\n[%s]\n\n", sql);
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ goto yuck;
+ }
+ res = SQLGetData(stmt, 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ goto yuck;
+ }
+ nummsgs = atoi(rowdata);
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ } else
+ ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
+
+yuck:
+ return nummsgs;
+}
+
+#else
+
+static int hasvoicemail_internal(const char *context, const char *mailbox, const char *folder)
+{
+ DIR *dir;
+ struct dirent *de;
+ char fn[256];
+ int count = 0;
+
+ if (ast_strlen_zero(folder))
+ folder = "INBOX";
+ if (ast_strlen_zero(context))
+ context = "default";
+ /* If no mailbox, return immediately */
+ if (ast_strlen_zero(mailbox))
+ return 0;
+ snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/%s", ast_config_AST_SPOOL_DIR, context, mailbox, folder);
+ dir = opendir(fn);
+ if (!dir)
+ return 0;
+ while ((de = readdir(dir))) {
+ if (!strncasecmp(de->d_name, "msg", 3) && !strcasecmp(de->d_name + 8, "txt"))
+ count++;
+ }
+ closedir(dir);
return count;
}
+#endif
static int hasvoicemail_exec(struct ast_channel *chan, void *data)
{
@@ -222,6 +296,31 @@
.read = acf_vmcount_exec,
};
+static int load_config(void)
+{
+#ifdef USE_ODBC_STORAGE
+ struct ast_config *cfg;
+ char *tmp;
+ cfg = ast_config_load("voicemail.conf");
+ if (cfg) {
+ if (! (tmp = ast_variable_retrieve(cfg, "general", "odbcstorage")))
+ tmp = "asterisk";
+ ast_copy_string(odbc_database, tmp, sizeof(odbc_database));
+
+ if (! (tmp = ast_variable_retrieve(cfg, "general", "odbctable")))
+ tmp = "voicemessages";
+ ast_copy_string(odbc_table, tmp, sizeof(odbc_table));
+ ast_config_destroy(cfg);
+ }
+#endif
+ return 0;
+}
+
+int reload(void)
+{
+ return load_config();
+}
+
int unload_module(void)
{
int res;
@@ -238,7 +337,7 @@
int load_module(void)
{
int res;
-
+ load_config();
res = ast_custom_function_register(&acf_vmcount);
res |= ast_register_application(app_hasvoicemail, hasvoicemail_exec, hasvoicemail_synopsis, hasvoicemail_descrip);
res |= ast_register_application(app_hasnewvoicemail, hasvoicemail_exec, hasnewvoicemail_synopsis, hasnewvoicemail_descrip);
Modified: team/oej/jitterbuffer-1.2/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer-1.2/apps/app_meetme.c?rev=29800&r1=29799&r2=29800&view=diff
==============================================================================
--- team/oej/jitterbuffer-1.2/apps/app_meetme.c (original)
+++ team/oej/jitterbuffer-1.2/apps/app_meetme.c Tue May 23 14:26:48 2006
@@ -96,7 +96,6 @@
" 's' -- Present menu (user or admin) when '*' is received ('send' to menu)\n"
" 't' -- set talk only mode. (Talk only, no listening)\n"
" 'T' -- set talker detection (sent to manager interface and meetme list)\n"
-" 'v' -- video mode\n"
" 'w' -- wait until the marked user enters the conference\n"
" 'x' -- close the conference when last marked user exits\n"
" 'X' -- allow user to exit the conference by entering a valid single\n"
@@ -212,7 +211,7 @@
#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_VIDEO (1 << 7) /* Set to enable video mode */
+#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 */
@@ -227,7 +226,6 @@
#define CONFFLAG_EMPTY (1 << 19)
#define CONFFLAG_EMPTYNOPIN (1 << 20)
#define CONFFLAG_ALWAYSPROMPT (1 << 21)
-#define CONFFLAG_ANNOUNCEUSERCOUNT (1 << 22) /* If set, when user joins the conference, they will be told the number of users that are already in */
AST_APP_OPTIONS(meetme_opts, {
@@ -629,7 +627,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));
ast_cli(fd,"%d users in that conference.\n",cnf->users);
@@ -1965,9 +1963,12 @@
break;
} else {
/* Pin invalid */
- res = ast_streamfile(chan, "conf-invalidpin", chan->language);
- if (!res)
- ast_waitstream(chan, AST_DIGIT_ANY);
+ if (!ast_streamfile(chan, "conf-invalidpin", chan->language))
+ res = ast_waitstream(chan, AST_DIGIT_ANY);
+ else {
+ ast_log(LOG_WARNING, "Couldn't play invalid pin msg!\n");
+ break;
+ }
if (res < 0)
break;
pin[0] = res;
Modified: team/oej/jitterbuffer-1.2/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer-1.2/apps/app_osplookup.c?rev=29800&r1=29799&r2=29800&view=diff
==============================================================================
--- team/oej/jitterbuffer-1.2/apps/app_osplookup.c (original)
+++ team/oej/jitterbuffer-1.2/apps/app_osplookup.c Tue May 23 14:26:48 2006
@@ -216,31 +216,33 @@
cause = str2cause(args.cause);
temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
result.handle = -1;
- if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
- temp = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
- if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.numresults) != 1)) {
- result.numresults = 0;
- }
- if ((res = ast_osp_next(&result, cause)) > 0) {
- char tmp[80];
- snprintf(tmp, sizeof(tmp), "%d", result.handle);
- pbx_builtin_setvar_helper(chan, "_OSPHANDLE", tmp);
- pbx_builtin_setvar_helper(chan, "_OSPTECH", result.tech);
- pbx_builtin_setvar_helper(chan, "_OSPDEST", result.dest);
- pbx_builtin_setvar_helper(chan, "_OSPTOKEN", result.token);
- snprintf(tmp, sizeof(tmp), "%d", result.numresults);
- pbx_builtin_setvar_helper(chan, "_OSPRESULTS", tmp);
- pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "SUCCESS");
- }
+ if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.handle) != 1)) {
+ result.handle = -1;
+ }
+ temp = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
+ if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.numresults) != 1)) {
+ result.numresults = 0;
+ }
+ if ((res = ast_osp_next(&result, cause)) > 0) {
+ char tmp[80];
+ snprintf(tmp, sizeof(tmp), "%d", result.handle);
+ pbx_builtin_setvar_helper(chan, "_OSPHANDLE", tmp);
+ pbx_builtin_setvar_helper(chan, "_OSPTECH", result.tech);
+ pbx_builtin_setvar_helper(chan, "_OSPDEST", result.dest);
+ pbx_builtin_setvar_helper(chan, "_OSPTOKEN", result.token);
+ snprintf(tmp, sizeof(tmp), "%d", result.numresults);
+ pbx_builtin_setvar_helper(chan, "_OSPRESULTS", tmp);
+ pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "SUCCESS");
} else {
if (!res) {
if (result.handle < 0)
ast_log(LOG_NOTICE, "OSP Lookup Next failed for handle '%d'\n", result.handle);
else
ast_log(LOG_DEBUG, "No OSP handle specified\n");
- pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "FAILED");
} else
ast_log(LOG_DEBUG, "Got hangup on '%s' while doing OSP Next!\n", chan->name);
+
+ pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "FAILED");
}
if (!res) {
/* Look for a "busy" place */
Modified: team/oej/jitterbuffer-1.2/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer-1.2/apps/app_queue.c?rev=29800&r1=29799&r2=29800&view=diff
==============================================================================
--- team/oej/jitterbuffer-1.2/apps/app_queue.c (original)
+++ team/oej/jitterbuffer-1.2/apps/app_queue.c Tue May 23 14:26:48 2006
@@ -431,6 +431,8 @@
enum queue_member_status result = QUEUE_NO_MEMBERS;
for (member = q->members; member; member = member->next) {
+ if (member->paused) continue;
+
switch (member->status) {
case AST_DEVICE_INVALID:
/* nothing to do */
@@ -1184,7 +1186,9 @@
/* Set our last_pos indicators */
qe->last_pos = now;
qe->last_pos_said = qe->pos;
- ast_moh_start(qe->chan, qe->moh);
+ /* Don't restart music on hold if we're about to exit the caller from the queue */
+ if (res)
+ ast_moh_start(qe->chan, qe->moh);
return res;
}
@@ -2121,10 +2125,10 @@
cur = cur->next;
}
- if (qe->parent->timeout)
- to = qe->parent->timeout * 1000;
- else
- to = -1;
+ if (qe->expire && (!qe->parent->timeout || (qe->expire - now) <= qe->parent->timeout))
+ to = (qe->expire - now) * 1000;
+ else
+ to = (qe->parent->timeout) ? qe->parent->timeout * 1000 : -1;
ring_one(qe, outgoing, &numbusies);
ast_mutex_unlock(&qe->parent->lock);
if (use_weight)
@@ -2989,7 +2993,7 @@
/* Make a position announcement, if enabled */
if (qe.parent->announcefrequency && !ringing)
res = say_position(&qe);
- if (res && valid_exit(&qe, res)) {
+ if (res) {
ast_queue_log(queuename, chan->uniqueid, "NONE", "EXITWITHKEY", "%s|%d", qe.digits, qe.pos);
break;
}
@@ -3523,13 +3527,13 @@
}
ast_mutex_unlock(&q->lock);
}
- ast_mutex_unlock(&qlock);
ast_cli(s->fd,
"Event: QueueStatusComplete\r\n"
"%s"
"\r\n",idText);
+ ast_mutex_unlock(&qlock);
return RESULT_SUCCESS;
}
Modified: team/oej/jitterbuffer-1.2/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer-1.2/apps/app_sms.c?rev=29800&r1=29799&r2=29800&view=diff
==============================================================================
--- team/oej/jitterbuffer-1.2/apps/app_sms.c (original)
+++ team/oej/jitterbuffer-1.2/apps/app_sms.c Tue May 23 14:26:48 2006
@@ -1178,25 +1178,24 @@
static int sms_generate (struct ast_channel *chan, void *data, int len, int samples)
{
struct ast_frame f = { 0 };
- unsigned char waste[AST_FRIENDLY_OFFSET];
+#define MAXSAMPLES 800
#ifdef OUTALAW
- unsigned char buf[800];
+ unsigned char *buf;
#else
- signed short buf[800];
+ short *buf;
#endif
+#define SAMPLE2LEN sizeof(*buf)
sms_t *h = data;
int i;
- if (len > sizeof (buf)) {
- ast_log (LOG_WARNING, "Only doing %d bytes (%d bytes requested)\n", (int)(sizeof (buf) / sizeof (signed short)), len);
- len = sizeof (buf);
-#ifdef OUTALAW
- samples = len;
-#else
- samples = len / 2;
-#endif
- }
- waste[0] = 0; /* make compiler happy */
+ if (samples > MAXSAMPLES) {
+ ast_log (LOG_WARNING, "Only doing %d samples (%d requested)\n",
+ MAXSAMPLES, samples);
+ samples = MAXSAMPLES;
+ }
+ len = samples * SAMPLE2LEN + AST_FRIENDLY_OFFSET;
+ buf = alloca(len);
+
f.frametype = AST_FRAME_VOICE;
#ifdef OUTALAW
f.subclass = AST_FORMAT_ALAW;
@@ -1206,8 +1205,7 @@
f.datalen = samples * 2;
#endif
f.offset = AST_FRIENDLY_OFFSET;
- f.mallocd = 0;
- f.data = buf;
+ f.data = buf + AST_FRIENDLY_OFFSET;
f.samples = samples;
f.src = "app_sms";
/* create a buffer containing the digital sms pattern */
Modified: team/oej/jitterbuffer-1.2/apps/app_sql_postgres.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer-1.2/apps/app_sql_postgres.c?rev=29800&r1=29799&r2=29800&view=diff
==============================================================================
--- team/oej/jitterbuffer-1.2/apps/app_sql_postgres.c (original)
+++ team/oej/jitterbuffer-1.2/apps/app_sql_postgres.c Tue May 23 14:26:48 2006
@@ -132,7 +132,7 @@
AST_LIST_ENTRY(ast_PGSQL_id) entries;
} *ast_PGSQL_id;
-AST_LIST_HEAD(PGSQLidshead,ast_PGSQL_id) PGSQLidshead;
+static AST_LIST_HEAD_STATIC(PGSQLidshead,ast_PGSQL_id);
static void *find_identifier(int identifier,int identifier_type) {
struct PGSQLidshead *headp;
@@ -551,11 +551,6 @@
int load_module(void)
{
- struct PGSQLidshead *headp;
-
- headp=&PGSQLidshead;
-
- AST_LIST_HEAD_INIT(headp);
return ast_register_application(app, PGSQL_exec, synopsis, descrip);
}
Modified: team/oej/jitterbuffer-1.2/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/jitterbuffer-1.2/apps/app_voicemail.c?rev=29800&r1=29799&r2=29800&view=diff
==============================================================================
--- team/oej/jitterbuffer-1.2/apps/app_voicemail.c (original)
+++ team/oej/jitterbuffer-1.2/apps/app_voicemail.c Tue May 23 14:26:48 2006
@@ -562,6 +562,7 @@
apply_option(retval, tmp->name, tmp->value);
tmp = tmp->next;
}
+ ast_variables_destroy(var);
} else {
if (!ivm)
free(retval);
@@ -897,7 +898,7 @@
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
goto yuck;
}
- fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC);
+ fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC, 0770);
if (fd < 0) {
ast_log(LOG_WARNING, "Failed to write '%s': %s\n", full_fn, strerror(errno));
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
@@ -924,13 +925,13 @@
if (!strcasecmp(coltitle, "recording")) {
res = SQLGetData(stmt, x + 1, SQL_BINARY, NULL, 0, &colsize);
fdlen = colsize;
- fd = open(full_fn, O_RDWR | O_TRUNC | O_CREAT, 0770);
if (fd > -1) {
char tmp[1]="";
lseek(fd, fdlen - 1, SEEK_SET);
if (write(fd, tmp, 1) != 1) {
close(fd);
fd = -1;
+ continue;
}
if (fd > -1)
fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
@@ -2005,7 +2006,7 @@
#ifdef USE_ODBC_STORAGE
static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
{
- int x = 0;
+ int x = -1;
int res;
SQLHSTMT stmt;
char sql[256];
@@ -2017,6 +2018,7 @@
*newmsgs = 0;
if (oldmsgs)
*oldmsgs = 0;
+
/* If no mailbox, return immediately */
if (ast_strlen_zero(mailbox))
return 0;
@@ -2098,7 +2100,7 @@
}
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
*oldmsgs = atoi(rowdata);
- x = 1;
+ x = 0;
} else
ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
@@ -2363,17 +2365,17 @@
static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options)
{
- char tmptxtfile[256], txtfile[256];
+ char txtfile[256], tmptxtfile[256];
char callerid[256];
FILE *txt;
- int res = 0;
+ int res = 0, txtdes;
int msgnum;
int duration = 0;
int ausemacro = 0;
int ousemacro = 0;
int ouseexten = 0;
char date[256];
- char dir[256];
+ char dir[256], tmpdir[260];
char fn[256];
char prefile[256]="";
char tempfile[256]="";
@@ -2428,6 +2430,7 @@
DISPOSE(tempfile, -1);
/* It's easier just to try to make it than to check for its existence */
create_dirpath(dir, sizeof(dir), vmu->context, ext, "INBOX");
+ create_dirpath(tmpdir, sizeof(tmpdir), vmu->context, ext, "tmp");
/* Check current or macro-calling context for special extensions */
if (ast_test_flag(vmu, VM_OPERATOR)) {
@@ -2534,22 +2537,25 @@
if (!ast_strlen_zero(fmt)) {
msgnum = 0;
- if (vm_lock_path(dir)) {
- free_user(vmu);
- return ERROR_LOCK_PATH;
- }
-
- /*
- * This operation can be very expensive if done say over NFS or if the mailbox has 100+ messages
- * in the mailbox. So we should get this first so we don't cut off the first few seconds of the
- * message.
- */
- do {
- make_file(fn, sizeof(fn), dir, msgnum);
- if (!EXISTS(dir,msgnum,fn,chan->language))
- break;
- msgnum++;
- } while (msgnum < vmu->maxmsg);
+ if (count_messages(vmu, dir) >= vmu->maxmsg) {
+ res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
+ if (!res)
+ res = ast_waitstream(chan, "");
+ ast_log(LOG_WARNING, "No more messages possible\n");
+ pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
+ goto leave_vm_out;
+ }
+
+ snprintf(tmptxtfile, sizeof(tmptxtfile), "%s/XXXXXX", tmpdir);
+ txtdes = mkstemp(tmptxtfile);
+ if (txtdes < 0) {
+ res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
+ if (!res)
+ res = ast_waitstream(chan, "");
+ ast_log(LOG_ERROR, "Unable to create message file: %s\n", strerror(errno));
+ pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
+ goto leave_vm_out;
+ }
/* Now play the beep once we have the message number for our next message. */
if (res >= 0) {
@@ -2558,101 +2564,104 @@
if (!res)
res = ast_waitstream(chan, "");
}
- if (msgnum < vmu->maxmsg) {
- /* assign a variable with the name of the voicemail file */
- pbx_builtin_setvar_helper(chan, "VM_MESSAGEFILE", fn);
-
- /* Store information */
- snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);
- snprintf(tmptxtfile, sizeof(tmptxtfile), "%s.txt.tmp", fn);
- txt = fopen(tmptxtfile, "w+");
- if (txt) {
- get_date(date, sizeof(date));
- fprintf(txt,
- ";\n"
- "; Message Information file\n"
- ";\n"
- "[message]\n"
- "origmailbox=%s\n"
- "context=%s\n"
- "macrocontext=%s\n"
- "exten=%s\n"
- "priority=%d\n"
- "callerchan=%s\n"
- "callerid=%s\n"
- "origdate=%s\n"
- "origtime=%ld\n"
- "category=%s\n",
- ext,
- chan->context,
- chan->macrocontext,
- chan->exten,
- chan->priority,
- chan->name,
- ast_callerid_merge(callerid, sizeof(callerid), chan->cid.cid_name, chan->cid.cid_num, "Unknown"),
- date, (long)time(NULL),
- category ? category : "");
- } else
- ast_log(LOG_WARNING, "Error opening text file for output\n");
- res = play_record_review(chan, NULL, fn, vmmaxmessage, fmt, 1, vmu, &duration, dir, options->record_gain);
- if (res == '0') {
- if (txt && EXISTS(dir,msgnum,fn,chan->language)) {
- fclose(txt);
- rename(tmptxtfile, txtfile);
- } else if (txt && !EXISTS(dir,msgnum,fn,chan->language)) {
- if (option_debug)
- ast_log(LOG_DEBUG, "The recorded media file is gone, so we should remove the .txt file too!\n");
- fclose(txt);
- unlink(tmptxtfile);
- }
- goto transfer;
- }
- if (res > 0)
- res = 0;
- if (txt) {
- fprintf(txt, "duration=%d\n", duration);
- fclose(txt);
- rename(tmptxtfile, txtfile);
- }
-
+
+ /* Store information */
+ txt = fdopen(txtdes, "w+");
+ if (txt) {
+ get_date(date, sizeof(date));
+ fprintf(txt,
+ ";\n"
+ "; Message Information file\n"
+ ";\n"
+ "[message]\n"
+ "origmailbox=%s\n"
+ "context=%s\n"
+ "macrocontext=%s\n"
+ "exten=%s\n"
+ "priority=%d\n"
+ "callerchan=%s\n"
+ "callerid=%s\n"
+ "origdate=%s\n"
+ "origtime=%ld\n"
+ "category=%s\n",
+ ext,
+ chan->context,
+ chan->macrocontext,
+ chan->exten,
+ chan->priority,
+ chan->name,
+ ast_callerid_merge(callerid, sizeof(callerid), chan->cid.cid_name, chan->cid.cid_num, "Unknown"),
+ date, (long)time(NULL),
+ category ? category : "");
+ } else
+ ast_log(LOG_WARNING, "Error opening text file for output\n");
+ res = play_record_review(chan, NULL, tmptxtfile, vmmaxmessage, fmt, 1, vmu, &duration, NULL, options->record_gain);
+
+ if (txt) {
if (duration < vmminmessage) {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Recording was %d seconds long but needs to be at least %d - abandoning\n", duration, vmminmessage);
DELETE(dir,msgnum,fn);
- /* XXX We should really give a prompt too short/option start again, with leave_vm_out called only after a timeout XXX */
- pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
- goto leave_vm_out;
- }
- /* Are there to be more recipients of this message? */
- while (tmpptr) {
- struct ast_vm_user recipu, *recip;
- char *exten, *context;
-
- exten = strsep(&tmpptr, "&");
- context = strchr(exten, '@');
- if (context) {
- *context = '\0';
- context++;
+ } else {
+ fprintf(txt, "duration=%d\n", duration);
+ fclose(txt);
+ if (vm_lock_path(dir)) {
+ ast_log(LOG_ERROR, "Couldn't lock directory %s. Voicemail will be lost.\n", dir);
+ /* Delete files */
+ ast_filedelete(tmptxtfile, NULL);
+ unlink(tmptxtfile);
+ } else {
+ for (;;) {
+ make_file(fn, sizeof(fn), dir, msgnum);
+ if (!EXISTS(dir, msgnum, fn, NULL))
+ break;
+ msgnum++;
+ }
+
+ /* assign a variable with the name of the voicemail file */
+ pbx_builtin_setvar_helper(chan, "VM_MESSAGEFILE", fn);
+
+ snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);
+ ast_filerename(tmptxtfile, fn, NULL);
+ rename(tmptxtfile, txtfile);
+
+ ast_unlock_path(dir);
+
+ /* Are there to be more recipients of this message? */
+ while (tmpptr) {
+ struct ast_vm_user recipu, *recip;
+ char *exten, *context;
+
+ exten = strsep(&tmpptr, "&");
+ context = strchr(exten, '@');
+ if (context) {
+ *context = '\0';
+ context++;
+ }
+ if ((recip = find_user(&recipu, context, exten))) {
+ copy_message(chan, vmu, 0, msgnum, duration, recip, fmt);
+ free_user(recip);
+ }
+ }
+ if (ast_fileexists(fn, NULL, NULL)) {
+ STORE(dir, vmu->mailbox, vmu->context, msgnum);
+ notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name);
+ DISPOSE(dir, msgnum);
+ }
}
- if ((recip = find_user(&recipu, context, exten))) {
- copy_message(chan, vmu, 0, msgnum, duration, recip, fmt);
- free_user(recip);
- }
- }
- if (ast_fileexists(fn, NULL, NULL)) {
- STORE(dir, vmu->mailbox, vmu->context, msgnum);
- notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name);
- DISPOSE(dir, msgnum);
- }
+ }
+ }
+
+ if (res == '0') {
+ goto transfer;
+ } else if (res > 0)
+ res = 0;
+
+ if (duration < vmminmessage)
+ /* XXX We should really give a prompt too short/option start again, with leave_vm_out called only after a timeout XXX */
+ pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
+ else
pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS");
- } else {
- ast_unlock_path(dir);
- res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
- if (!res)
- res = ast_waitstream(chan, "");
- ast_log(LOG_WARNING, "No more messages possible\n");
- pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
- }
} else
ast_log(LOG_WARNING, "No format for saving voicemail?\n");
leave_vm_out:
@@ -5301,7 +5310,7 @@
case '5': /* Leave VoiceMail */
if (ast_test_flag(vmu, VM_SVMAIL)) {
[... 2851 lines stripped ...]
More information about the asterisk-commits
mailing list