<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16511">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_externalivr.c: Fix mixed leading whitespace in source code.<br><br>No functional changes.<br><br>Change-Id: I46514152c0af67f395526374aaa847ccd6a85378<br>---<br>M apps/app_externalivr.c<br>1 file changed, 142 insertions(+), 142 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c</span><br><span>index 8e78279..ad0e0cc 100644</span><br><span>--- a/apps/app_externalivr.c</span><br><span>+++ b/apps/app_externalivr.c</span><br><span>@@ -254,9 +254,9 @@</span><br><span> if (!(state->stream && (f = ast_readframe(state->stream)))) {</span><br><span> if (state->current) {</span><br><span> /* remove finished file from playlist */</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_LOCK(&u->playlist);</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_REMOVE_HEAD(&u->playlist, list);</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_UNLOCK(&u->playlist);</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_LOCK(&u->playlist);</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_REMOVE_HEAD(&u->playlist, list);</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_UNLOCK(&u->playlist);</span><br><span> /* add finished file to finishlist */</span><br><span> AST_LIST_LOCK(&u->finishlist);</span><br><span> AST_LIST_INSERT_TAIL(&u->finishlist, state->current, list);</span><br><span>@@ -581,7 +581,7 @@</span><br><span> }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- exit:</span><br><span style="color: hsl(120, 100%, 40%);">+ exit:</span><br><span> if (u->gen_active) {</span><br><span> ast_deactivate_generator(chan);</span><br><span> }</span><br><span>@@ -622,21 +622,21 @@</span><br><span> }</span><br><span> </span><br><span> static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u,</span><br><span style="color: hsl(0, 100%, 40%);">- struct ast_iostream *eivr_events,</span><br><span style="color: hsl(0, 100%, 40%);">- struct ast_iostream *eivr_commands,</span><br><span style="color: hsl(0, 100%, 40%);">- struct ast_iostream *eivr_errors,</span><br><span style="color: hsl(0, 100%, 40%);">- const struct ast_str *args, const struct ast_flags flags)</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_iostream *eivr_events,</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_iostream *eivr_commands,</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_iostream *eivr_errors,</span><br><span style="color: hsl(120, 100%, 40%);">+ const struct ast_str *args, const struct ast_flags flags)</span><br><span> {</span><br><span> char input[1024];</span><br><span> struct playlist_entry *entry;</span><br><span> struct ast_frame *f;</span><br><span> int ms;</span><br><span style="color: hsl(0, 100%, 40%);">- int exception;</span><br><span style="color: hsl(0, 100%, 40%);">- int ready_fd;</span><br><span style="color: hsl(120, 100%, 40%);">+ int exception;</span><br><span style="color: hsl(120, 100%, 40%);">+ int ready_fd;</span><br><span> int waitfds[2];</span><br><span> int r;</span><br><span style="color: hsl(0, 100%, 40%);">- struct ast_channel *rchan;</span><br><span style="color: hsl(0, 100%, 40%);">- int res = -1;</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_channel *rchan;</span><br><span style="color: hsl(120, 100%, 40%);">+ int res = -1;</span><br><span> int hangup_info_sent = 0;</span><br><span> </span><br><span> waitfds[0] = ast_iostream_get_fd(eivr_commands);</span><br><span>@@ -645,78 +645,78 @@</span><br><span> while (1) {</span><br><span> if (ast_test_flag(ast_channel_flags(chan), AST_FLAG_ZOMBIE)) {</span><br><span> ast_chan_log(LOG_ERROR, chan, "Is a zombie\n");</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!hangup_info_sent && !(ast_test_flag(&flags, run_dead)) && ast_check_hangup(chan)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!hangup_info_sent && !(ast_test_flag(&flags, run_dead)) && ast_check_hangup(chan)) {</span><br><span> if (ast_test_flag(&flags, ignore_hangup)) {</span><br><span> ast_verb(3, "Got check_hangup, but ignore_hangup set so sending 'I' command\n");</span><br><span> send_eivr_event(eivr_events, 'I', "HANGUP", chan);</span><br><span> hangup_info_sent = 1;</span><br><span> } else {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_verb(3, "Got check_hangup\n");</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'H', NULL, chan);</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verb(3, "Got check_hangup\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'H', NULL, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ready_fd = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- ms = 100;</span><br><span style="color: hsl(0, 100%, 40%);">- errno = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- exception = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ ready_fd = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ ms = 100;</span><br><span style="color: hsl(120, 100%, 40%);">+ errno = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ exception = 0;</span><br><span> </span><br><span> rchan = ast_waitfor_nandfds(&chan, 1, waitfds, (eivr_errors) ? 2 : 1, &exception, &ready_fd, &ms);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_channel_state(chan) == AST_STATE_UP && !AST_LIST_EMPTY(&u->finishlist)) {</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_LOCK(&u->finishlist);</span><br><span style="color: hsl(0, 100%, 40%);">- while ((entry = AST_LIST_REMOVE_HEAD(&u->finishlist, list))) {</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'F', entry->filename, chan);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_free(entry);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_UNLOCK(&u->finishlist);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_channel_state(chan) == AST_STATE_UP && !AST_LIST_EMPTY(&u->finishlist)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_LOCK(&u->finishlist);</span><br><span style="color: hsl(120, 100%, 40%);">+ while ((entry = AST_LIST_REMOVE_HEAD(&u->finishlist, list))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'F', entry->filename, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(entry);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_UNLOCK(&u->finishlist);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_channel_state(chan) == AST_STATE_UP && !(ast_check_hangup(chan)) && rchan) {</span><br><span style="color: hsl(0, 100%, 40%);">- /* the channel has something */</span><br><span style="color: hsl(0, 100%, 40%);">- f = ast_read(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!f) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_verb(3, "Returned no frame\n");</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'H', NULL, chan);</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (f->frametype == AST_FRAME_DTMF) {</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, f->subclass.integer, NULL, chan);</span><br><span style="color: hsl(0, 100%, 40%);">- if (u->option_autoclear) {</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_LOCK(&u->playlist);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!u->abort_current_sound && !u->playing_silence) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_channel_state(chan) == AST_STATE_UP && !(ast_check_hangup(chan)) && rchan) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* the channel has something */</span><br><span style="color: hsl(120, 100%, 40%);">+ f = ast_read(chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!f) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verb(3, "Returned no frame\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'H', NULL, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (f->frametype == AST_FRAME_DTMF) {</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, f->subclass.integer, NULL, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (u->option_autoclear) {</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_LOCK(&u->playlist);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!u->abort_current_sound && !u->playing_silence) {</span><br><span> /* send interrupted file as T data */</span><br><span style="color: hsl(0, 100%, 40%);">- if ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'T', entry->filename, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ if ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'T', entry->filename, chan);</span><br><span> ast_free(entry);</span><br><span> }</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'D', entry->filename, chan);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_free(entry);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!u->playing_silence)</span><br><span style="color: hsl(0, 100%, 40%);">- u->abort_current_sound = 1;</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_UNLOCK(&u->playlist);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass.integer == AST_CONTROL_HANGUP)) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_verb(3, "Got AST_CONTROL_HANGUP\n");</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'H', NULL, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'D', entry->filename, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(entry);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!u->playing_silence)</span><br><span style="color: hsl(120, 100%, 40%);">+ u->abort_current_sound = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_UNLOCK(&u->playlist);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass.integer == AST_CONTROL_HANGUP)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verb(3, "Got AST_CONTROL_HANGUP\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'H', NULL, chan);</span><br><span> if (f->data.uint32) {</span><br><span> ast_channel_hangupcause_set(chan, f->data.uint32);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- ast_frfree(f);</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- ast_frfree(f);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (ready_fd == waitfds[0]) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (exception) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_ERROR, chan, "Child process went away\n");</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_frfree(f);</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_frfree(f);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (ready_fd == waitfds[0]) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (exception) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_ERROR, chan, "Child process went away\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> </span><br><span> r = ast_iostream_gets(eivr_commands, input, sizeof(input));</span><br><span> if (r <= 0) {</span><br><span>@@ -784,112 +784,112 @@</span><br><span> u->abort_current_sound = 1;</span><br><span> }</span><br><span> AST_LIST_UNLOCK(&u->playlist);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (input[0] == EIVR_CMD_SQUE) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (input[0] == EIVR_CMD_SQUE) {</span><br><span> if (ast_channel_state(chan) != AST_STATE_UP || ast_check_hangup(chan)) {</span><br><span> ast_chan_log(LOG_WARNING, chan, "Queue re'S'et called on unanswered channel\n");</span><br><span> send_eivr_event(eivr_events, 'Z', NULL, chan);</span><br><span> continue;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!ast_fileexists(&input[2], NULL, ast_channel_language(u->chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_WARNING, chan, "Unknown file requested '%s'\n", &input[2]);</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'Z', &input[2], chan);</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_LOCK(&u->playlist);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!u->abort_current_sound && !u->playing_silence) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!ast_fileexists(&input[2], NULL, ast_channel_language(u->chan))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_WARNING, chan, "Unknown file requested '%s'\n", &input[2]);</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'Z', &input[2], chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_LOCK(&u->playlist);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!u->abort_current_sound && !u->playing_silence) {</span><br><span> /* send interrupted file as T data */</span><br><span style="color: hsl(0, 100%, 40%);">- if ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'T', entry->filename, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ if ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'T', entry->filename, chan);</span><br><span> ast_free(entry);</span><br><span> }</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'D', entry->filename, chan);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_free(entry);</span><br><span style="color: hsl(120, 100%, 40%);">+ while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'D', entry->filename, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(entry);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!u->playing_silence) {</span><br><span style="color: hsl(0, 100%, 40%);">- u->abort_current_sound = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!u->playing_silence) {</span><br><span style="color: hsl(120, 100%, 40%);">+ u->abort_current_sound = 1;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- entry = make_entry(&input[2]);</span><br><span style="color: hsl(0, 100%, 40%);">- if (entry) {</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_INSERT_TAIL(&u->playlist, entry, list);</span><br><span style="color: hsl(120, 100%, 40%);">+ entry = make_entry(&input[2]);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (entry) {</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_INSERT_TAIL(&u->playlist, entry, list);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_UNLOCK(&u->playlist);</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_UNLOCK(&u->playlist);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (input[0] == EIVR_CMD_APND) {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (input[0] == EIVR_CMD_APND) {</span><br><span> if (ast_channel_state(chan) != AST_STATE_UP || ast_check_hangup(chan)) {</span><br><span> ast_chan_log(LOG_WARNING, chan, "Queue 'A'ppend called on unanswered channel\n");</span><br><span> send_eivr_event(eivr_events, 'Z', NULL, chan);</span><br><span> continue;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!ast_fileexists(&input[2], NULL, ast_channel_language(u->chan))) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_WARNING, chan, "Unknown file requested '%s'\n", &input[2]);</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'Z', &input[2], chan);</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- entry = make_entry(&input[2]);</span><br><span style="color: hsl(0, 100%, 40%);">- if (entry) {</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_LOCK(&u->playlist);</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_INSERT_TAIL(&u->playlist, entry, list);</span><br><span style="color: hsl(0, 100%, 40%);">- AST_LIST_UNLOCK(&u->playlist);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!ast_fileexists(&input[2], NULL, ast_channel_language(u->chan))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_WARNING, chan, "Unknown file requested '%s'\n", &input[2]);</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'Z', &input[2], chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ entry = make_entry(&input[2]);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (entry) {</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_LOCK(&u->playlist);</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_INSERT_TAIL(&u->playlist, entry, list);</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_UNLOCK(&u->playlist);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (input[0] == EIVR_CMD_GET) {</span><br><span style="color: hsl(0, 100%, 40%);">- char response[2048];</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (input[0] == EIVR_CMD_GET) {</span><br><span style="color: hsl(120, 100%, 40%);">+ char response[2048];</span><br><span> ast_verb(4, "Retriving Variables from channel: %s\n", &input[2]);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_eivr_getvariable(chan, &input[2], response, sizeof(response));</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'G', response, chan);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (input[0] == EIVR_CMD_SVAR) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_eivr_getvariable(chan, &input[2], response, sizeof(response));</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'G', response, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (input[0] == EIVR_CMD_SVAR) {</span><br><span> ast_verb(4, "Setting Variables in channel: %s\n", &input[2]);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_eivr_setvariable(chan, &input[2]);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (input[0] == EIVR_CMD_LOG) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_NOTICE, chan, "Log message from EIVR: %s\n", &input[2]);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (input[0] == EIVR_CMD_XIT) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_NOTICE, chan, "Exiting: %s\n", &input[2]);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_eivr_setvariable(chan, &input[2]);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (input[0] == EIVR_CMD_LOG) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_NOTICE, chan, "Log message from EIVR: %s\n", &input[2]);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (input[0] == EIVR_CMD_XIT) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_NOTICE, chan, "Exiting: %s\n", &input[2]);</span><br><span> ast_chan_log(LOG_WARNING, chan, "e'X'it command is depricated, use 'E'xit instead\n");</span><br><span style="color: hsl(0, 100%, 40%);">- res = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(120, 100%, 40%);">+ res = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span> } else if (input[0] == EIVR_CMD_EXIT) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_NOTICE, chan, "Exiting: %s\n", &input[2]);</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'E', NULL, chan);</span><br><span style="color: hsl(0, 100%, 40%);">- res = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (input[0] == EIVR_CMD_HGUP) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_NOTICE, chan, "Hanging up: %s\n", &input[2]);</span><br><span style="color: hsl(0, 100%, 40%);">- send_eivr_event(eivr_events, 'H', NULL, chan);</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (input[0] == EIVR_CMD_OPT) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_NOTICE, chan, "Exiting: %s\n", &input[2]);</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'E', NULL, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ res = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (input[0] == EIVR_CMD_HGUP) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_NOTICE, chan, "Hanging up: %s\n", &input[2]);</span><br><span style="color: hsl(120, 100%, 40%);">+ send_eivr_event(eivr_events, 'H', NULL, chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (input[0] == EIVR_CMD_OPT) {</span><br><span> if (ast_channel_state(chan) != AST_STATE_UP || ast_check_hangup(chan)) {</span><br><span> ast_chan_log(LOG_WARNING, chan, "Option called on unanswered channel\n");</span><br><span> send_eivr_event(eivr_events, 'Z', NULL, chan);</span><br><span> continue;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- if (!strcasecmp(&input[2], "autoclear"))</span><br><span style="color: hsl(0, 100%, 40%);">- u->option_autoclear = 1;</span><br><span style="color: hsl(0, 100%, 40%);">- else if (!strcasecmp(&input[2], "noautoclear"))</span><br><span style="color: hsl(0, 100%, 40%);">- u->option_autoclear = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_WARNING, chan, "Unknown option requested: %s\n", &input[2]);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (ready_fd == waitfds[1]) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (exception) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_ERROR, chan, "Child process went away\n");</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- r = ast_iostream_gets(eivr_errors, input, sizeof(input));</span><br><span style="color: hsl(0, 100%, 40%);">- if (r > 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_NOTICE, chan, "stderr: %s\n", ast_strip(input));</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (r == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_ERROR, chan, "Child process went away\n");</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!strcasecmp(&input[2], "autoclear"))</span><br><span style="color: hsl(120, 100%, 40%);">+ u->option_autoclear = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+ else if (!strcasecmp(&input[2], "noautoclear"))</span><br><span style="color: hsl(120, 100%, 40%);">+ u->option_autoclear = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_WARNING, chan, "Unknown option requested: %s\n", &input[2]);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else if ((ready_fd < 0) && ms) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (errno == 0 || errno == EINTR)</span><br><span style="color: hsl(0, 100%, 40%);">- continue;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (ready_fd == waitfds[1]) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (exception) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_ERROR, chan, "Child process went away\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ast_chan_log(LOG_ERROR, chan, "Wait failed (%s)\n", strerror(errno));</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+ r = ast_iostream_gets(eivr_errors, input, sizeof(input));</span><br><span style="color: hsl(120, 100%, 40%);">+ if (r > 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_NOTICE, chan, "stderr: %s\n", ast_strip(input));</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (r == 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_ERROR, chan, "Child process went away\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if ((ready_fd < 0) && ms) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (errno == 0 || errno == EINTR)</span><br><span style="color: hsl(120, 100%, 40%);">+ continue;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_chan_log(LOG_ERROR, chan, "Wait failed (%s)\n", strerror(errno));</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> </span><br><span> return res;</span><br><span> }</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16511">change 16511</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/16511"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I46514152c0af67f395526374aaa847ccd6a85378 </div>
<div style="display:none"> Gerrit-Change-Number: 16511 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>