@ -669,7 +669,8 @@ static int parkinglot_hash_cb(const void *obj, const int flags)
static int parkinglot_cmp_cb ( void * obj , void * arg , int flags )
static int parkinglot_cmp_cb ( void * obj , void * arg , int flags )
{
{
struct ast_parkinglot * parkinglot = obj , * parkinglot2 = arg ;
struct ast_parkinglot * parkinglot = obj ;
struct ast_parkinglot * parkinglot2 = arg ;
return ! strcasecmp ( parkinglot - > name , parkinglot2 - > name ) ? CMP_MATCH | CMP_STOP : 0 ;
return ! strcasecmp ( parkinglot - > name , parkinglot2 - > name ) ? CMP_MATCH | CMP_STOP : 0 ;
}
}
@ -2260,6 +2261,7 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st
if ( newchan | | ast_check_hangup ( transferee ) ) {
if ( newchan | | ast_check_hangup ( transferee ) ) {
break ;
break ;
}
}
+ + tries ;
+ + tries ;
if ( atxfercallbackretries < = tries ) {
if ( atxfercallbackretries < = tries ) {
/* No more callback tries remaining. */
/* No more callback tries remaining. */
@ -3155,6 +3157,7 @@ static struct ast_channel *feature_request_and_dial(struct ast_channel *caller,
}
}
} else if ( chan = = active_channel ) {
} else if ( chan = = active_channel ) {
if ( ! ast_strlen_zero ( chan - > call_forward ) ) {
if ( ! ast_strlen_zero ( chan - > call_forward ) ) {
state = 0 ;
chan = ast_call_forward ( caller , chan , NULL , tmp_cap , NULL , & state ) ;
chan = ast_call_forward ( caller , chan , NULL , tmp_cap , NULL , & state ) ;
if ( ! chan ) {
if ( ! chan ) {
break ;
break ;
@ -3438,7 +3441,10 @@ static void clear_dialed_interfaces(struct ast_channel *chan)
/*!
/*!
* \ brief bridge the call and set CDR
* \ brief bridge the call and set CDR
* \ param chan , peer , config
*
* \ param chan The bridge considers this channel the caller .
* \ param peer The bridge considers this channel the callee .
* \ param config Configuration for this bridge .
*
*
* Set start time , check for two channels , check if monitor on
* Set start time , check for two channels , check if monitor on
* check for feature activation , create new CDR
* check for feature activation , create new CDR
@ -4357,8 +4363,8 @@ static void *do_parking_thread(void *ignore)
struct ao2_iterator iter ;
struct ao2_iterator iter ;
struct ast_parkinglot * curlot ;
struct ast_parkinglot * curlot ;
int ms = - 1 ; /* poll2 timeout, uninitialized */
int ms = - 1 ; /* poll2 timeout, uninitialized */
iter = ao2_iterator_init ( parkinglots , 0 ) ;
iter = ao2_iterator_init ( parkinglots , 0 ) ;
while ( ( curlot = ao2_iterator_next ( & iter ) ) ) {
while ( ( curlot = ao2_iterator_next ( & iter ) ) ) {
manage_parkinglot ( curlot , pfds , nfds , & new_pfds , & new_nfds , & ms ) ;
manage_parkinglot ( curlot , pfds , nfds , & new_pfds , & new_nfds , & ms ) ;
ao2_ref ( curlot , - 1 ) ;
ao2_ref ( curlot , - 1 ) ;
@ -5078,8 +5084,9 @@ static int load_config(void)
if ( ( sscanf ( var - > value , " %30d " , & transferdigittimeout ) ! = 1 ) | | ( transferdigittimeout < 1 ) ) {
if ( ( sscanf ( var - > value , " %30d " , & transferdigittimeout ) ! = 1 ) | | ( transferdigittimeout < 1 ) ) {
ast_log ( LOG_WARNING , " %s is not a valid transferdigittimeout \n " , var - > value ) ;
ast_log ( LOG_WARNING , " %s is not a valid transferdigittimeout \n " , var - > value ) ;
transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT ;
transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT ;
} else
} else {
transferdigittimeout = transferdigittimeout * 1000 ;
transferdigittimeout = transferdigittimeout * 1000 ;
}
} else if ( ! strcasecmp ( var - > name , " featuredigittimeout " ) ) {
} else if ( ! strcasecmp ( var - > name , " featuredigittimeout " ) ) {
if ( ( sscanf ( var - > value , " %30d " , & featuredigittimeout ) ! = 1 ) | | ( featuredigittimeout < 1 ) ) {
if ( ( sscanf ( var - > value , " %30d " , & featuredigittimeout ) ! = 1 ) | | ( featuredigittimeout < 1 ) ) {
ast_log ( LOG_WARNING , " %s is not a valid featuredigittimeout \n " , var - > value ) ;
ast_log ( LOG_WARNING , " %s is not a valid featuredigittimeout \n " , var - > value ) ;
@ -5089,14 +5096,16 @@ static int load_config(void)
if ( ( sscanf ( var - > value , " %30d " , & atxfernoanswertimeout ) ! = 1 ) | | ( atxfernoanswertimeout < 1 ) ) {
if ( ( sscanf ( var - > value , " %30d " , & atxfernoanswertimeout ) ! = 1 ) | | ( atxfernoanswertimeout < 1 ) ) {
ast_log ( LOG_WARNING , " %s is not a valid atxfernoanswertimeout \n " , var - > value ) ;
ast_log ( LOG_WARNING , " %s is not a valid atxfernoanswertimeout \n " , var - > value ) ;
atxfernoanswertimeout = DEFAULT_NOANSWER_TIMEOUT_ATTENDED_TRANSFER ;
atxfernoanswertimeout = DEFAULT_NOANSWER_TIMEOUT_ATTENDED_TRANSFER ;
} else
} else {
atxfernoanswertimeout = atxfernoanswertimeout * 1000 ;
atxfernoanswertimeout = atxfernoanswertimeout * 1000 ;
}
} else if ( ! strcasecmp ( var - > name , " atxferloopdelay " ) ) {
} else if ( ! strcasecmp ( var - > name , " atxferloopdelay " ) ) {
if ( ( sscanf ( var - > value , " %30u " , & atxferloopdelay ) ! = 1 ) ) {
if ( ( sscanf ( var - > value , " %30u " , & atxferloopdelay ) ! = 1 ) ) {
ast_log ( LOG_WARNING , " %s is not a valid atxferloopdelay \n " , var - > value ) ;
ast_log ( LOG_WARNING , " %s is not a valid atxferloopdelay \n " , var - > value ) ;
atxferloopdelay = DEFAULT_ATXFER_LOOP_DELAY ;
atxferloopdelay = DEFAULT_ATXFER_LOOP_DELAY ;
} else
} else {
atxferloopdelay * = 1000 ;
atxferloopdelay * = 1000 ;
}
} else if ( ! strcasecmp ( var - > name , " atxferdropcall " ) ) {
} else if ( ! strcasecmp ( var - > name , " atxferdropcall " ) ) {
atxferdropcall = ast_true ( var - > value ) ;
atxferdropcall = ast_true ( var - > value ) ;
} else if ( ! strcasecmp ( var - > name , " atxfercallbackretries " ) ) {
} else if ( ! strcasecmp ( var - > name , " atxfercallbackretries " ) ) {
@ -5107,12 +5116,13 @@ static int load_config(void)
} else if ( ! strcasecmp ( var - > name , " courtesytone " ) ) {
} else if ( ! strcasecmp ( var - > name , " courtesytone " ) ) {
ast_copy_string ( courtesytone , var - > value , sizeof ( courtesytone ) ) ;
ast_copy_string ( courtesytone , var - > value , sizeof ( courtesytone ) ) ;
} else if ( ! strcasecmp ( var - > name , " parkedplay " ) ) {
} else if ( ! strcasecmp ( var - > name , " parkedplay " ) ) {
if ( ! strcasecmp ( var - > value , " both " ) )
if ( ! strcasecmp ( var - > value , " both " ) ) {
parkedplay = 2 ;
parkedplay = 2 ;
else if ( ! strcasecmp ( var - > value , " parked " ) )
} else if ( ! strcasecmp ( var - > value , " parked " ) ) {
parkedplay = 1 ;
parkedplay = 1 ;
else
} else {
parkedplay = 0 ;
parkedplay = 0 ;
}
} else if ( ! strcasecmp ( var - > name , " xfersound " ) ) {
} else if ( ! strcasecmp ( var - > name , " xfersound " ) ) {
ast_copy_string ( xfersound , var - > value , sizeof ( xfersound ) ) ;
ast_copy_string ( xfersound , var - > value , sizeof ( xfersound ) ) ;
} else if ( ! strcasecmp ( var - > name , " xferfailsound " ) ) {
} else if ( ! strcasecmp ( var - > name , " xferfailsound " ) ) {
@ -5132,9 +5142,10 @@ static int load_config(void)
unmap_features ( ) ;
unmap_features ( ) ;
for ( var = ast_variable_browse ( cfg , " featuremap " ) ; var ; var = var - > next ) {
for ( var = ast_variable_browse ( cfg , " featuremap " ) ; var ; var = var - > next ) {
if ( remap_feature ( var - > name , var - > value ) )
if ( remap_feature ( var - > name , var - > value ) ) {
ast_log ( LOG_NOTICE , " Unknown feature '%s' \n " , var - > name ) ;
ast_log ( LOG_NOTICE , " Unknown feature '%s' \n " , var - > name ) ;
}
}
}
/* Map a key combination to an application */
/* Map a key combination to an application */
ast_unregister_features ( ) ;
ast_unregister_features ( ) ;
@ -5236,23 +5247,27 @@ static int load_config(void)
/* Is this a parkinglot definition ? */
/* Is this a parkinglot definition ? */
if ( ! strncasecmp ( ctg , " parkinglot_ " , strlen ( " parkinglot_ " ) ) ) {
if ( ! strncasecmp ( ctg , " parkinglot_ " , strlen ( " parkinglot_ " ) ) ) {
ast_debug ( 2 , " Found configuration section %s, assume parking context \n " , ctg ) ;
ast_debug ( 2 , " Found configuration section %s, assume parking context \n " , ctg ) ;
if ( ! build_parkinglot ( ctg , ast_variable_browse ( cfg , ctg ) ) )
if ( ! build_parkinglot ( ctg , ast_variable_browse ( cfg , ctg ) ) ) {
ast_log ( LOG_ERROR , " Could not build parking lot %s. Configuration error. \n " , ctg ) ;
ast_log ( LOG_ERROR , " Could not build parking lot %s. Configuration error. \n " , ctg ) ;
else
} else {
ast_debug ( 1 , " Configured parking context %s \n " , ctg ) ;
ast_debug ( 1 , " Configured parking context %s \n " , ctg ) ;
}
continue ;
continue ;
}
}
/* No, check if it's a group */
/* No, check if it's a group */
for ( i = 0 ; i < ARRAY_LEN ( categories ) ; i + + ) {
for ( i = 0 ; i < ARRAY_LEN ( categories ) ; i + + ) {
if ( ! strcasecmp ( categories [ i ] , ctg ) )
if ( ! strcasecmp ( categories [ i ] , ctg ) ) {
break ;
break ;
}
}
}
if ( i < ARRAY_LEN ( categories ) )
if ( i < ARRAY_LEN ( categories ) ) {
continue ;
continue ;
}
if ( ! ( fg = register_group ( ctg ) ) )
if ( ! ( fg = register_group ( ctg ) ) ) {
continue ;
continue ;
}
for ( var = ast_variable_browse ( cfg , ctg ) ; var ; var = var - > next ) {
for ( var = ast_variable_browse ( cfg , ctg ) ; var ; var = var - > next ) {
struct ast_call_feature * feature ;
struct ast_call_feature * feature ;
@ -5993,18 +6008,20 @@ int ast_bridge_timelimit(struct ast_channel *chan, struct ast_bridge_config *con
} else if ( ( delta = config - > play_warning - config - > timelimit ) > 0 ) {
} else if ( ( delta = config - > play_warning - config - > timelimit ) > 0 ) {
int w = config - > warning_freq ;
int w = config - > warning_freq ;
/* If the first warning is requested _after_ the entire call would end,
/*
and no warning frequency is requested , then turn off the warning . If
* If the first warning is requested _after_ the entire call
a warning frequency is requested , reduce the ' first warning ' time by
* would end , and no warning frequency is requested , then turn
that frequency until it falls within the call ' s total time limit .
* off the warning . If a warning frequency is requested , reduce
Graphically :
* the ' first warning ' time by that frequency until it falls
timelim - > | delta | < - playwarning
* within the call ' s total time limit .
0 __________________ | _________________ |
*
| w | | | |
* Graphically :
* timelim - > | delta | < - playwarning
so the number of intervals to cut is 1 + ( delta - 1 ) / w
* 0 __________________ | _________________ |
* | w | | | |
*
* so the number of intervals to cut is 1 + ( delta - 1 ) / w
*/
*/
if ( w = = 0 ) {
if ( w = = 0 ) {
config - > play_warning = 0 ;
config - > play_warning = 0 ;
} else {
} else {
@ -6261,9 +6278,9 @@ int ast_features_init(void)
}
}
res | = ast_devstate_prov_add ( " Park " , metermaidstate ) ;
res | = ast_devstate_prov_add ( " Park " , metermaidstate ) ;
# if def TEST_FRAMEWORK
# if defined(TEST_FRAMEWORK)
res | = AST_TEST_REGISTER ( features_test ) ;
res | = AST_TEST_REGISTER ( features_test ) ;
# endif
# endif /* defined(TEST_FRAMEWORK) */
return res ;
return res ;
}
}