aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-27 21:27:00 +0000
committerautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-27 21:27:00 +0000
commitdd9356da99482637afa9ddb8f2dc746997313ede (patch)
tree409b615792d5452903a17846a7a9c6e300eade57
parentbccadde56f14c02e6a6862942533bbaecfbadbbf (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@72303 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--asterisk.c8
-rw-r--r--channel.c8
-rw-r--r--pbx/pbx_config.c2
3 files changed, 17 insertions, 1 deletions
diff --git a/asterisk.c b/asterisk.c
index 111dcf53d..c7acd0128 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 10ef85fc2..a96d7d2d4 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 684e43fc1..5e850a2bf 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';