From 7244fa7271ff88457178406eae4d66a55ce09441 Mon Sep 17 00:00:00 2001 From: Kurtis Heimerl Date: Sat, 25 Feb 2012 21:46:49 +0000 Subject: [PATCH] Fixes #499 in public. If our ACK was missed, the switch would resend an OK and we didn't respond to it. We do now. git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3237 19bc5d8c-e614-43d4-8b26-e1612bc8e597 --- Control/CallControl.cpp | 2 -- SIP/SIPEngine.cpp | 23 +++++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Control/CallControl.cpp b/Control/CallControl.cpp index c9f6b2e..1c454d7 100644 --- a/Control/CallControl.cpp +++ b/Control/CallControl.cpp @@ -915,8 +915,6 @@ void Control::MOCController(TransactionEntry *transaction, GSM::TCHFACCHLogicalC transaction->MOCInitRTP(); transaction->MOCSendACK(); - // FIXME -- We need to watch for a repeated OK in case the ACK got lost. - // Get the Connect Acknowledge message. while (transaction->GSMState()!=GSM::Active) { LOG(DEBUG) << "MOC Q.931 state=" << transaction->GSMState(); diff --git a/SIP/SIPEngine.cpp b/SIP/SIPEngine.cpp index e6f9690..e1a1305 100644 --- a/SIP/SIPEngine.cpp +++ b/SIP/SIPEngine.cpp @@ -696,14 +696,25 @@ SIPState SIPEngine::MTDCheckBYE() osip_message_t * msg = gSIPInterface.read(mCallID); - if ((msg->sip_method!=NULL) && (strcmp(msg->sip_method,"BYE")==0)) { - LOG(DEBUG) << "found msg="<sip_method; - saveBYE(msg,false); - mState = MTDClearing; + if (msg->sip_method) { + if (strcmp(msg->sip_method,"BYE")==0) { + LOG(DEBUG) << "found msg="<sip_method; + saveBYE(msg,false); + mState = MTDClearing; + } + //repeated ACK, send OK + //pretty sure this never happens, but someone else left a fixme before... -kurtis + if (strcmp(msg->sip_method,"ACK")==0) { + LOG(DEBUG) << "Not responding to repeated ACK. FIXME"; + } } - // FIXME -- Check for repeated ACK and send OK if needed. - // FIXME -- Check for repeated OK and send ACK if needed. + //repeated OK, send ack + //MOC because that's the only time we ACK + if (msg->status_code==200){ + LOG(DEBUG) << "Repeated OK, resending ACK"; + MOCSendACK(); + } osip_message_free(msg); return mState;