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

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


Sorry, I know this problem now, please ignore my problem.
Thanks

On Tue, Apr 15, 2008 at 11:59 AM, Karlsson <boost.regex@xxxxxxxxx> wrote:
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.