From e0557be6e9bff76bad4afee70468b1754197385c Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Wed, 1 Oct 2014 15:39:46 +0930 Subject: [PATCH] Send ANSWERED message even if we never see RINGING --- vomp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vomp.c b/vomp.c index 9030f9db..716569e1 100644 --- a/vomp.c +++ b/vomp.c @@ -64,7 +64,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // inform client about the call request $ CALLFROM [token] [mySid] [myDid] [TheirSid] [TheirDid] // Note that we may need to wait for other external processes - // before a phone is actually ringing + // before a phone is actually ringing and we may jump straight to answering the call # RING [token] < RINGIN // All good, there's a phone out there ringing, you can indicate that to the user @@ -671,9 +671,8 @@ static int vomp_update_remote_state(struct vomp_call_state *call, int new_state) monitor_tell_formatted(MONITOR_VOMP, "\nRINGING:%06x\n", call->local.session); break; case VOMP_STATE_INCALL: - if (call->remote.state==VOMP_STATE_RINGINGIN){ + if (call->initiated_call) monitor_tell_formatted(MONITOR_VOMP, "\nANSWERED:%06x\n", call->local.session); - } break; } @@ -994,6 +993,8 @@ int vomp_mdp_received(struct internal_mdp_header *header, struct overlay_buffer if (call->initiated_call){ // hey, quit it, we were trying to call you. + if (config.debug.vomp) + DEBUGF("Rejecting call, invalid state transition"); call->rejection_reason=VOMP_REJECT_BUSY; recvr_state=VOMP_STATE_CALLENDED; }else{ @@ -1012,6 +1013,8 @@ int vomp_mdp_received(struct internal_mdp_header *header, struct overlay_buffer if (call->initiated_call){ recvr_state=VOMP_STATE_RINGINGOUT; }else{ + if (config.debug.vomp) + DEBUGF("Rejecting call, invalid state transition"); recvr_state=VOMP_STATE_CALLENDED; } break;