[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