]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
updating to current 1.2
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 13 Jan 2006 03:52:45 +0000 (03:52 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 13 Jan 2006 03:52:45 +0000 (03:52 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@8046 65c4cc65-6c06-0410-ace0-fbb531ad65f3

app.c
apps/app_dial.c
apps/app_voicemail.c
channel.c
channels/chan_agent.c
channels/chan_sip.c
configs/voicemail.conf.sample
doc/README.cdr
pbx.c
translate.c

diff --git a/app.c b/app.c
index 998135fb57fd7bf8d3c8d2e798db14057cdd8d72..95347a27e5b9a9381de2a580023d6e306c8948a9 100644 (file)
--- a/app.c
+++ b/app.c
@@ -316,8 +316,12 @@ int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digi
                                }
                        }
                }
-               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;
 }
index a020fefe000c93ae9a0f2272d8d4284167fb8fe5..9e900350987659acb45067a9dc3bbc4b2d77b3aa 100644 (file)
@@ -161,7 +161,7 @@ static char *descrip =
 "    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"
index 9fc5bb1cc03ca0f7f7056899eb51c481b9b3eec9..3761a9058bc199f5e713feb61ce3712223cd1d1a 100644 (file)
@@ -445,7 +445,7 @@ static void apply_option(struct ast_vm_user *vmu, const char *var, const char *v
                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); 
@@ -2613,8 +2613,8 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
                                }
                        }
                        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");
@@ -4764,13 +4764,14 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
        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;
@@ -4794,6 +4795,7 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
                        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;
@@ -5645,10 +5647,10 @@ static int vm_box_exists(struct ast_channel *chan, void *data)
 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);
@@ -5665,6 +5667,9 @@ static int vmauthenticate(struct ast_channel *chan, void *data)
                        s = user;
                        user = strsep(&s, "@");
                        context = strsep(&s, "");
+                       if (!ast_strlen_zero(user))
+                               skipuser++;
+                       ast_copy_string(mailbox, user, sizeof(mailbox));
                }
        }
 
@@ -5672,9 +5677,10 @@ static int vmauthenticate(struct ast_channel *chan, void *data)
                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;
        }
 
index 34f8d09cad677ebe34dcf34f5322f1f922dd6b6a..777432940ebe454289fa5d36734e1da7797c288c 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -576,7 +576,7 @@ struct ast_channel *ast_channel_alloc(int needqueue)
        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;
index 40fa5c1242bc4607e21cd2a02f09e167ed9e91d3..d0df158d6aea25063e1ef0015498ce3844a405e2 100644 (file)
@@ -1695,6 +1695,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
        char agent_goodbye[AST_MAX_FILENAME_LEN];
        int update_cdr = updatecdr;
        char *filename = "agent-loginok";
+       char tmpchan[AST_MAX_BUF] = "";
 
        LOCAL_USER_ADD(u);
 
@@ -1825,7 +1826,6 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
                                        snprintf(agent, sizeof(agent), "Agent/%s", p->agent);
 
                                        if (callbackmode) {
-                                               char tmpchan[AST_MAX_BUF] = "";
                                                int pos = 0;
                                                /* Retrieve login chan */
                                                for (;;) {
index 34a57e66e359c8e984c4d26f98eeecf77a09fc14..24872fe48f440c9a4595010a154c09c4ab3194c2 100644 (file)
@@ -13315,7 +13315,6 @@ int unload_module()
                                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");
index 8558235a660bcee4d4277e8363af8b600cae4cf7..fa362c95d46d12cc117ada4ce682614ea4282f30 100644 (file)
@@ -172,6 +172,7 @@ sendvoicemail=yes   ; Context to Send voicemail from [option 5 from the advanced m
                        ;     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
index 7a5440ebf07a9a6d14dd37064b3acd84edac9d68..cb9813845caad252ee658b84ff3753b329da0c7b 100644 (file)
@@ -11,6 +11,8 @@ separated text file.
      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
 
@@ -39,28 +41,28 @@ channel configuration files, like sip.conf, iax.conf etc.
 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
 
 
diff --git a/pbx.c b/pbx.c
index 7f5fef1eefc04f47996dd21036cbbce85afd16e8..3446ab58edb6a33f5b66e489e9ddef65d79ce17c 100644 (file)
--- a/pbx.c
+++ b/pbx.c
@@ -2029,7 +2029,7 @@ int ast_extension_state_del(int id, ast_state_cb_type callback)
                        cblist = cblist->next;
                }
 
-               ast_mutex_lock(&hintlock);
+               ast_mutex_unlock(&hintlock);
                return -1;
        }
 
index 4126851b96bad2cc5c4a0638339b63a73d44d43c..6285ac48b472488e36b3f1839f32745018111935 100644 (file)
@@ -331,6 +331,7 @@ static int show_translation(int fd, int argc, char *argv[])
        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;
 
@@ -349,7 +350,6 @@ static int show_translation(int fd, int argc, char *argv[])
 
        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] = ' ';