MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / handleUssdBye

Method handleUssdBye

SIP/SIPDialog.cpp:717–740  ·  view source on GitHub ↗

The incoming USSD BYE message could have a payload to be sent to the MS.

Source from the content-addressed store, hash-verified

715
716// The incoming USSD BYE message could have a payload to be sent to the MS.
717void SipDialog::handleUssdBye(SipMessage *msg)
718{
719 // There could be multiple BYE messages, hopefully all identical, but we only want to send one DialogMessage.
720 if (getSipState() == Cleared) return;
721 DialogUssdMessage *dmsg = new DialogUssdMessage(mTranId,DialogState::dialogBye,0);
722 // Is it is ok for there to be no response string?
723 // We have to send something to the MS so in that case return an empty string.
724 if (msg->smGetMessageContentType().find("application/vnd.3gpp.ussd+xml") == string::npos) {
725 LOG(INFO) << "UUSD response does not contain correct body type";
726 } else {
727 dmsg->dmMsgPayload = xmlFind(msg->smGetMessageBody().c_str(),"ussd-string");
728 if (dmsg->dmMsgPayload == "") {
729 // This is ok.
730 LOG(INFO) << "Missing UUSD response does not contain correct body type";
731 }
732 }
733 dialogQueueMessage(dmsg);
734 if (dsPeer()->ipIsReliableTransport()) {
735 dialogPushState(Cleared,0);
736 } else {
737 dialogPushState(MTDClearing,0);
738 setTimerJ();
739 }
740}
741
742
743// The SIPInterface sends this to us based on mCallId.

Callers

nothing calls this directly

Calls 5

xmlFindFunction · 0.85
findMethod · 0.80
smGetMessageBodyMethod · 0.80
ipIsReliableTransportMethod · 0.80

Tested by

no test coverage detected