}
}
}
- if (peer)
- res = ast_autoservice_stop(peer);
+ if (peer) {
+ /* Stop autoservice on the peer channel, but don't overwrite any error condition
+ that has occurred previously while acting on the primary channel */
+ if (ast_autoservice_stop(peer) && !res)
+ res = -1;
+ }
}
return res;
}
" S(x) - Hang up the call after 'x' seconds *after* the called party has\n"
" answered the call.\n"
" t - Allow the called party to transfer the calling party by sending the\n"
-" DTMF sequence defiend in features.conf.\n"
+" DTMF sequence defined in features.conf.\n"
" T - Allow the calling party to transfer the called party by sending the\n"
" DTMF sequence defined in features.conf.\n"
" w - Allow the called party to enable recording of the call by sending\n"
ast_copy_string(vmu->language, value, sizeof(vmu->language));
} else if (!strcasecmp(var, "tz")) {
ast_copy_string(vmu->zonetag, value, sizeof(vmu->zonetag));
- } else if (!strcasecmp(var, "delete")) {
+ } else if (!strcasecmp(var, "delete") || !strcasecmp(var, "deletevoicemail")) {
ast_set2_flag(vmu, ast_true(value), VM_DELETE);
} else if (!strcasecmp(var, "saycid")){
ast_set2_flag(vmu, ast_true(value), VM_SAYCID);
}
}
if (ast_fileexists(fn, NULL, NULL)) {
- notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name);
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);
}
pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS");
while((cmd >= 0) && (cmd != 't')) {
if (cmd)
retries = 0;
+ RETRIEVE(prefile, -1);
if (ast_fileexists(prefile, NULL, NULL) > 0) {
switch (cmd) {
case '1':
cmd = play_record_review(chan,"vm-rec-temp",prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
break;
case '2':
- ast_filedelete(prefile, NULL);
+ DELETE(prefile, -1, prefile);
ast_play_and_wait(chan,"vm-tempremoved");
cmd = 't';
break;
play_record_review(chan,"vm-rec-temp",prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
cmd = 't';
}
+ DISPOSE(prefile, -1);
}
if (cmd == 't')
cmd = 0;
static int vmauthenticate(struct ast_channel *chan, void *data)
{
struct localuser *u;
- char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION];
+ char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION] = "";
struct ast_vm_user vmus;
char *options = NULL;
- int silent = 0;
+ int silent = 0, skipuser = 0;
int res = -1;
LOCAL_USER_ADD(u);
s = user;
user = strsep(&s, "@");
context = strsep(&s, "");
+ if (!ast_strlen_zero(user))
+ skipuser++;
+ ast_copy_string(mailbox, user, sizeof(mailbox));
}
}
silent = (strchr(options, 's')) != NULL;
}
- if (!vm_authenticate(chan, mailbox, sizeof(mailbox), &vmus, context, NULL, 0, 3, silent)) {
+ if (!vm_authenticate(chan, mailbox, sizeof(mailbox), &vmus, context, NULL, skipuser, 3, silent)) {
pbx_builtin_setvar_helper(chan, "AUTH_MAILBOX", mailbox);
pbx_builtin_setvar_helper(chan, "AUTH_CONTEXT", vmus.context);
+ ast_play_and_wait(chan, "auth-thankyou");
res = 0;
}
tmp->fds[AST_MAX_FDS-1] = tmp->alertpipe[0];
/* And timing pipe */
tmp->fds[AST_MAX_FDS-2] = tmp->timingfd;
- strcpy(tmp->name, "**Unkown**");
+ strcpy(tmp->name, "**Unknown**");
/* Initial state */
tmp->_state = AST_STATE_DOWN;
tmp->streamid = -1;
char agent_goodbye[AST_MAX_FILENAME_LEN];
int update_cdr = updatecdr;
char *filename = "agent-loginok";
+ char tmpchan[AST_MAX_BUF] = "";
LOCAL_USER_ADD(u);
snprintf(agent, sizeof(agent), "Agent/%s", p->agent);
if (callbackmode) {
- char tmpchan[AST_MAX_BUF] = "";
int pos = 0;
/* Retrieve login chan */
for (;;) {
ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
p = p->next;
}
- iflist = NULL;
ast_mutex_unlock(&iflock);
} else {
ast_log(LOG_WARNING, "Unable to lock the interface list\n");
; This does NOT affect option 3,3 from the advanced options menu
; delete=yes ; After notification, the voicemail is deleted from the server. [per-mailbox only]
; This is intended for use with users who wish to receive their voicemail ONLY by email.
+ ; Note: deletevoicemail is provided as an equivalent option for Realtime configuration.
; nextaftercmd=yes ; Skips to the next message after hitting 7 or 9 to delete/save current message.
; [global option only at this time]
; forcename=yes ; Forces a new user to record their name. A new user is
for an updated list of supported databases, from MySQL to MsSQL
and text files.
* cdr_tds supports FreeTDS databases (Among them MS SQL)
+ NOTE: Please read README.tds for information on possible
+ problems with the FreeTDS driver
* cdr_sqlite supports SQlite
* cdr_pgsql supports PostgreSQL
Fields of the CDR in Asterisk
-----------------------------
- 1. accountcode: What account number to use, (string, 20 characters)
- 2. src: Caller*ID number (string, 80 characters)
- 3. dst: Destination extension (string, 80 characters)
- 4. dcontext: Destination context (string, 80 characters)
- 5. clid: Caller*ID with text (80 characters)
- 6. channel: Channel used (80 characters)
- 7. dstchannel: Destination channel if appropriate (80 characters)
- 8. lastapp: Last application if appropriate (80 characters)
- 9. lastdata: Last application data (arguments) (80 characters)
- 10. start: Start of call (date/time)
- 11. answer: Answer of call (date/time)
- 12. end: End of call (date/time)
- 13. duration: Total time in system, in seconds (integer), from dial to hangup
- 14. billsec: Total time call is up, in seconds (integer), from answer to hangup
- 15. disposition: What happened to the call: ANSWERED, NO ANSWER, BUSY
- 16. amaflags: What flags to use: DOCUMENTATION, BILL, IGNORE etc,
- specified on a per channel basis like accountcode.
- 17. user field: A user-defined field, maximum 255 characters
+ 1. accountcode: What account number to use, (string, 20 characters)
+ 2. src: Caller*ID number (string, 80 characters)
+ 3. dst: Destination extension (string, 80 characters)
+ 4. dcontext: Destination context (string, 80 characters)
+ 5. clid: Caller*ID with text (80 characters)
+ 6. channel: Channel used (80 characters)
+ 7. dstchannel: Destination channel if appropriate (80 characters)
+ 8. lastapp: Last application if appropriate (80 characters)
+ 9. lastdata: Last application data (arguments) (80 characters)
+ 10. start: Start of call (date/time)
+ 11. answer: Answer of call (date/time)
+ 12. end: End of call (date/time)
+ 13. duration: Total time in system, in seconds (integer), from dial to hangup
+ 14. billsec: Total time call is up, in seconds (integer), from answer to hangup
+ 15. disposition: What happened to the call: ANSWERED, NO ANSWER, BUSY
+ 16. amaflags: What flags to use: DOCUMENTATION, BILL, IGNORE etc,
+ specified on a per channel basis like accountcode.
+ 17. user field: A user-defined field, maximum 255 characters
In some cases, uniqueid is appended:
- * uniqueid: Unique Channel Identifier (32 characters)
+ * uniqueid: Unique Channel Identifier (32 characters)
This needs to be enabled in the source code at compile time
cblist = cblist->next;
}
- ast_mutex_lock(&hintlock);
+ ast_mutex_unlock(&hintlock);
return -1;
}
if (argc > 4)
return RESULT_SHOWUSAGE;
+ ast_mutex_lock(&list_lock);
if (argv[2] && !strcasecmp(argv[2],"recalc")) {
z = argv[3] ? atoi(argv[3]) : 1;
ast_cli(fd, " Translation times between formats (in milliseconds)\n");
ast_cli(fd, " Source Format (Rows) Destination Format(Columns)\n\n");
- ast_mutex_lock(&list_lock);
for (x = -1; x < SHOW_TRANS; x++) {
/* next 2 lines run faster than using strcpy() */
line[0] = ' ';