never do anything when you call switch_channel_answer on an outbound channel leg
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16970 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
ad26df3709
commit
38b36e91af
|
@ -2370,6 +2370,10 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
|
|||
|
||||
switch_assert(channel != NULL);
|
||||
|
||||
if (switch_channel_test_flag(channel, CF_OUTBOUND)) {
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (channel->hangup_cause || channel->state >= CS_HANGUP) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
@ -2377,12 +2381,11 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
|
|||
if (switch_channel_test_flag(channel, CF_ANSWERED)) {
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
msg.message_id = SWITCH_MESSAGE_INDICATE_ANSWER;
|
||||
msg.from = channel->name;
|
||||
status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
|
||||
|
||||
if (!switch_channel_test_flag(channel, CF_OUTBOUND)) {
|
||||
msg.message_id = SWITCH_MESSAGE_INDICATE_ANSWER;
|
||||
msg.from = channel->name;
|
||||
status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
|
||||
}
|
||||
|
||||
if (status == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_perform_mark_answered(channel, file, func, line);
|
||||
|
|
Loading…
Reference in New Issue