[asterisk-commits] mmichelson: branch mmichelson/atxfer_features r393367 - /team/mmichelson/atxf...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jul 1 16:52:03 CDT 2013
Author: mmichelson
Date: Mon Jul 1 16:52:01 2013
New Revision: 393367
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393367
Log:
Do some renaming of flags and function callbacks for clarity.
Modified:
team/mmichelson/atxfer_features/main/bridging_basic.c
Modified: team/mmichelson/atxfer_features/main/bridging_basic.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/main/bridging_basic.c?view=diff&rev=393367&r1=393366&r2=393367
==============================================================================
--- team/mmichelson/atxfer_features/main/bridging_basic.c (original)
+++ team/mmichelson/atxfer_features/main/bridging_basic.c Mon Jul 1 16:52:01 2013
@@ -1177,13 +1177,15 @@
*/
enum attended_transfer_state_flags {
/*! This state has a time limit associated with it */
- TRANSFER_STATE_IS_TIMED = (1 << 0),
+ TRANSFER_STATE_FLAG_TIMED = (7 << 0),
/*! This state requires that the timer be reset when entering the state */
- TRANSFER_STATE_RESET_TIMER = (1 << 1),
+ TRANSFER_STATE_FLAG_TIMER_RESET = (1 << 0),
+ /*! This state's timer uses atxferloopdelay */
+ TRANSFER_STATE_FLAG_TIMER_LOOP_DELAY = (1 << 1),
+ /*! This state's timer uses atxfernoanswertimeout */
+ TRANSFER_STATE_FLAG_ATXFER_NO_ANSWER = (1 << 2),
/*! This state does not transition to any other states */
- TRANSFER_STATE_IS_TERMINAL = (1 << 2),
- /*! This state's timer uses atxferloopdelay instead of atxfernoanswertimeout */
- TRANSFER_STATE_TIMER_LOOP_DELAY = (1 << 3),
+ TRANSFER_STATE_FLAG_TERMINAL = (1 << 3),
};
static int calling_target_enter(struct attended_transfer_properties *props);
@@ -1256,28 +1258,28 @@
.state_name = "Calling Target",
.enter = calling_target_enter,
.exit = calling_target_exit,
- .flags = TRANSFER_STATE_IS_TIMED | TRANSFER_STATE_RESET_TIMER,
+ .flags = TRANSFER_STATE_FLAG_ATXFER_NO_ANSWER | TRANSFER_STATE_FLAG_TIMER_RESET,
},
[TRANSFER_HESITANT] = {
.state_name = "Hesitant",
.enter = hesitant_enter,
.exit = hesitant_exit,
- .flags = TRANSFER_STATE_IS_TIMED,
+ .flags = TRANSFER_STATE_FLAG_ATXFER_NO_ANSWER,
},
[TRANSFER_REBRIDGE] = {
.state_name = "Rebridge",
.enter = rebridge_enter,
- .flags = TRANSFER_STATE_IS_TERMINAL,
+ .flags = TRANSFER_STATE_FLAG_TERMINAL,
},
[TRANSFER_RESUME] = {
.state_name = "Resume",
.enter = resume_enter,
- .flags = TRANSFER_STATE_IS_TERMINAL,
+ .flags = TRANSFER_STATE_FLAG_TERMINAL,
},
[TRANSFER_THREEWAY] = {
.state_name = "Threeway",
.enter = threeway_enter,
- .flags = TRANSFER_STATE_IS_TERMINAL,
+ .flags = TRANSFER_STATE_FLAG_TERMINAL,
},
[TRANSFER_CONSULTING] = {
.state_name = "Consulting",
@@ -1292,47 +1294,47 @@
[TRANSFER_COMPLETE] = {
.state_name = "Complete",
.enter = complete_enter,
- .flags = TRANSFER_STATE_IS_TERMINAL,
+ .flags = TRANSFER_STATE_FLAG_TERMINAL,
},
[TRANSFER_BLOND] = {
.state_name = "Blond",
.enter = blond_enter,
- .flags = TRANSFER_STATE_IS_TERMINAL,
+ .flags = TRANSFER_STATE_FLAG_TERMINAL,
},
[TRANSFER_BLOND_NONFINAL] = {
.state_name = "Blond Non-Final",
.enter = blond_nonfinal_enter,
.exit = blond_nonfinal_exit,
- .flags = TRANSFER_STATE_IS_TIMED,
+ .flags = TRANSFER_STATE_FLAG_ATXFER_NO_ANSWER,
},
[TRANSFER_RECALLING] = {
.state_name = "Recalling",
.enter = recalling_enter,
.exit = recalling_exit,
- .flags = TRANSFER_STATE_IS_TIMED | TRANSFER_STATE_RESET_TIMER,
+ .flags = TRANSFER_STATE_FLAG_ATXFER_NO_ANSWER | TRANSFER_STATE_FLAG_TIMER_RESET,
},
[TRANSFER_WAIT_TO_RETRANSFER] = {
.state_name = "Wait to Retransfer",
.enter = wait_to_retransfer_enter,
.exit = wait_to_retransfer_exit,
- .flags = TRANSFER_STATE_IS_TIMED | TRANSFER_STATE_RESET_TIMER | TRANSFER_STATE_TIMER_LOOP_DELAY,
+ .flags = TRANSFER_STATE_FLAG_TIMER_RESET | TRANSFER_STATE_FLAG_TIMER_LOOP_DELAY,
},
[TRANSFER_RETRANSFER] = {
.state_name = "Retransfer",
.enter = retransfer_enter,
.exit = retransfer_exit,
- .flags = TRANSFER_STATE_IS_TIMED | TRANSFER_STATE_RESET_TIMER,
+ .flags = TRANSFER_STATE_FLAG_ATXFER_NO_ANSWER | TRANSFER_STATE_FLAG_TIMER_RESET,
},
[TRANSFER_WAIT_TO_RECALL] = {
.state_name = "Wait to Recall",
.enter = wait_to_recall_enter,
.exit = wait_to_recall_exit,
- .flags = TRANSFER_STATE_IS_TIMED | TRANSFER_STATE_RESET_TIMER | TRANSFER_STATE_TIMER_LOOP_DELAY,
+ .flags = TRANSFER_STATE_FLAG_TIMER_RESET | TRANSFER_STATE_FLAG_TIMER_LOOP_DELAY,
},
[TRANSFER_FAIL] = {
.state_name = "Fail",
.enter = fail_enter,
- .flags = TRANSFER_STATE_IS_TERMINAL,
+ .flags = TRANSFER_STATE_FLAG_TERMINAL,
},
};
@@ -2095,18 +2097,18 @@
SCOPED_MUTEX(lock, &props->lock);
while (!(list = AST_LIST_REMOVE_HEAD(&props->stimulus_queue, next))) {
- if (!(state_properties[props->state].flags & TRANSFER_STATE_IS_TIMED)) {
+ if (!(state_properties[props->state].flags & TRANSFER_STATE_FLAG_TIMED)) {
ast_cond_wait(&props->cond, lock);
} else {
struct timeval relative_timeout;
struct timeval absolute_timeout;
struct timespec timeout_arg;
- if (state_properties[props->state].flags & TRANSFER_STATE_RESET_TIMER) {
+ if (state_properties[props->state].flags & TRANSFER_STATE_FLAG_TIMER_RESET) {
props->start = ast_tvnow();
}
- if (state_properties[props->state].flags & TRANSFER_STATE_TIMER_LOOP_DELAY) {
+ if (state_properties[props->state].flags & TRANSFER_STATE_FLAG_TIMER_LOOP_DELAY) {
relative_timeout = ast_samp2tv(props->atxferloopdelay, 1000);
} else {
relative_timeout = ast_samp2tv(props->atxfernoanswertimeout, 1000);
@@ -2139,7 +2141,7 @@
break;
}
- if (state_properties[props->state].flags & TRANSFER_STATE_IS_TERMINAL) {
+ if (state_properties[props->state].flags & TRANSFER_STATE_FLAG_TERMINAL) {
ast_log(LOG_NOTICE, "State is a terminal state, so we have left it\n");
break;
}
More information about the asterisk-commits
mailing list