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

Method handleSMSResponse

SIP/SIPBase.cpp:679–703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

677
678
679void SipMOInviteClientTransactionLayer::handleSMSResponse(SipMessage *sipmsg)
680{
681 // There are only three cases, and here they are:
682 stopTimers();
683 int code = sipmsg->smGetCode();
684 if (code < 200) {
685 // (pat) 11-26 This was wrong: mTimerBF.set(64*T1);
686 return; // Ignore 100 Trying.
687 }
688 // Smqueue incorrectly requires us to add a from-tag, and sends a 400 error if we dont.
689 // So if we get a 400 error, see if the user agent is blank (which is what smqueue does, yate adds a correct user-agent)
690 // then make an attempt to redeliver the message with a from-tag.
691 // What a botch-up.
692 if (code == 400) {
693 string useragent = sipmsg->msmHeaders.paramFind("User-Agent");
694 if (useragent == "") {
695 LOG(INFO) << "Message delivery failed; no user-agent specified. Assuming smqueue and resending MESSAGE";
696 gPeerIsBuggySmqueue = true;
697 // Resend the message, and this time it will add the from-tag.
698 if (dgGetDialog()->MOSMSRetry()) { return; }
699 }
700 }
701 dialogPushState((code/100)*100 == 200 ? Cleared : SSFail,code);
702 mTimerK.setOnce(T4); // 17.1.2.2: Timer K Controls when the dialog is destroyed.
703}
704
705void SipInviteServerTransactionLayerBase::SipMTCancel(SipMessage *sipmsg)
706{

Callers

nothing calls this directly

Calls 4

smGetCodeMethod · 0.80
MOSMSRetryMethod · 0.80
setOnceMethod · 0.80
paramFindMethod · 0.45

Tested by

no test coverage detected