[svn-commits] russell: branch group/vldtmf_fixup r51259 - in
/team/group/vldtmf_fixup: ./ a...
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Thu Jan 18 14:24:28 MST 2007
Author: russell
Date: Thu Jan 18 15:24:27 2007
New Revision: 51259
URL: http://svn.digium.com/view/asterisk?view=rev&rev=51259
Log:
Merged revisions 51211,51213,51233,51236,51241,51243,51245,51251,51256 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r51211 | file | 2007-01-17 18:18:44 -0600 (Wed, 17 Jan 2007) | 2 lines
Pass data as well for hold/unhold/vidupdate frames. (issue #8840 reported by mdu113)
................
r51213 | file | 2007-01-17 18:48:55 -0600 (Wed, 17 Jan 2007) | 2 lines
Build the IMAP remote directory string better and properly. Fix an issue with encoding the GSM voicemail when attaching to the voicemail. (issue #8808 reported by akohlsmith)
................
r51233 | russell | 2007-01-18 11:18:43 -0600 (Thu, 18 Jan 2007) | 3 lines
Make the "hasmanager" option in users.conf actually have an effect.
(issue #8740, LnxPrgr3)
................
r51236 | tilghman | 2007-01-18 11:49:41 -0600 (Thu, 18 Jan 2007) | 10 lines
Merged revisions 51235 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r51235 | tilghman | 2007-01-18 11:42:17 -0600 (Thu, 18 Jan 2007) | 2 lines
Document all the fields, including the indication that "uniqueid" should not be renamed.
........
................
r51241 | qwell | 2007-01-18 12:28:29 -0600 (Thu, 18 Jan 2007) | 2 lines
Fix an issue with deprecated commands
................
r51243 | file | 2007-01-18 12:36:35 -0600 (Thu, 18 Jan 2007) | 2 lines
Copy MOH settings when calling a peer so that if they put someone on hold or get put on hold themselves they get the right music class. (issue #8840 reported by mdu113)
................
r51245 | qwell | 2007-01-18 12:42:00 -0600 (Thu, 18 Jan 2007) | 4 lines
Fix an issue with file name completion in "module load" and "load".
Issue 8846
................
r51251 | file | 2007-01-18 13:17:34 -0600 (Thu, 18 Jan 2007) | 2 lines
Only start timeout once we reach the end of the files to play back.
................
r51256 | tilghman | 2007-01-18 15:14:24 -0600 (Thu, 18 Jan 2007) | 10 lines
Merged revisions 51255 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r51255 | tilghman | 2007-01-18 15:11:34 -0600 (Thu, 18 Jan 2007) | 2 lines
If a timezone is not specified, assume localtime (instead of gmtime) (Issue #7748)
........
................
Modified:
team/group/vldtmf_fixup/ (props changed)
team/group/vldtmf_fixup/apps/app_speech_utils.c
team/group/vldtmf_fixup/apps/app_voicemail.c
team/group/vldtmf_fixup/channels/chan_sip.c
team/group/vldtmf_fixup/contrib/scripts/vmdb.sql
team/group/vldtmf_fixup/main/channel.c
team/group/vldtmf_fixup/main/cli.c
team/group/vldtmf_fixup/main/manager.c
team/group/vldtmf_fixup/main/rtp.c
team/group/vldtmf_fixup/main/stdtime/localtime.c
Propchange: team/group/vldtmf_fixup/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/group/vldtmf_fixup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 18 15:24:27 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-51207
+/branches/1.4:1-51258
Modified: team/group/vldtmf_fixup/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf_fixup/apps/app_speech_utils.c?view=diff&rev=51259&r1=51258&r2=51259
==============================================================================
--- team/group/vldtmf_fixup/apps/app_speech_utils.c (original)
+++ team/group/vldtmf_fixup/apps/app_speech_utils.c Thu Jan 18 15:24:27 2007
@@ -609,7 +609,7 @@
/* If audio playback has stopped do a check for timeout purposes */
if (chan->streamid == -1 && chan->timingfunc == NULL)
ast_stopstream(chan);
- if (chan->stream == NULL && timeout > 0 && started == 0) {
+ if (chan->stream == NULL && timeout > 0 && started == 0 && !filename_tmp) {
time(&start);
started = 1;
}
Modified: team/group/vldtmf_fixup/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf_fixup/apps/app_voicemail.c?view=diff&rev=51259&r1=51258&r2=51259
==============================================================================
--- team/group/vldtmf_fixup/apps/app_voicemail.c (original)
+++ team/group/vldtmf_fixup/apps/app_voicemail.c Thu Jan 18 15:24:27 2007
@@ -1971,7 +1971,7 @@
snprintf(fname, sizeof(fname), "%s.%s", attach, format);
base_encode(fname, p);
/* only attach if necessary */
- if (imap && strcmp(format, "gsm")) {
+ if (imap && !strcmp(format, "gsm")) {
fprintf(p, "--%s\r\n", bound);
fprintf(p, "Content-Type: audio/x-gsm; name=\"msg%04d.%s\"\r\n", msgnum, format);
fprintf(p, "Content-Transfer-Encoding: base64\r\n");
@@ -4569,8 +4569,9 @@
#ifdef IMAP_STORAGE
static void imap_mailbox_name(char *spec, struct vm_state *vms, int box, int use_folder)
{
- char tmp[256];
-
+ char tmp[256], *t = tmp;
+ size_t left = sizeof(tmp);
+
if (box == 1) {
ast_copy_string(vms->curbox, mbox(0), sizeof(vms->curbox));
sprintf(vms->vmbox, "vm-%s", mbox(1));
@@ -4579,11 +4580,20 @@
snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox);
}
- if (strlen(authuser) > 0) {
- snprintf(tmp, sizeof(tmp), "{%s:%s/imap/authuser=%s/%s/user=%s}",imapserver,imapport,authuser,imapflags,vms->imapuser);
- } else {
- snprintf(tmp, sizeof(tmp), "{%s:%s/imap/%s/user=%s}",imapserver,imapport,imapflags,vms->imapuser);
- }
+ /* Build up server information */
+ ast_build_string(&t, &left, "{%s:%s/imap", imapserver, imapport);
+
+ /* Add authentication user if present */
+ if (!ast_strlen_zero(authuser))
+ ast_build_string(&t, &left, "/%s", authuser);
+
+ /* Add flags if present */
+ if (!ast_strlen_zero(imapflags))
+ ast_build_string(&t, &left, "/%s", imapflags);
+
+ /* End with username */
+ ast_build_string(&t, &left, "/user=%s}", vms->imapuser);
+
if(box == 0 || box == 1)
sprintf(spec, "%s%s", tmp, use_folder? imapfolder: "INBOX");
else
Modified: team/group/vldtmf_fixup/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf_fixup/channels/chan_sip.c?view=diff&rev=51259&r1=51258&r2=51259
==============================================================================
--- team/group/vldtmf_fixup/channels/chan_sip.c (original)
+++ team/group/vldtmf_fixup/channels/chan_sip.c Thu Jan 18 15:24:27 2007
@@ -2650,6 +2650,8 @@
ast_string_field_set(dialog, username, peer->username);
ast_string_field_set(dialog, peersecret, peer->secret);
ast_string_field_set(dialog, peermd5secret, peer->md5secret);
+ ast_string_field_set(dialog, mohsuggest, peer->mohsuggest);
+ ast_string_field_set(dialog, mohinterpret, peer->mohinterpret);
ast_string_field_set(dialog, tohost, peer->tohost);
ast_string_field_set(dialog, fullcontact, peer->fullcontact);
if (!dialog->initreq.headers && !ast_strlen_zero(peer->fromdomain)) {
Modified: team/group/vldtmf_fixup/contrib/scripts/vmdb.sql
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf_fixup/contrib/scripts/vmdb.sql?view=diff&rev=51259&r1=51258&r2=51259
==============================================================================
--- team/group/vldtmf_fixup/contrib/scripts/vmdb.sql (original)
+++ team/group/vldtmf_fixup/contrib/scripts/vmdb.sql Thu Jan 18 15:24:27 2007
@@ -1,13 +1,64 @@
-drop table if exists users;
-create table users (
-context VARCHAR(80) NOT NULL,
-mailbox VARCHAR(80) NOT NULL,
-password VARCHAR(80) NOT NULL DEFAULT '',
-fullname VARCHAR(80) NOT NULL DEFAULT '',
-email VARCHAR(80) NOT NULL DEFAULT '',
-pager VARCHAR(80) NOT NULL DEFAULT '',
-options VARCHAR(160) NOT NULL DEFAULT '',
-imapuser VARCHAR(80) DEFAULT NULL,
-imappassword VARCHAR(80) DEFAULT NULL,
-PRIMARY KEY (context, mailbox)
+DROP TABLE IF EXISTS voicemail;
+CREATE TABLE voicemail (
+ -- All of these column names are very specific, including "uniqueid". Do not change them if you wish voicemail to work.
+ uniqueid INT(5) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ -- Mailbox context.
+ context CHAR(80) NOT NULL DEFAULT 'default',
+ -- Mailbox number. Should be numeric.
+ mailbox CHAR(80) NOT NULL,
+ -- Must be numeric. Negative if you don't want it to be changed from VoicemailMain
+ password CHAR(80) NOT NULL,
+ -- Used in email and for Directory app
+ fullname CHAR(80),
+ -- Email address (will get sound file if attach=yes)
+ email CHAR(80),
+ -- Email address (won't get sound file)
+ pager CHAR(80),
+ -- Attach sound file to email - YES/no
+ attach CHAR(3),
+ -- Which sound format to attach
+ attachfmt CHAR(10),
+ -- Send email from this address
+ serveremail CHAR(80),
+ -- Prompts in alternative language
+ language CHAR(20),
+ -- Alternative timezone, as defined in voicemail.conf
+ tz CHAR(30),
+ -- Delete voicemail from server after sending email notification - yes/NO
+ deletevoicemail CHAR(3),
+ -- Read back CallerID information during playback - yes/NO
+ saycid CHAR(3),
+ -- Allow user to send voicemail from within VoicemailMain - YES/no
+ sendvoicemail CHAR(3),
+ -- Listen to voicemail and approve before sending - yes/NO
+ review CHAR(3),
+ -- Warn user a temporary greeting exists - yes/NO
+ tempgreetwarn CHAR(3),
+ -- Allow '0' to jump out during greeting - yes/NO
+ operator CHAR(3),
+ -- Hear date/time of message within VoicemailMain - YES/no
+ envelope CHAR(3),
+ -- Hear length of message within VoicemailMain - yes/NO
+ sayduration CHAR(3),
+ -- Minimum duration in minutes to say
+ saydurationm INT(3),
+ -- Force new user to record name when entering voicemail - yes/NO
+ forcename CHAR(3),
+ -- Force new user to record greetings when entering voicemail - yes/NO
+ forcegreetings CHAR(3),
+ -- Context in which to dial extension for callback
+ callback CHAR(80),
+ -- Context in which to dial extension (from advanced menu)
+ dialout CHAR(80),
+ -- Context in which to execute 0 or * escape during greeting
+ exitcontext CHAR(80),
+ -- Maximum messages in a folder (100 if not specified)
+ maxmsg INT(5),
+ -- Increase DB gain on recorded message by this amount (0.0 means none)
+ volgain DECIMAL(5,2),
+ -- IMAP user for authentication (if using IMAP storage)
+ imapuser VARCHAR(80),
+ -- IMAP password for authentication (if using IMAP storage)
+ imappassword VARCHAR(80),
+ stamp timestamp
);
Modified: team/group/vldtmf_fixup/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf_fixup/main/channel.c?view=diff&rev=51259&r1=51258&r2=51259
==============================================================================
--- team/group/vldtmf_fixup/main/channel.c (original)
+++ team/group/vldtmf_fixup/main/channel.c Thu Jan 18 15:24:27 2007
@@ -214,7 +214,7 @@
}
-static int show_channeltype(int fd, int argc, char *argv[])
+static int show_channeltype_deprecated(int fd, int argc, char *argv[])
{
struct chanlist *cl = NULL;
@@ -267,7 +267,60 @@
return RESULT_SUCCESS;
}
-static char *complete_channeltypes(const char *line, const char *word, int pos, int state)
+static int show_channeltype(int fd, int argc, char *argv[])
+{
+ struct chanlist *cl = NULL;
+
+ if (argc != 4)
+ return RESULT_SHOWUSAGE;
+
+ if (AST_LIST_LOCK(&channels)) {
+ ast_log(LOG_WARNING, "Unable to lock channel list\n");
+ return RESULT_FAILURE;
+ }
+
+ AST_LIST_TRAVERSE(&backends, cl, list) {
+ if (!strncasecmp(cl->tech->type, argv[3], strlen(cl->tech->type))) {
+ break;
+ }
+ }
+
+
+ if (!cl) {
+ ast_cli(fd, "\n%s is not a registered channel driver.\n", argv[3]);
+ AST_LIST_UNLOCK(&channels);
+ return RESULT_FAILURE;
+ }
+
+ ast_cli(fd,
+ "-- Info about channel driver: %s --\n"
+ " Device State: %s\n"
+ " Indication: %s\n"
+ " Transfer : %s\n"
+ " Capabilities: %d\n"
+ " Digit Begin: %s\n"
+ " Digit End: %s\n"
+ " Send HTML : %s\n"
+ " Image Support: %s\n"
+ " Text Support: %s\n",
+ cl->tech->type,
+ (cl->tech->devicestate) ? "yes" : "no",
+ (cl->tech->indicate) ? "yes" : "no",
+ (cl->tech->transfer) ? "yes" : "no",
+ (cl->tech->capabilities) ? cl->tech->capabilities : -1,
+ (cl->tech->send_digit_begin) ? "yes" : "no",
+ (cl->tech->send_digit_end) ? "yes" : "no",
+ (cl->tech->send_html) ? "yes" : "no",
+ (cl->tech->send_image) ? "yes" : "no",
+ (cl->tech->send_text) ? "yes" : "no"
+
+ );
+
+ AST_LIST_UNLOCK(&channels);
+ return RESULT_SUCCESS;
+}
+
+static char *complete_channeltypes_deprecated(const char *line, const char *word, int pos, int state)
{
struct chanlist *cl;
int which = 0;
@@ -289,6 +342,28 @@
return ret;
}
+static char *complete_channeltypes(const char *line, const char *word, int pos, int state)
+{
+ struct chanlist *cl;
+ int which = 0;
+ int wordlen;
+ char *ret = NULL;
+
+ if (pos != 3)
+ return NULL;
+
+ wordlen = strlen(word);
+
+ AST_LIST_TRAVERSE(&backends, cl, list) {
+ if (!strncasecmp(word, cl->tech->type, wordlen) && ++which > state) {
+ ret = strdup(cl->tech->type);
+ break;
+ }
+ }
+
+ return ret;
+}
+
static char show_channeltypes_usage[] =
"Usage: core show channeltypes\n"
" Lists available channel types registered in your Asterisk server.\n";
@@ -304,8 +379,8 @@
static struct ast_cli_entry cli_show_channeltype_deprecated = {
{ "show", "channeltype", NULL },
- show_channeltype, NULL,
- NULL, complete_channeltypes };
+ show_channeltype_deprecated, NULL,
+ NULL, complete_channeltypes_deprecated };
static struct ast_cli_entry cli_channel[] = {
{ { "core", "show", "channeltypes", NULL },
Modified: team/group/vldtmf_fixup/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf_fixup/main/cli.c?view=diff&rev=51259&r1=51258&r2=51259
==============================================================================
--- team/group/vldtmf_fixup/main/cli.c (original)
+++ team/group/vldtmf_fixup/main/cli.c Thu Jan 18 15:24:27 2007
@@ -1243,12 +1243,33 @@
return ast_module_helper(line, word, pos, state, 3, 0);
}
-static char *complete_fn(const char *line, const char *word, int pos, int state)
+static char *complete_fn_2(const char *line, const char *word, int pos, int state)
{
char *c;
char filename[256];
if (pos != 1)
+ return NULL;
+
+ if (word[0] == '/')
+ ast_copy_string(filename, word, sizeof(filename));
+ else
+ snprintf(filename, sizeof(filename), "%s/%s", ast_config_AST_MODULE_DIR, word);
+
+ c = filename_completion_function(filename, state);
+
+ if (c && word[0] != '/')
+ c += (strlen(ast_config_AST_MODULE_DIR) + 1);
+
+ return c ? strdup(c) : c;
+}
+
+static char *complete_fn_3(const char *line, const char *word, int pos, int state)
+{
+ char *c;
+ char filename[256];
+
+ if (pos != 2)
return NULL;
if (word[0] == '/')
@@ -1391,7 +1412,7 @@
static struct ast_cli_entry cli_module_load_deprecated = {
{ "load", NULL },
handle_load_deprecated, NULL,
- NULL, complete_fn };
+ NULL, complete_fn_2 };
static struct ast_cli_entry cli_module_reload_deprecated = {
{ "reload", NULL },
@@ -1460,7 +1481,7 @@
{ { "module", "load", NULL },
handle_load, "Load a module by name",
- load_help, complete_fn, &cli_module_load_deprecated },
+ load_help, complete_fn_3, &cli_module_load_deprecated },
{ { "module", "reload", NULL },
handle_reload, "Reload configuration",
Modified: team/group/vldtmf_fixup/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf_fixup/main/manager.c?view=diff&rev=51259&r1=51258&r2=51259
==============================================================================
--- team/group/vldtmf_fixup/main/manager.c (original)
+++ team/group/vldtmf_fixup/main/manager.c Thu Jan 18 15:24:27 2007
@@ -953,6 +953,40 @@
ast_copy_string(s->username, cat, sizeof(s->username));
s->readperm = get_perm(ast_variable_retrieve(cfg, cat, "read"));
s->writeperm = get_perm(ast_variable_retrieve(cfg, cat, "write"));
+ ast_config_destroy(cfg);
+ if (events)
+ set_eventmask(s, events);
+ return 0;
+ }
+ ast_config_destroy(cfg);
+ cfg = ast_config_load("users.conf");
+ if (!cfg)
+ return -1;
+ cat = ast_category_browse(cfg, NULL);
+ while (cat) {
+ struct ast_variable *v;
+ const char *password = NULL;
+ int hasmanager = 0;
+ if (strcasecmp(cat, user) || !strcasecmp(cat, "general")) {
+ cat = ast_category_browse(cfg, cat);
+ continue;
+ }
+ for (v = ast_variable_browse(cfg, cat); v; v = v->next) {
+ if (!strcasecmp(v->name, "secret"))
+ password = v->value;
+ else if (!strcasecmp(v->name, "hasmanager"))
+ hasmanager = ast_true(v->value);
+ }
+ if (!hasmanager)
+ break;
+ if (!password || strcmp(password, pass)) {
+ ast_log(LOG_NOTICE, "%s failed to authenticate as '%s'\n", ast_inet_ntoa(s->sin.sin_addr), user);
+ ast_config_destroy(cfg);
+ return -1;
+ }
+ ast_copy_string(s->username, cat, sizeof(s->username));
+ s->readperm = -1;
+ s->writeperm = -1;
ast_config_destroy(cfg);
if (events)
set_eventmask(s, events);
Modified: team/group/vldtmf_fixup/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf_fixup/main/rtp.c?view=diff&rev=51259&r1=51258&r2=51259
==============================================================================
--- team/group/vldtmf_fixup/main/rtp.c (original)
+++ team/group/vldtmf_fixup/main/rtp.c Thu Jan 18 15:24:27 2007
@@ -2864,7 +2864,7 @@
if ((fr->subclass == AST_CONTROL_HOLD) ||
(fr->subclass == AST_CONTROL_UNHOLD) ||
(fr->subclass == AST_CONTROL_VIDUPDATE)) {
- ast_indicate(other, fr->subclass);
+ ast_indicate_data(other, fr->subclass, fr->data, fr->datalen);
ast_frfree(fr);
} else {
*fo = fr;
@@ -3072,7 +3072,7 @@
p0_callback = p2p_callback_enable(c0, p0, &p0_fds[0], &p0_iod[0]);
p1_callback = p2p_callback_enable(c1, p1, &p1_fds[0], &p1_iod[0]);
}
- ast_indicate(other, fr->subclass);
+ ast_indicate_data(other, fr->subclass, fr->data, fr->datalen);
ast_frfree(fr);
} else {
*fo = fr;
Modified: team/group/vldtmf_fixup/main/stdtime/localtime.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf_fixup/main/stdtime/localtime.c?view=diff&rev=51259&r1=51258&r2=51259
==============================================================================
--- team/group/vldtmf_fixup/main/stdtime/localtime.c (original)
+++ team/group/vldtmf_fixup/main/stdtime/localtime.c Thu Jan 18 15:24:27 2007
@@ -61,6 +61,7 @@
#include "asterisk/lock.h"
#include "asterisk/localtime.h"
+#include "asterisk/strings.h"
#ifndef lint
#ifndef NOID
@@ -1055,7 +1056,7 @@
#ifdef _THREAD_SAFE
ast_mutex_lock(&lcl_mutex);
#endif
- ast_tzset(zone);
+ ast_tzset(ast_strlen_zero(zone) ? "/etc/localtime" : zone);
localsub(timep, 0L, p_tm, zone);
#ifdef _THREAD_SAFE
ast_mutex_unlock(&lcl_mutex);
@@ -1495,8 +1496,8 @@
#ifdef _THREAD_SAFE
ast_mutex_lock(&lcl_mutex);
#endif
- ast_tzset(zone);
- mktime_return_value = time1(tmp, localsub, 0L, zone);
+ ast_tzset(!ast_strlen_zero(zone) ? zone : "/etc/localtime");
+ mktime_return_value = time1(tmp, localsub, 0L, !ast_strlen_zero(zone) ? zone : "/etc/localtime");
#ifdef _THREAD_SAFE
ast_mutex_unlock(&lcl_mutex);
#endif
More information about the svn-commits
mailing list