[Asterisk-code-review] app_queue: Refactor odd placement of if's around say_position (asterisk[master])
Walter Doekes
asteriskteam at digium.com
Mon Feb 24 08:42:03 CST 2020
Walter Doekes has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/13818 )
Change subject: app_queue: Refactor odd placement of if's around say_position
......................................................................
app_queue: Refactor odd placement of if's around say_position
Change-Id: Icba97905e331812f129e5966e91a59b104c7a748
---
M apps/app_queue.c
1 file changed, 27 insertions(+), 33 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/18/13818/1
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 8cb3e32..a79c7e1 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1614,7 +1614,7 @@
time_t starttime; /*!< The time at which the member answered the current caller. */
time_t lastcall; /*!< When last successful call was hungup */
time_t lastpause; /*!< When started the last pause */
- struct call_queue *lastqueue; /*!< Last queue we received a call */
+ struct call_queue *lastqueue; /*!< Last queue we received a call */
unsigned int dead:1; /*!< Used to detect members deleted in realtime */
unsigned int delme:1; /*!< Flag to delete entry on reload */
char rt_uniqueid[80]; /*!< Unique id of realtime member entry */
@@ -4021,39 +4021,33 @@
goto playout;
}
goto posout;
- } else {
- if (qe->parent->announceposition == ANNOUNCEPOSITION_MORE_THAN && qe->pos > qe->parent->announcepositionlimit){
- /* More than Case*/
- res = play_file(qe->chan, qe->parent->queue_quantity1);
- if (res) {
- goto playout;
- }
- res = ast_say_number(qe->chan, qe->parent->announcepositionlimit, AST_DIGIT_ANY, ast_channel_language(qe->chan), NULL); /* Needs gender */
- if (res) {
- goto playout;
- }
- } else {
- /* Normal Case */
- res = play_file(qe->chan, qe->parent->sound_thereare);
- if (res) {
- goto playout;
- }
- res = ast_say_number(qe->chan, qe->pos, AST_DIGIT_ANY, ast_channel_language(qe->chan), NULL); /* Needs gender */
- if (res) {
- goto playout;
- }
+ /* Say there are more than N callers */
+ } else if (qe->parent->announceposition == ANNOUNCEPOSITION_MORE_THAN && qe->pos > qe->parent->announcepositionlimit) {
+ res = play_file(qe->chan, qe->parent->queue_quantity1);
+ if (res) {
+ goto playout;
}
- if (qe->parent->announceposition == ANNOUNCEPOSITION_MORE_THAN && qe->pos > qe->parent->announcepositionlimit){
- /* More than Case*/
- res = play_file(qe->chan, qe->parent->queue_quantity2);
- if (res) {
- goto playout;
- }
- } else {
- res = play_file(qe->chan, qe->parent->sound_calls);
- if (res) {
- goto playout;
- }
+ res = ast_say_number(qe->chan, qe->parent->announcepositionlimit, AST_DIGIT_ANY, ast_channel_language(qe->chan), NULL); /* Needs gender */
+ if (res) {
+ goto playout;
+ }
+ res = play_file(qe->chan, qe->parent->queue_quantity2);
+ if (res) {
+ goto playout;
+ }
+ /* Say there are currently N callers waiting */
+ } else {
+ res = play_file(qe->chan, qe->parent->sound_thereare);
+ if (res) {
+ goto playout;
+ }
+ res = ast_say_number(qe->chan, qe->pos, AST_DIGIT_ANY, ast_channel_language(qe->chan), NULL); /* Needs gender */
+ if (res) {
+ goto playout;
+ }
+ res = play_file(qe->chan, qe->parent->sound_calls);
+ if (res) {
+ goto playout;
}
}
}
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13818
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Icba97905e331812f129e5966e91a59b104c7a748
Gerrit-Change-Number: 13818
Gerrit-PatchSet: 1
Gerrit-Owner: Walter Doekes <walter+asterisk at wjd.nu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200224/1ef5c563/attachment-0001.html>
More information about the asterisk-code-review
mailing list