mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-18 01:28:42 +00:00
add answer_delay variable to sleep N ms when answer is called from the channel thread
This commit is contained in:
parent
b6e3c594c2
commit
8fc477d080
@ -3612,6 +3612,19 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
|
||||
}
|
||||
|
||||
|
||||
if (switch_core_session_in_thread(channel->session)) {
|
||||
const char *delay;
|
||||
|
||||
if ((delay = switch_channel_get_variable(channel, "answer_delay"))) {
|
||||
long msec = atol(delay);
|
||||
|
||||
if (msec) {
|
||||
switch_ivr_sleep(channel->session, msec, SWITCH_TRUE, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user