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

[reSIProcate-users] Logs for answer INVITE(refer INVITE with replace) encounter assert


Hi all, as my yesterday email, now I attached my log files, I try to implement the attended transfer:
 
1: A was established with B, C.
 
2: A transer the B to C with replace
 
3: C received the REFER, then make refer INVITE with replace to B.
 
4: When B receiveing the INVITE from C in onNewSession, I want to answer 200 OK for INVITE, but 
I got assert error in the ServerInviteSession::provideAnswer(), line 365, the mState is UAS_Accepted,
see the logs in attachments files.
 
There are my source code:
void UserAgent::onNewSession(ServerInviteSessionHandle h, InviteSession::OfferAnswerType oat, const SipMessage & msg)
{
    if (msg.exists(h_Replaces) == true)
 {
  pair<InviteSessionHandle, int> replaceSession;
  replaceSession = mDum.findInviteSession(msg.header(h_Replaces));
  if(replaceSession.first == InviteSessionHandle::NotValid())
  {
   int code = replaceSession.second;
  }
  else
  {
   const SdpContents * sdpContents = dynamic_cast<SdpContents * >(msg.getContents());
   long originCallID = replaceSession.first->getCallId().hash();
 
   // To swap context
   SwapContext(....);
 
   replaceSession.first->end(); // end original session

   // To answer this new invite   
   h->provideAnswer(sdpContent);
   h->accept(code);
  }
}
 
please help me, many thanks. 

Attachment: Logs.zip
Description: Zip archive