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); }
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); } }
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); }
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); }
void InviteSessionHandler::onConnectedConfirmed( resip::InviteSessionHandle handle, const resip::SipMessage &msg) { callHandler(handle->getAppDialogSet(), "connectedConfirmed", &handle, 0, 0, &msg, 0); }
void InviteSessionHandler::onSessionExpired(resip::InviteSessionHandle handle) { callHandler(handle->getAppDialogSet(), "sessionExpired", &handle, 0, 0, 0, 0); }
void InviteSessionHandler::onInfo(resip::InviteSessionHandle handle, const resip::SipMessage& msg) { callHandler(handle->getAppDialogSet(), "info", &handle, 0, 0, &msg, 0); }
void InviteSessionHandler::onOfferRejected(resip::InviteSessionHandle handle, const resip::SipMessage* msg) { callHandler(handle->getAppDialogSet(), "offerRejected", &handle, 0, 0, msg, 0); }
void InviteSessionHandler::onOffer(resip::InviteSessionHandle handle, const resip::SipMessage& msg, const resip::SdpContents& sdp) { callHandler(handle->getAppDialogSet(), "offer", &handle, 0, 0, &msg, &sdp); }