提交 4436b3be authored 作者: Mitch Capper's avatar Mitch Capper

Only try switching to a call if we are not the active call already (exception prevention)

上级 2c5651e7
...@@ -416,7 +416,7 @@ namespace FSClient { ...@@ -416,7 +416,7 @@ namespace FSClient {
private static void HandleChannelAnswerEvent(FSEvent evt, String uuid) { private static void HandleChannelAnswerEvent(FSEvent evt, String uuid) {
Call call = (from c in calls where c.leg_b_uuid == uuid select c).SingleOrDefault(); Call call = (from c in calls where c.leg_b_uuid == uuid select c).SingleOrDefault();
if (call == null) if (call == null || call.state == CALL_STATE.Answered)
return; return;
if (call.state == CALL_STATE.Ringing || (call.state == CALL_STATE.Hold_Ringing && !call.is_outgoing)) if (call.state == CALL_STATE.Ringing || (call.state == CALL_STATE.Hold_Ringing && !call.is_outgoing))
...@@ -585,6 +585,7 @@ namespace FSClient { ...@@ -585,6 +585,7 @@ namespace FSClient {
PortAudio.SendDTMF(dtmf); PortAudio.SendDTMF(dtmf);
} }
public void switch_to() { public void switch_to() {
if (active_call != this)
PortAudio.SwitchTo(portaudio_id); PortAudio.SwitchTo(portaudio_id);
} }
public void create_outgoing_call() { public void create_outgoing_call() {
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论