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

Method TUWriteHighSideV

SIP/SIPTransaction.cpp:567–591  ·  view source on GitHub ↗

It is hardly worth the effort to make a transaction for REGISTER, which occurs outside a dialog and has only one reply, but we need to know when to destroy it.

Source from the content-addressed store, hash-verified

565// It is hardly worth the effort to make a transaction for REGISTER, which occurs outside a dialog
566// and has only one reply, but we need to know when to destroy it.
567void SipRegisterTU::TUWriteHighSideV(SipMessage *sipmsg) {
568 int code = sipmsg->msmCode;
569 static const char *pRejectCauseHeader = "P-GSM-Reject-Cause";
570 LOG(DEBUG) <<LOGVAR(code);
571 if (code == 0) {
572 // A register transaction does not receive any requests.
573 LOG(ERR) << "Register SIP TU received unexpected message:"<<sipmsg;
574 stDestroyV();
575 } else if (code == 401) {
576 //setDialogState(Fail,sipmsg);
577 sendAuthFailMessage(code,sipmsg->smGetRand401(),sipmsg->msmHeaders.paramFind(pRejectCauseHeader));
578 setTransactionState(stCompleted);
579 } else if (code == 200) {
580 // (pat) We can no longer stash Kc directly in the TMSI table because the entry is not created until the MS is validated.
581 //stashAuthInfo(sipmsg); // Stash the Kc from the message.
582 sendAuthOKMessage(sipmsg);
583 } else switch ((code/100) * 100) {
584 // These SetDialogState are really only for in-dialog messages.
585 case 100: return; // we dont care.
586 case 200: LOG(ERR) << "invalid SIP REGISTER code:"<<code; // Code in the range 201-299 is allegedly impossible.
587 default:
588 sendAuthFailMessage(code,"",sipmsg->msmHeaders.paramFind(pRejectCauseHeader));
589 return;
590 }
591}
592
593SipRegisterTU::SipRegisterTU(SipDialog *registrar, SipMessage *request)
594{

Callers

nothing calls this directly

Calls 2

smGetRand401Method · 0.80
paramFindMethod · 0.45

Tested by

no test coverage detected