From: Automerge Script Date: Wed, 27 Jun 2007 21:27:00 +0000 (+0000) Subject: automerge commit X-Git-Tag: 1.2.20-netsec~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=df950e24ee83049f90db8ee1b2e6c509ccb697a0;p=thirdparty%2Fasterisk.git automerge commit git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@72303 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/asterisk.c b/asterisk.c index 111dcf53d2..c7acd01280 100644 --- a/asterisk.c +++ b/asterisk.c @@ -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; } diff --git a/channel.c b/channel.c index 10ef85fc2f..a96d7d2d4c 100644 --- 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; } diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index 684e43fc13..5e850a2bf9 100644 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -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';