From 5f79d5a3195e152c233685eb75f5a9e50f7d3006 Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 6 Aug 2019 17:50:20 +0200 Subject: [PATCH] Fix bug with MO calls not connecting. Fixes a bug I introduced in 5f73c2033b6b4e690f30292020d7361f48b5f2c2 where we would not call mncc_call_leg_connect() on receiving 200 from SIP side, and therefore never send MNCC_SETUP_RSP to the MS Fixes: 5f73c2033b6b4e690f30292020d7361f48b5f2c2 Change-Id: Ic7cc56c0d68a27eb1229c0c4aa1fa54d00b660b6 --- src/sip.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sip.c b/src/sip.c index b652b4b..4eb7689 100644 --- a/src/sip.c +++ b/src/sip.c @@ -332,11 +332,13 @@ void nua_callback(nua_event_t event, int status, char const *phrase, nua_t *nua, if (status == 180 || status == 183) call_progress(leg, sip, status); else if (status == 200) { - struct sip_call_leg *leg = sip_find_leg(nh); - if (leg) + if (leg->state == SIP_CC_CONNECTED || leg->state == SIP_CC_HOLD) { + /* This 200 is a response to our re-INVITE on + * a connected call. We just need to ACK it. */ nua_ack(leg->nua_handle, TAG_END()); - else + } else { call_connect(leg, sip); + } } else if (status >= 300) { struct call_leg *other = call_leg_other(&leg->base);