예제 #1
0
void InviteSessionHandler::onTerminated(resip::InviteSessionHandle handle,
      resip::InviteSessionHandler::TerminatedReason reason,
      const resip::SipMessage* related)
{
   // TODO: add TerminatedReason
   callHandler(handle->getAppDialogSet(), "terminated", &handle, 0, 0,
         related, 0);
}
예제 #2
0
파일: SIPEngine.cpp 프로젝트: pdumais/dhas
void SIPEngine::onConnected(resip::InviteSessionHandle is, const resip::SipMessage& msg)
{
    Call *call = (Call*)is->getAppDialogSet().get();
    if (call)
    {
        call->mCallState = Answered;
        Dumais::Sound::RTPSession *rtpSession = call->getRTPSession();
        rtpSession->start();
        mpObserver->onConnectedUas(call);
    }
}
예제 #3
0
파일: SIPEngine.cpp 프로젝트: pdumais/dhas
void SIPEngine::onAnswer(resip::InviteSessionHandle is, const resip::SipMessage& msg, const resip::SdpContents& sdp)
{
    Call *pCall = (Call*)is->getAppDialogSet().get();

    const char* peerIP = sdp.session().origin().getAddress().c_str();
    unsigned int peerPort = sdp.session().media().front().port();

    LOG("Outgoing call was answered. SDP: "<<peerIP<<":"<<peerPort);

    Dumais::Sound::RTPSession *rtpSession = pCall->getRTPSession();
    rtpSession->setPeerAddress(peerIP, peerPort);
    rtpSession->start();

    pCall->mCallState = Answered;
    mpObserver->onAnswer(pCall);

}
예제 #4
0
파일: SIPEngine.cpp 프로젝트: pdumais/dhas
void SIPEngine::onInfo(resip::InviteSessionHandle is, const resip::SipMessage& msg)
{
    Call *call = dynamic_cast<Call*>(is->getAppDialogSet().get());
    is->acceptNIT();

    Mime dtmf(resip::Data("application"), resip::Data("dtmf-relay"));
    Contents* contents = msg.getContents();
    Mime mime = msg.getContents()->getType();
    if (mime.type() == "application" && mime.subType() == "dtmf-relay")
    {
        Data data = msg.getContents()->getBodyData();
        std::istringstream iss(data.c_str());
        std::string digit;
        std::getline(iss, digit,'=');
        iss >> digit;

        mpObserver->onDigit(call,digit);
    }
예제 #5
0
void InviteSessionHandler::onConnectedConfirmed(
      resip::InviteSessionHandle handle, const resip::SipMessage &msg)
{
   callHandler(handle->getAppDialogSet(), "connectedConfirmed", &handle, 0, 0,
         &msg, 0);
}
예제 #6
0
void InviteSessionHandler::onSessionExpired(resip::InviteSessionHandle handle)
{
   callHandler(handle->getAppDialogSet(), "sessionExpired", &handle, 0, 0, 0,
         0);
}
예제 #7
0
void InviteSessionHandler::onInfo(resip::InviteSessionHandle handle,
      const resip::SipMessage& msg)
{
   callHandler(handle->getAppDialogSet(), "info", &handle, 0, 0, &msg, 0);
}
예제 #8
0
void InviteSessionHandler::onOfferRejected(resip::InviteSessionHandle handle,
      const resip::SipMessage* msg)
{
   callHandler(handle->getAppDialogSet(), "offerRejected", &handle, 0, 0, msg,
         0);
}
예제 #9
0
void InviteSessionHandler::onOffer(resip::InviteSessionHandle handle,
      const resip::SipMessage& msg, const resip::SdpContents& sdp)
{
   callHandler(handle->getAppDialogSet(), "offer", &handle, 0, 0, &msg, &sdp);
}