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

Method makeRequest

SIP/SIPBase.cpp:528–549  ·  view source on GitHub ↗

A request inside an invite is ACK, CANCEL, BYE, INFO, or re-INVITE. The only target-refresh-request is re-INVITE, which can change the "Dialog State". For ACK sec 17.1.1.3 the To must equal the To of the response being acked, which specifically contains a tag. ACK contains only one via == top via of original request with matching branch. TODO: ACK must copy route header fields from INVITE. sec 9.1

Source from the content-addressed store, hash-verified

526// It should not include CONTACT because it is non-target-refresh.
527// Implicit parameters from SipBase: mCallId, mRemoteUsername, mRemoteDomain, mCSeq, etc.
528SipMessage *SipBase::makeRequest(string method,string requestUri, string whoami, SipPreposition*toHeader, SipPreposition*fromHeader, string branch)
529{
530 SipMessage *invite = new SipMessage();
531 invite->msmReqMethod = method;
532 invite->msmCallId = this->mCallId;
533 //string toContact = makeUri(mRemoteUsername,mRemoteDomain); // dialed_number@remote_ip
534 //string fromContact = makeUri(mSipUsername,localIP());
535 //invite->msmReqUri = makeUri(mRemoteUsername,mRemoteDomain);
536 invite->msmReqUri = requestUri;
537 invite->smAddViaBranch(this,branch);
538 invite->msmCSeqMethod = invite->msmReqMethod;
539 invite->msmCSeqNum = mLocalCSeq; // We dont need to advance for an initial request; caller advances if necessary.
540 invite->msmTo = *toHeader;
541 invite->msmFrom = *fromHeader;
542 invite->msmContactValue = localContact(whoami);
543 string prefid = this->preferredIdentity(whoami);
544 static const string cPreferredIdentityString("P-Preferred-Identity");
545 invite->smAddHeader(cPreferredIdentityString,prefid);
546
547 // The caller has not added the content yet: saveInviteOrMessage(invite,true);
548 return invite;
549}
550
551// This is an *initial* request only, for INVITE or MESSAGE.
552// This version generates the request from the values in the DialogStateVars.

Callers

nothing calls this directly

Calls 3

preferredIdentityMethod · 0.95
smAddViaBranchMethod · 0.80
smAddHeaderMethod · 0.80

Tested by

no test coverage detected