< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate] Mapping SipMessage to TransactionState


Hi,

I am trying to understand some of ther inner workings of the stack..
Especially the mapping of a SipMessage to a TransactionState.
SipMessage::getTransactionId() is used to see if an existing
TransactionState exists fot this tid. Looking at
SipMessage::getTransactionId(), it just looks up the transactionId on
the BranchParameter on the Via header. 

As per a suggestion earlier, I am now calling
msg.header(h_Vias).front().param(p_branch).reset();
for each SUBSCRIBE.

My question is: I expected transactionId to be a function of some of the
headers in the message (like cseq, callid etc), but from the following
code, it looks like it is a random number.

Can someone explain please?

void
BranchParameter::reset(const Data& transactionId)
{
   mHasMagicCookie = true;
   mIsMyBranch = true;

   mTransportSeq = 1;
   if (!transactionId.empty())
   {
      mTransactionId = transactionId;
   }
   else
   {
      mTransactionId = Random::getRandomHex(8);
   }
}

-- 
Sandeep Sharma <ssharma@xxxxxxxxxx>