aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-22 15:27:54 +0000
committerautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-22 15:27:54 +0000
commit85a2abbbbfafd2400b5bb3331a2882721caa6ece (patch)
tree9bb95392065c3ae08c273654d351c610c8a8624a
parent90b56f7d3870e4de219a42e609f9ca9776788582 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@71119 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--asterisk.c16
-rw-r--r--file.c7
-rw-r--r--res/res_agi.c18
3 files changed, 16 insertions, 25 deletions
diff --git a/asterisk.c b/asterisk.c
index 111dcf53d..83c7ed2c2 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)
+ break;
+
if (!ast_strlen_zero(ebuf)) {
if (ebuf[strlen(ebuf)-1] == '\n')
ebuf[strlen(ebuf)-1] = '\0';
@@ -2457,12 +2460,15 @@ int main(int argc, char *argv[])
for (;;) {
buf = (char *)el_gets(el, &num);
- if (buf) {
- if (buf[strlen(buf)-1] == '\n')
- buf[strlen(buf)-1] = '\0';
- consolehandler((char *)buf);
- } else if (option_remote) {
+ if (!buf)
+ break;
+
+ if (buf[strlen(buf)-1] == '\n')
+ buf[strlen(buf)-1] = '\0';
+
+ consolehandler((char *)buf);
+ if (!buf && option_remote) {
if (write(STDOUT_FILENO, "\nUse EXIT or QUIT to exit the asterisk console\n",
strlen("\nUse EXIT or QUIT to exit the asterisk console\n")) < 0) {
/* Whoa, stdout disappeared from under us... Make /dev/null's */
diff --git a/file.c b/file.c
index 15734ecd2..9139b03c8 100644
--- a/file.c
+++ b/file.c
@@ -816,10 +816,9 @@ int ast_streamfile(struct ast_channel *chan, const char *filename, const char *p
return -1;
if (vfs && ast_applystream(chan, vfs))
return -1;
- if (ast_playstream(fs))
- return -1;
- if (vfs && ast_playstream(vfs))
- return -1;
+ ast_playstream(fs);
+ if (vfs)
+ ast_playstream(vfs);
#if 1
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Playing '%s' (language '%s')\n", filename, preflang ? preflang : "default");
diff --git a/res/res_agi.c b/res/res_agi.c
index 22a5c29d8..4d5ede388 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -569,14 +569,7 @@ static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, char
max_length = ast_tellstream(fs);
ast_seekstream(fs, sample_offset, SEEK_SET);
res = ast_applystream(chan, fs);
- res = ast_playstream(fs);
- if (res) {
- fdprintf(agi->fd, "200 result=%d endpos=%ld\n", res, sample_offset);
- if (res >= 0)
- return RESULT_SHOWUSAGE;
- else
- return RESULT_FAILURE;
- }
+ ast_playstream(fs);
res = ast_waitstream_full(chan, argv[3], agi->audio, agi->ctrl);
/* this is to check for if ast_waitstream closed the stream, we probably are at
* the end of the stream, return that amount, else check for the amount */
@@ -629,14 +622,7 @@ static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, char *
max_length = ast_tellstream(fs);
ast_seekstream(fs, sample_offset, SEEK_SET);
res = ast_applystream(chan, fs);
- res = ast_playstream(fs);
- if (res) {
- fdprintf(agi->fd, "200 result=%d endpos=%ld\n", res, sample_offset);
- if (res >= 0)
- return RESULT_SHOWUSAGE;
- else
- return RESULT_FAILURE;
- }
+ ast_playstream(fs);
res = ast_waitstream_full(chan, argv[3], agi->audio, agi->ctrl);
/* this is to check for if ast_waitstream closed the stream, we probably are at
* the end of the stream, return that amount, else check for the amount */