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

Re: [reSIProcate-users] Dum/test/BasicCall.cxx question


Ending the TestUac end causes the onTerminated callback with a NULL message parameter.  Basicall blindly just tries to log the message without first checking it.  I’ll commit a fix for this to SVN:

 

      virtual void onTerminated(InviteSessionHandle, InviteSessionHandler::TerminatedReason reason, const SipMessage* msg)

      {

         if(msg)

         {

            cout << name << ": InviteSession-onTerminated - " << msg->brief() << endl;

         }

         else

         {

            cout << name << ": InviteSession-onTerminated" << endl;

         }

         done = true;

      }

 

Scott

 

From: resiprocate-users-bounces@xxxxxxxxxxxxxxx [mailto:resiprocate-users-bounces@xxxxxxxxxxxxxxx] On Behalf Of Andy Pyles
Sent: Wednesday, August 27, 2008 1:44 PM
To: resiprocate-users@xxxxxxxxxxxxxxx
Subject: [reSIProcate-users] Dum/test/BasicCall.cxx question

 

Hello,

I'm looking into building a useragent with DUM and had a question on how to initiate a BYE from the UAC.
In the TestUac class if I add one line( is->end() ) to  onConnected(), I expected the UAC to send a BYE, but it doesn't send a bye and causes a crash.


class TestUac : public TestInviteSessionHandler
{
...
 virtual void onConnected(ClientInviteSessionHandle is, const SipMessage& msg)
      {
         cout << name << ": ClientInviteSession-onConnected - " << msg.brief() << endl;
         cout << "Connected now - requestingOffer from UAS" << endl;
         is->requestOffer();
    
         is->end();  <------------
      }

}

However, in the TestUas class if I add one line to onAnswer(), the UAS sends a BYE and the test completes correctly.


class TestUas : public TestInviteSessionHandler
{
...
 virtual void onAnswer(InviteSessionHandle is, const SipMessage& msg, const SdpContents& sdp)     
      {
         cout << name << ": InviteSession-onAnswer(SDP)" << endl;
         if(*pHangupAt == 0)
         {
            is->provideOffer(sdp);
            *pHangupAt = time(NULL) + 5;
         }
         cout << "ending!!!!!!\n";
         is->end();  <------------------
         done=true;
      }
}
Any ideas why this is occuring?

Thanks
Andy