]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge Script <automerge@asterisk.org>
Wed, 27 Jun 2007 21:27:00 +0000 (21:27 +0000)
committerAutomerge Script <automerge@asterisk.org>
Wed, 27 Jun 2007 21:27:00 +0000 (21:27 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@72303 65c4cc65-6c06-0410-ace0-fbb531ad65f3

asterisk.c
channel.c
pbx/pbx_config.c

index 111dcf53d2270c8ffc087ee33b3d3dea40edb0c7..c7acd01280a38800878e5428e2e4de05b332e273 100644 (file)
@@ -1816,6 +1816,9 @@ static void ast_remotecontrol(char * data)
        for(;;) {
                ebuf = (char *)el_gets(el, &num);
 
+               if (!ebuf && write(1, "", 1) < 0)
+                       break;
+
                if (!ast_strlen_zero(ebuf)) {
                        if (ebuf[strlen(ebuf)-1] == '\n')
                                ebuf[strlen(ebuf)-1] = '\0';
@@ -2457,6 +2460,10 @@ int main(int argc, char *argv[])
 
                for (;;) {
                        buf = (char *)el_gets(el, &num);
+
+                       if (!buf && write(1, "", 1) < 0)
+                               goto lostterm;
+
                        if (buf) {
                                if (buf[strlen(buf)-1] == '\n')
                                        buf[strlen(buf)-1] = '\0';
@@ -2481,5 +2488,6 @@ int main(int argc, char *argv[])
 
        monitor_sig_flags(NULL);
 
+lostterm:
        return 0;
 }
index 10ef85fc2f780bc2b69896102e19d843d948a23d..a96d7d2d4cbec85acbde1c47f0cc24d2e355e233 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -1326,6 +1326,7 @@ static void free_translation(struct ast_channel *clone)
 int ast_hangup(struct ast_channel *chan)
 {
        int res = 0;
+       struct ast_cdr *cdr = NULL;
 
        /* Don't actually hang up a channel that will masquerade as someone else, or
           if someone is going to masquerade as us */
@@ -1372,7 +1373,7 @@ int ast_hangup(struct ast_channel *chan)
        chan->generator = NULL;
        if (chan->cdr) {                /* End the CDR if it hasn't already */ 
                ast_cdr_end(chan->cdr);
-               ast_cdr_detach(chan->cdr);      /* Post and Free the CDR */ 
+               cdr = chan->cdr;
                chan->cdr = NULL;
        }
        if (ast_test_flag(chan, AST_FLAG_BLOCKING)) {
@@ -1403,6 +1404,11 @@ int ast_hangup(struct ast_channel *chan)
                        ast_cause2str(chan->hangupcause)
                        );
        ast_channel_free(chan);
+
+       /* Defer CDR processing until later */
+       if (cdr)
+               ast_cdr_detach(cdr);
+
        return res;
 }
 
index 684e43fc1308e6a494bf667edfffec6359d404ea..5e850a2bf91d5ec4697a49874f0adedbdb62678b 100644 (file)
@@ -1678,6 +1678,8 @@ static int pbx_load_module(void)
                                                        pri = strsep(&stringp, ",");
                                                        if (!pri)
                                                                pri="";
+                                                       pri = ast_skip_blanks(pri);
+                                                       pri = ast_trim_blanks(pri);
                                                        label = strchr(pri, '(');
                                                        if (label) {
                                                                *label = '\0';