зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 90968836cce3 (bug 784519) on a CLOSED TREE
This commit is contained in:
Родитель
6cffba6575
Коммит
ea26cdbf26
|
@ -765,29 +765,10 @@ RTCPeerConnection.prototype = {
|
|||
sdp: sdp });
|
||||
},
|
||||
|
||||
get signalingState() { return "stable"; }, // not yet implemented
|
||||
get iceGatheringState() { return this._iceGatheringState; },
|
||||
get iceConnectionState() { return this._iceConnectionState; },
|
||||
|
||||
// Corresponds to constants in IPeerConnection.idl
|
||||
_signalingStateMap: [
|
||||
'invalid',
|
||||
'stable',
|
||||
'have-local-offer',
|
||||
'have-remote-offer',
|
||||
'have-local-pranswer',
|
||||
'have-remote-pranswer',
|
||||
'closed'
|
||||
],
|
||||
|
||||
get signalingState() {
|
||||
// checking for our local pc closed indication
|
||||
// before invoking the pc methods.
|
||||
if(this._closed) {
|
||||
return "closed";
|
||||
}
|
||||
return this._signalingStateMap[this._getPC().signalingState];
|
||||
},
|
||||
|
||||
changeIceGatheringState: function(state) {
|
||||
this._iceGatheringState = state;
|
||||
},
|
||||
|
@ -1009,10 +990,14 @@ PeerConnectionObserver.prototype = {
|
|||
this._dompc._executeNext();
|
||||
},
|
||||
|
||||
handleIceStateChanges: function(iceState) {
|
||||
switch (iceState) {
|
||||
onStateChange: function(state) {
|
||||
if (state != Ci.IPeerConnectionObserver.kIceState) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (this._dompc._pc.iceState) {
|
||||
case Ci.IPeerConnection.kIceWaiting:
|
||||
this._dompc.changeIceConnectionState("new");
|
||||
this._dompc.changeIceConnectionState("completed");
|
||||
this.callCB(this._dompc.ongatheringchange, "complete");
|
||||
this.callCB(this._onicechange, "starting");
|
||||
// Now that the PC is ready to go, execute any pending operations.
|
||||
|
@ -1036,33 +1021,7 @@ PeerConnectionObserver.prototype = {
|
|||
this.callCB(this._onicechange, "failed");
|
||||
break;
|
||||
default:
|
||||
// Unknown ICE state!
|
||||
this._dompc.reportWarning("Unhandled ice state: " + iceState, null, 0);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
onStateChange: function(state) {
|
||||
switch (state) {
|
||||
case Ci.IPeerConnectionObserver.kSignalingState:
|
||||
this.callCB(this._dompc.onsignalingstatechange,
|
||||
this._dompc.signalingState);
|
||||
break;
|
||||
|
||||
case Ci.IPeerConnectionObserver.kIceState:
|
||||
this.handleIceStateChanges(this._dompc._pc.iceState);
|
||||
break;
|
||||
|
||||
case Ci.IPeerConnectionObserver.kSdpState:
|
||||
// No-op
|
||||
break;
|
||||
|
||||
case Ci.IPeerConnectionObserver.kSipccState:
|
||||
// No-op
|
||||
break;
|
||||
|
||||
default:
|
||||
this._dompc.reportWarning("Unhandled state type: " + state, null, 0);
|
||||
// Unknown state!
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
|
|
@ -32,7 +32,6 @@ interface IPeerConnectionObserver : nsISupports
|
|||
const long kIceState = 0x2;
|
||||
const long kSdpState = 0x3;
|
||||
const long kSipccState = 0x4;
|
||||
const long kSignalingState = 0x5;
|
||||
|
||||
/* JSEP callbacks */
|
||||
void onCreateOfferSuccess(in string offer);
|
||||
|
@ -92,15 +91,6 @@ interface IPeerConnection : nsISupports
|
|||
const long kClosing = 3;
|
||||
const long kClosed = 4;
|
||||
|
||||
/* RTCSignalingState from WebRTC spec */
|
||||
const long kSignalingInvalid = 0;
|
||||
const long kSignalingStable = 1;
|
||||
const long kSignalingHaveLocalOffer = 2;
|
||||
const long kSignalingHaveRemoteOffer = 3;
|
||||
const long kSignalingHaveLocalPranswer = 4;
|
||||
const long kSignalingHaveRemotePranswer = 5;
|
||||
const long kSignalingClosed = 6;
|
||||
|
||||
/* for 'type' in DataChannelInit dictionary */
|
||||
const unsigned short kDataChannelReliable = 0;
|
||||
const unsigned short kDataChannelPartialReliableRexmit = 1;
|
||||
|
@ -154,7 +144,6 @@ interface IPeerConnection : nsISupports
|
|||
|
||||
readonly attribute unsigned long iceState;
|
||||
readonly attribute unsigned long readyState;
|
||||
readonly attribute unsigned long signalingState;
|
||||
readonly attribute unsigned long sipccState;
|
||||
|
||||
/* Data channels */
|
||||
|
|
|
@ -9,14 +9,12 @@
|
|||
extern "C"
|
||||
{
|
||||
#include "ccapi_types.h"
|
||||
#include "fsmdef_states.h"
|
||||
}
|
||||
|
||||
#include "CC_Common.h"
|
||||
#include "CC_CallTypes.h"
|
||||
#include "peer_connection_types.h"
|
||||
|
||||
|
||||
namespace CSF
|
||||
{
|
||||
|
||||
|
@ -45,13 +43,6 @@ namespace CSF
|
|||
*/
|
||||
virtual cc_call_state_t getCallState () = 0;
|
||||
|
||||
/**
|
||||
get FSM state
|
||||
@param [in] handle - call info handle
|
||||
@return FSM state
|
||||
*/
|
||||
virtual fsmdef_states_t getFsmState () const = 0;
|
||||
|
||||
/**
|
||||
print Call state
|
||||
@param [in] handle - call info handle
|
||||
|
@ -59,13 +50,6 @@ namespace CSF
|
|||
*/
|
||||
virtual std::string callStateToString (cc_call_state_t state) = 0;
|
||||
|
||||
/**
|
||||
print FSM state
|
||||
@param [in] handle - call info handle
|
||||
@return call state as string
|
||||
*/
|
||||
virtual std::string fsmStateToString (fsmdef_states_t state) const = 0;
|
||||
|
||||
/**
|
||||
print Call event
|
||||
@param [in] call event
|
||||
|
|
|
@ -387,7 +387,6 @@
|
|||
'./src/sipcc/core/includes/dns_utils.h',
|
||||
'./src/sipcc/core/includes/dtmf.h',
|
||||
'./src/sipcc/core/includes/embedded.h',
|
||||
'./src/sipcc/core/includes/fsmdef_states.h',
|
||||
'./src/sipcc/core/includes/intelpentiumtypes.h',
|
||||
'./src/sipcc/core/includes/kpml_common_util.h',
|
||||
'./src/sipcc/core/includes/kpmlmap.h',
|
||||
|
|
|
@ -129,9 +129,7 @@ public:
|
|||
mReason(aInfo->getStatus()),
|
||||
mSdpStr(),
|
||||
mCallState(aInfo->getCallState()),
|
||||
mFsmState(aInfo->getFsmState()),
|
||||
mStateStr(aInfo->callStateToString(mCallState)),
|
||||
mFsmStateStr(aInfo->fsmStateToString(mFsmState)) {
|
||||
mStateStr(aInfo->callStateToString(mCallState)) {
|
||||
if (mCallState == REMOTESTREAMADD) {
|
||||
MediaStreamTable *streams = NULL;
|
||||
streams = aInfo->getMediaStreams();
|
||||
|
@ -175,8 +173,7 @@ public:
|
|||
NS_IMETHOD Run() {
|
||||
|
||||
CSFLogInfo(logTag, "PeerConnectionObserverDispatch processing "
|
||||
"mCallState = %d (%s), mFsmState = %d (%s)",
|
||||
mCallState, mStateStr.c_str(), mFsmState, mFsmStateStr.c_str());
|
||||
"mCallState = %d (%s)", mCallState, mStateStr.c_str());
|
||||
|
||||
if (mCallState == SETLOCALDESCERROR || mCallState == SETREMOTEDESCERROR) {
|
||||
const std::vector<std::string> &errors = mPC->GetSdpParseErrors();
|
||||
|
@ -195,23 +192,6 @@ public:
|
|||
mCode, mReason.c_str());
|
||||
}
|
||||
|
||||
/*
|
||||
* While the fsm_states_t (FSM_DEF_*) constants are a proper superset
|
||||
* of SignalingState, and the order in which the SignalingState values
|
||||
* appear matches the order they appear in fsm_states_t, their underlying
|
||||
* numeric representation is different. Hence, we need to perform an
|
||||
* offset calculation to map from one to the other.
|
||||
*/
|
||||
|
||||
if (mFsmState >= FSMDEF_S_STABLE && mFsmState <= FSMDEF_S_CLOSED) {
|
||||
int offset = FSMDEF_S_STABLE - PeerConnectionImpl::kSignalingStable;
|
||||
mPC->SetSignalingState_m(
|
||||
static_cast<PeerConnectionImpl::SignalingState>(mFsmState - offset));
|
||||
} else {
|
||||
CSFLogError(logTag, ": **** UNHANDLED SIGNALING STATE : %d (%s)",
|
||||
mFsmState, mFsmStateStr.c_str());
|
||||
}
|
||||
|
||||
switch (mCallState) {
|
||||
case CREATEOFFERSUCCESS:
|
||||
mObserver->OnCreateOfferSuccess(mSdpStr.c_str());
|
||||
|
@ -310,9 +290,7 @@ private:
|
|||
std::string mReason;
|
||||
std::string mSdpStr;
|
||||
cc_call_state_t mCallState;
|
||||
fsmdef_states_t mFsmState;
|
||||
std::string mStateStr;
|
||||
std::string mFsmStateStr;
|
||||
nsRefPtr<RemoteSourceStreamInfo> mRemoteStream;
|
||||
};
|
||||
|
||||
|
@ -322,7 +300,6 @@ PeerConnectionImpl::PeerConnectionImpl()
|
|||
: mRole(kRoleUnknown)
|
||||
, mCall(NULL)
|
||||
, mReadyState(kNew)
|
||||
, mSignalingState(kSignalingStable)
|
||||
, mIceState(kIceGathering)
|
||||
, mPCObserver(NULL)
|
||||
, mWindow(NULL)
|
||||
|
@ -1232,16 +1209,6 @@ PeerConnectionImpl::GetReadyState(uint32_t* aState)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PeerConnectionImpl::GetSignalingState(uint32_t* aState)
|
||||
{
|
||||
PC_AUTO_ENTER_API_CALL_NO_CHECK();
|
||||
MOZ_ASSERT(aState);
|
||||
|
||||
*aState = mSignalingState;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PeerConnectionImpl::GetSipccState(uint32_t* aState)
|
||||
{
|
||||
|
@ -1408,22 +1375,6 @@ PeerConnectionImpl::ChangeReadyState(PeerConnectionImpl::ReadyState aReadyState)
|
|||
NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
void
|
||||
PeerConnectionImpl::SetSignalingState_m(SignalingState aSignalingState)
|
||||
{
|
||||
PC_AUTO_ENTER_API_CALL_NO_CHECK();
|
||||
if (mSignalingState == aSignalingState) {
|
||||
return;
|
||||
}
|
||||
|
||||
mSignalingState = aSignalingState;
|
||||
nsCOMPtr<IPeerConnectionObserver> pco = do_QueryReferent(mPCObserver);
|
||||
if (!pco) {
|
||||
return;
|
||||
}
|
||||
pco->OnStateChange(IPeerConnectionObserver::kSignalingState);
|
||||
}
|
||||
|
||||
PeerConnectionWrapper::PeerConnectionWrapper(const std::string& handle)
|
||||
: impl_(nullptr) {
|
||||
if (PeerConnectionCtx::GetInstance()->mPeerConnections.find(handle) ==
|
||||
|
|
|
@ -133,18 +133,6 @@ public:
|
|||
kClosed
|
||||
};
|
||||
|
||||
/* Must match constants in IPeerConnection.idl */
|
||||
/* Must also be int the same order as in fsmdef_states.h */
|
||||
enum SignalingState {
|
||||
kSignalingInvalid = 0,
|
||||
kSignalingStable = 1,
|
||||
kSignalingHaveLocalOffer = 2,
|
||||
kSignalingHaveRemoteOffer = 3,
|
||||
kSignalingHaveLocalPranswer = 4,
|
||||
kSignalingHaveRemotePranswer = 5,
|
||||
kSignalingClosed = 6
|
||||
};
|
||||
|
||||
enum SipccState {
|
||||
kIdle,
|
||||
kStarting,
|
||||
|
@ -280,9 +268,6 @@ public:
|
|||
// Called to retreive the list of parsing errors.
|
||||
const std::vector<std::string> &GetSdpParseErrors();
|
||||
|
||||
// Sets the RTC Signaling State
|
||||
void SetSignalingState_m(SignalingState aSignalingState);
|
||||
|
||||
private:
|
||||
PeerConnectionImpl(const PeerConnectionImpl&rhs);
|
||||
PeerConnectionImpl& operator=(PeerConnectionImpl);
|
||||
|
@ -330,7 +315,6 @@ private:
|
|||
// The call
|
||||
CSF::CC_CallPtr mCall;
|
||||
ReadyState mReadyState;
|
||||
SignalingState mSignalingState;
|
||||
|
||||
// ICE State
|
||||
IceState mIceState;
|
||||
|
|
|
@ -396,8 +396,7 @@ PeerConnectionMedia::AddRemoteStream(nsRefPtr<RemoteSourceStreamInfo> aInfo,
|
|||
nsresult
|
||||
PeerConnectionMedia::AddRemoteStreamHint(int aIndex, bool aIsVideo)
|
||||
{
|
||||
if (aIndex < 0 ||
|
||||
static_cast<unsigned int>(aIndex) >= mRemoteSourceStreams.Length()) {
|
||||
if (aIndex >= mRemoteSourceStreams.Length()) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "cpr_threads.h"
|
||||
#include "phone_types.h"
|
||||
#include "session.h"
|
||||
#include "fsmdef_states.h"
|
||||
|
||||
#include "cc_constants.h"
|
||||
#include "ccapi_types.h"
|
||||
|
@ -61,7 +60,6 @@ typedef struct cc_call_info_t_{
|
|||
callid_t id;
|
||||
uint16_t inst;
|
||||
cc_call_state_t state;
|
||||
fsmdef_states_t fsm_state;
|
||||
cc_call_attr_t attr;
|
||||
cc_call_type_t type;
|
||||
cc_call_security_t security;
|
||||
|
|
|
@ -47,25 +47,6 @@ cc_call_state_t CCAPI_CallInfo_getCallState(cc_callinfo_ref_t handle){
|
|||
return ONHOOK;
|
||||
}
|
||||
|
||||
/**
|
||||
* get FSM state
|
||||
* @param handle - call handle
|
||||
* @return call state
|
||||
*/
|
||||
fsmdef_states_t CCAPI_CallInfo_getFsmState(cc_callinfo_ref_t handle){
|
||||
session_data_t *data = (session_data_t *)handle;
|
||||
CCAPP_DEBUG(DEB_F_PREFIX"Entering",
|
||||
DEB_F_PREFIX_ARGS(SIP_CC_PROV, __FUNCTION__));
|
||||
|
||||
if ( data ){
|
||||
CCAPP_DEBUG(DEB_F_PREFIX"returned %02X",
|
||||
DEB_F_PREFIX_ARGS(SIP_CC_PROV, __FUNCTION__), data->state);
|
||||
return data->fsm_state;
|
||||
}
|
||||
|
||||
return FSMDEF_S_IDLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* get call attributes
|
||||
* @param handle - call handle
|
||||
|
|
|
@ -1416,9 +1416,7 @@ static void ccappUpdateSessionData (session_update_t *sessUpd)
|
|||
//Populate the session hash data the first time.
|
||||
memset(data, 0, sizeof(session_data_t));
|
||||
data->sess_id = sessUpd->sessionID;
|
||||
data->state = call_state;
|
||||
data->fsm_state =
|
||||
sessUpd->update.ccSessionUpd.data.state_data.fsm_state;
|
||||
data->state = call_state;
|
||||
data->line = sessUpd->update.ccSessionUpd.data.state_data.line_id;
|
||||
if (sessUpd->eventID == CALL_NEWCALL ||
|
||||
sessUpd->eventID == CREATE_OFFER ||
|
||||
|
@ -1508,12 +1506,8 @@ static void ccappUpdateSessionData (session_update_t *sessUpd)
|
|||
if (createdSessionData == FALSE) {
|
||||
return;
|
||||
}
|
||||
data->state =
|
||||
sessUpd->update.ccSessionUpd.data.state_data.state;
|
||||
data->line =
|
||||
sessUpd->update.ccSessionUpd.data.state_data.line_id;
|
||||
data->fsm_state =
|
||||
sessUpd->update.ccSessionUpd.data.state_data.fsm_state;
|
||||
data->state = sessUpd->update.ccSessionUpd.data.state_data.state;
|
||||
data->line = sessUpd->update.ccSessionUpd.data.state_data.line_id;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1578,8 +1572,6 @@ static void ccappUpdateSessionData (session_update_t *sessUpd)
|
|||
data->state = sessUpd->update.ccSessionUpd.data.state_data.state;
|
||||
}
|
||||
data->line = sessUpd->update.ccSessionUpd.data.state_data.line_id;
|
||||
data->fsm_state =
|
||||
sessUpd->update.ccSessionUpd.data.state_data.fsm_state;
|
||||
sessUpd->update.ccSessionUpd.data.state_data.attr = data->attr;
|
||||
sessUpd->update.ccSessionUpd.data.state_data.inst = data->inst;
|
||||
|
||||
|
@ -1637,10 +1629,8 @@ static void ccappUpdateSessionData (session_update_t *sessUpd)
|
|||
ccsnap_gen_callEvent(CCAPI_CALL_EV_GCID, CREATE_CALL_HANDLE_FROM_SESSION_ID(sessUpd->sessionID));
|
||||
break;
|
||||
case CALL_NEWCALL:
|
||||
data->state = sessUpd->update.ccSessionUpd.data.state_data.state;
|
||||
data->state = sessUpd->update.ccSessionUpd.data.state_data.state;
|
||||
data->line = sessUpd->update.ccSessionUpd.data.state_data.line_id;
|
||||
data->fsm_state =
|
||||
sessUpd->update.ccSessionUpd.data.state_data.fsm_state;
|
||||
data->attr = sessUpd->update.ccSessionUpd.data.state_data.attr;
|
||||
data->inst = sessUpd->update.ccSessionUpd.data.state_data.inst;
|
||||
return;
|
||||
|
@ -1812,8 +1802,6 @@ static void ccappUpdateSessionData (session_update_t *sessUpd)
|
|||
case REMOTE_STREAM_ADD:
|
||||
data->cause = sessUpd->update.ccSessionUpd.data.state_data.cause;
|
||||
data->state = sessUpd->update.ccSessionUpd.data.state_data.state;
|
||||
data->fsm_state =
|
||||
sessUpd->update.ccSessionUpd.data.state_data.fsm_state;
|
||||
data->media_stream_track_id = sessUpd->update.ccSessionUpd.data.state_data.media_stream_track_id;
|
||||
data->media_stream_id = sessUpd->update.ccSessionUpd.data.state_data.media_stream_id;
|
||||
strlib_free(data->status);
|
||||
|
@ -2167,8 +2155,7 @@ void ccappFeatureUpdated (feature_update_t *featUpd) {
|
|||
|
||||
break;
|
||||
case DEVICE_FEATURE_MWILAMP:
|
||||
g_deviceInfo.mwi_lamp =
|
||||
featUpd->update.ccFeatUpd.data.mwi_status.status;
|
||||
g_deviceInfo.mwi_lamp = featUpd->update.ccFeatUpd.data.state_data.state;
|
||||
ccsnap_gen_deviceEvent(CCAPI_DEVICE_EV_MWI_LAMP, CC_DEVICE_ID);
|
||||
break;
|
||||
case DEVICE_FEATURE_BLF:
|
||||
|
|
|
@ -737,7 +737,7 @@ ui_change_mwi_lamp (int status)
|
|||
|
||||
msg.sessionType = SESSIONTYPE_CALLCONTROL;
|
||||
msg.featureID = DEVICE_FEATURE_MWILAMP;
|
||||
msg.update.ccFeatUpd.data.mwi_status.status = status;
|
||||
msg.update.ccFeatUpd.data.state_data.state = status;
|
||||
|
||||
if ( ccappTaskPostMsg(CCAPP_FEATURE_UPDATE, &msg, sizeof(feature_update_t), CCAPP_CCPROVIER) != CPR_SUCCESS ) {
|
||||
CCAPP_ERROR(CCAPP_F_PREFIX"failed to send DEVICE_FEATURE_MWILAMP(%d) msg", __FUNCTION__, status);
|
||||
|
@ -1544,20 +1544,20 @@ ui_control_feature (line_t line_id, callid_t call_id,
|
|||
}
|
||||
|
||||
/*
|
||||
* Helper for the following several functions which all load up a
|
||||
* Helper for the following four functions which all load up a
|
||||
* session_update message and post it.
|
||||
*
|
||||
*/
|
||||
static void post_message_helper(group_call_event_t eventId,
|
||||
call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallId,
|
||||
uint16_t call_instance_id,
|
||||
string_t sdp,
|
||||
pc_error error,
|
||||
const char *format,
|
||||
va_list args)
|
||||
static void post_message_helper(
|
||||
group_call_event_t eventId,
|
||||
call_events event,
|
||||
line_t nLine,
|
||||
callid_t nCallId,
|
||||
uint16_t call_instance_id,
|
||||
string_t sdp,
|
||||
pc_error error,
|
||||
const char *format,
|
||||
va_list args)
|
||||
{
|
||||
flex_string fs;
|
||||
session_update_t msg;
|
||||
|
@ -1572,7 +1572,6 @@ static void post_message_helper(group_call_event_t eventId,
|
|||
|
||||
msg.eventID = eventId;
|
||||
msg.update.ccSessionUpd.data.state_data.state = event;
|
||||
msg.update.ccSessionUpd.data.state_data.fsm_state = new_state;
|
||||
msg.update.ccSessionUpd.data.state_data.inst = call_instance_id;
|
||||
msg.update.ccSessionUpd.data.state_data.line_id = nLine;
|
||||
msg.update.ccSessionUpd.data.state_data.sdp = sdp;
|
||||
|
@ -1603,14 +1602,9 @@ static void post_message_helper(group_call_event_t eventId,
|
|||
*
|
||||
* @return none
|
||||
*/
|
||||
void ui_create_offer(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
string_t sdp,
|
||||
pc_error error,
|
||||
const char *format, ...)
|
||||
void ui_create_offer(call_events event, line_t nLine, callid_t nCallID,
|
||||
uint16_t call_instance_id, string_t sdp,
|
||||
pc_error error, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
@ -1620,8 +1614,8 @@ void ui_create_offer(call_events event,
|
|||
|
||||
|
||||
va_start(ap, format);
|
||||
post_message_helper(CREATE_OFFER, event, new_state, nLine, nCallID,
|
||||
call_instance_id, sdp, error, format, ap);
|
||||
post_message_helper(CREATE_OFFER, event, nLine, nCallID, call_instance_id,
|
||||
sdp, error, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return;
|
||||
|
@ -1633,22 +1627,17 @@ void ui_create_offer(call_events event,
|
|||
*
|
||||
* @return none
|
||||
*/
|
||||
void ui_create_answer(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
string_t sdp,
|
||||
pc_error error,
|
||||
const char *format, ...)
|
||||
void ui_create_answer(call_events event, line_t nLine, callid_t nCallID,
|
||||
uint16_t call_instance_id, string_t sdp,
|
||||
pc_error error, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
TNP_DEBUG(DEB_L_C_F_PREFIX"state=%d call_instance=%d",
|
||||
DEB_L_C_F_PREFIX_ARGS(UI_API, nLine, nCallID, __FUNCTION__), event, call_instance_id);
|
||||
|
||||
va_start(ap, format);
|
||||
post_message_helper(CREATE_ANSWER, event, new_state, nLine, nCallID,
|
||||
call_instance_id, sdp, error, format, ap);
|
||||
post_message_helper(CREATE_ANSWER, event, nLine, nCallID, call_instance_id,
|
||||
sdp, error, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return;
|
||||
|
@ -1660,22 +1649,17 @@ void ui_create_answer(call_events event,
|
|||
* @return none
|
||||
*/
|
||||
|
||||
void ui_set_local_description(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
string_t sdp,
|
||||
pc_error error,
|
||||
const char *format, ...)
|
||||
void ui_set_local_description(call_events event, line_t nLine, callid_t nCallID,
|
||||
uint16_t call_instance_id, string_t sdp,
|
||||
pc_error error, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
TNP_DEBUG(DEB_L_C_F_PREFIX"state=%d call_instance=%d",
|
||||
DEB_L_C_F_PREFIX_ARGS(UI_API, nLine, nCallID, __FUNCTION__), event, call_instance_id);
|
||||
|
||||
va_start(ap, format);
|
||||
post_message_helper(SET_LOCAL_DESC, event, new_state, nLine, nCallID,
|
||||
call_instance_id, sdp, error, format, ap);
|
||||
post_message_helper(SET_LOCAL_DESC, event, nLine, nCallID, call_instance_id,
|
||||
sdp, error, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return;
|
||||
|
@ -1687,13 +1671,9 @@ void ui_set_local_description(call_events event,
|
|||
* @return none
|
||||
*/
|
||||
|
||||
void ui_set_remote_description(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
string_t sdp,
|
||||
pc_error error,
|
||||
void ui_set_remote_description(call_events event, line_t nLine,
|
||||
callid_t nCallID, uint16_t call_instance_id,
|
||||
string_t sdp, pc_error error,
|
||||
const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -1701,7 +1681,7 @@ void ui_set_remote_description(call_events event,
|
|||
DEB_L_C_F_PREFIX_ARGS(UI_API, nLine, nCallID, __FUNCTION__), event, call_instance_id);
|
||||
|
||||
va_start(ap, format);
|
||||
post_message_helper(SET_REMOTE_DESC, event, new_state, nLine, nCallID,
|
||||
post_message_helper(SET_REMOTE_DESC, event, nLine, nCallID,
|
||||
call_instance_id, sdp, error, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
|
@ -1714,13 +1694,9 @@ void ui_set_remote_description(call_events event,
|
|||
* @return none
|
||||
*/
|
||||
|
||||
void ui_update_local_description(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
string_t sdp,
|
||||
pc_error error,
|
||||
void ui_update_local_description(call_events event, line_t nLine,
|
||||
callid_t nCallID, uint16_t call_instance_id,
|
||||
string_t sdp, pc_error error,
|
||||
const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -1729,7 +1705,7 @@ void ui_update_local_description(call_events event,
|
|||
event, call_instance_id);
|
||||
|
||||
va_start(ap, format);
|
||||
post_message_helper(UPDATE_LOCAL_DESC, event, new_state, nLine, nCallID,
|
||||
post_message_helper(UPDATE_LOCAL_DESC, event, nLine, nCallID,
|
||||
call_instance_id, sdp, error, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
|
@ -1742,21 +1718,16 @@ void ui_update_local_description(call_events event,
|
|||
* @return none
|
||||
*/
|
||||
|
||||
void ui_ice_candidate_add(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
string_t sdp,
|
||||
pc_error error,
|
||||
const char *format, ...)
|
||||
void ui_ice_candidate_add(call_events event, line_t nLine, callid_t nCallID,
|
||||
uint16_t call_instance_id, string_t sdp,
|
||||
pc_error error, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
TNP_DEBUG(DEB_L_C_F_PREFIX"state=%d call_instance=%d",
|
||||
DEB_L_C_F_PREFIX_ARGS(UI_API, nLine, nCallID, __FUNCTION__), event, call_instance_id);
|
||||
|
||||
va_start(ap, format);
|
||||
post_message_helper(ICE_CANDIDATE_ADD, event, new_state, nLine, nCallID,
|
||||
post_message_helper(ICE_CANDIDATE_ADD, event, nLine, nCallID,
|
||||
call_instance_id, sdp, error, format, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
@ -1767,11 +1738,8 @@ void ui_ice_candidate_add(call_events event,
|
|||
* @return none
|
||||
*/
|
||||
|
||||
void ui_on_remote_stream_added(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
void ui_on_remote_stream_added(call_events event, line_t nLine,
|
||||
callid_t nCallID, uint16_t call_instance_id,
|
||||
cc_media_remote_track_table_t media_track)
|
||||
{
|
||||
session_update_t msg;
|
||||
|
@ -1791,7 +1759,6 @@ void ui_on_remote_stream_added(call_events event,
|
|||
|
||||
msg.eventID = REMOTE_STREAM_ADD;
|
||||
msg.update.ccSessionUpd.data.state_data.state = event;
|
||||
msg.update.ccSessionUpd.data.state_data.fsm_state = new_state;
|
||||
msg.update.ccSessionUpd.data.state_data.inst = call_instance_id;
|
||||
msg.update.ccSessionUpd.data.state_data.line_id = nLine;
|
||||
msg.update.ccSessionUpd.data.state_data.media_stream_track_id = media_track.track[0].media_stream_track_id;
|
||||
|
|
|
@ -747,36 +747,6 @@ static sm_function_t fsmdef_function_table[FSMDEF_S_MAX][CC_MSG_MAX] =
|
|||
/* CC_MSG_ADDCANDIDATE */ fsmdef_ev_addcandidate
|
||||
},
|
||||
|
||||
/* FSMDEF_S_HAVE_LOCAL_PRANSWER -------------------------------------------- */
|
||||
{
|
||||
/* CC_MSG_SETUP */ fsmdef_ev_default,
|
||||
/* CC_MSG_SETUP_ACK */ fsmdef_ev_default,
|
||||
/* CC_MSG_PROCEEDING */ fsmdef_ev_default,
|
||||
/* CC_MSG_ALERTING */ fsmdef_ev_default,
|
||||
/* CC_MSG_CONNECTED */ fsmdef_ev_default,
|
||||
/* CC_MSG_CONNECTED_ACK */ fsmdef_ev_default,
|
||||
/* CC_MSG_RELEASE */ fsmdef_ev_default,
|
||||
/* CC_MSG_RELEASE_COMPLETE */ fsmdef_ev_default,
|
||||
/* CC_MSG_FEATURE */ fsmdef_ev_default,
|
||||
/* CC_MSG_FEATURE_ACK */ fsmdef_ev_default,
|
||||
/* CC_MSG_OFFHOOK */ fsmdef_ev_default,
|
||||
/* CC_MSG_ONHOOK */ fsmdef_ev_onhook,
|
||||
/* CC_MSG_LINE */ fsmdef_ev_default,
|
||||
/* CC_MSG_DIGIT_BEGIN */ fsmdef_ev_default,
|
||||
/* CC_MSG_DIGIT_END */ fsmdef_ev_default,
|
||||
/* CC_MSG_DIALSTRING */ fsmdef_ev_default,
|
||||
/* CC_MSG_MWI */ fsmdef_ev_default,
|
||||
/* CC_MSG_SESSION_AUDIT */ fsmdef_ev_default,
|
||||
/* CC_MSG_CREATEOFFER */ fsmdef_ev_createoffer,
|
||||
/* CC_MSG_CREATEANSWER */ fsmdef_ev_createanswer,
|
||||
/* CC_MSG_SETLOCALDESC */ fsmdef_ev_setlocaldesc,
|
||||
/* CC_MSG_SETREMOTEDESC */ fsmdef_ev_default, /* Should not happen */
|
||||
/* CC_MSG_SETPEERCONNECTION */fsmdef_ev_default,
|
||||
/* CC_MSG_ADDSTREAM */ fsmdef_ev_default,
|
||||
/* CC_MSG_REMOVESTREAM */ fsmdef_ev_default,
|
||||
/* CC_MSG_ADDCANDIDATE */ fsmdef_ev_addcandidate
|
||||
},
|
||||
|
||||
/* FSMDEF_S_HAVE_REMOTE_PRANSWER ------------------------------------------- */
|
||||
{
|
||||
/* CC_MSG_SETUP */ fsmdef_ev_default,
|
||||
|
@ -807,6 +777,36 @@ static sm_function_t fsmdef_function_table[FSMDEF_S_MAX][CC_MSG_MAX] =
|
|||
/* CC_MSG_ADDCANDIDATE */ fsmdef_ev_addcandidate
|
||||
},
|
||||
|
||||
/* FSMDEF_S_HAVE_LOCAL_PRANSWER -------------------------------------------- */
|
||||
{
|
||||
/* CC_MSG_SETUP */ fsmdef_ev_default,
|
||||
/* CC_MSG_SETUP_ACK */ fsmdef_ev_default,
|
||||
/* CC_MSG_PROCEEDING */ fsmdef_ev_default,
|
||||
/* CC_MSG_ALERTING */ fsmdef_ev_default,
|
||||
/* CC_MSG_CONNECTED */ fsmdef_ev_default,
|
||||
/* CC_MSG_CONNECTED_ACK */ fsmdef_ev_default,
|
||||
/* CC_MSG_RELEASE */ fsmdef_ev_default,
|
||||
/* CC_MSG_RELEASE_COMPLETE */ fsmdef_ev_default,
|
||||
/* CC_MSG_FEATURE */ fsmdef_ev_default,
|
||||
/* CC_MSG_FEATURE_ACK */ fsmdef_ev_default,
|
||||
/* CC_MSG_OFFHOOK */ fsmdef_ev_default,
|
||||
/* CC_MSG_ONHOOK */ fsmdef_ev_onhook,
|
||||
/* CC_MSG_LINE */ fsmdef_ev_default,
|
||||
/* CC_MSG_DIGIT_BEGIN */ fsmdef_ev_default,
|
||||
/* CC_MSG_DIGIT_END */ fsmdef_ev_default,
|
||||
/* CC_MSG_DIALSTRING */ fsmdef_ev_default,
|
||||
/* CC_MSG_MWI */ fsmdef_ev_default,
|
||||
/* CC_MSG_SESSION_AUDIT */ fsmdef_ev_default,
|
||||
/* CC_MSG_CREATEOFFER */ fsmdef_ev_createoffer,
|
||||
/* CC_MSG_CREATEANSWER */ fsmdef_ev_createanswer,
|
||||
/* CC_MSG_SETLOCALDESC */ fsmdef_ev_setlocaldesc,
|
||||
/* CC_MSG_SETREMOTEDESC */ fsmdef_ev_default, /* Should not happen */
|
||||
/* CC_MSG_SETPEERCONNECTION */fsmdef_ev_default,
|
||||
/* CC_MSG_ADDSTREAM */ fsmdef_ev_default,
|
||||
/* CC_MSG_REMOVESTREAM */ fsmdef_ev_default,
|
||||
/* CC_MSG_ADDCANDIDATE */ fsmdef_ev_addcandidate
|
||||
},
|
||||
|
||||
/* FSMDEF_S_CLOSED --------------------------------------------------------- */
|
||||
{
|
||||
/* CC_MSG_SETUP */ fsmdef_ev_default,
|
||||
|
@ -2416,39 +2416,38 @@ fsmdef_ev_default (sm_event_t *event)
|
|||
*/
|
||||
switch (event->event) {
|
||||
case CC_MSG_CREATEOFFER:
|
||||
ui_create_offer(evCreateOfferError, fcb->state, msg->line,
|
||||
msg->call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_create_offer(evCreateOfferError, msg->line, msg->call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot create offer in state %s",
|
||||
fsmdef_state_name(fcb->state));
|
||||
fsmdef_state_name(event->state));
|
||||
break;
|
||||
|
||||
case CC_MSG_CREATEANSWER:
|
||||
ui_create_answer(evCreateAnswerError, fcb->state, msg->line,
|
||||
msg->call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_create_answer(evCreateAnswerError, msg->line, msg->call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot create answer in state %s",
|
||||
fsmdef_state_name(fcb->state));
|
||||
fsmdef_state_name(event->state));
|
||||
break;
|
||||
|
||||
case CC_MSG_SETLOCALDESC:
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, msg->line,
|
||||
ui_set_local_description(evSetLocalDescError, msg->line,
|
||||
msg->call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot set local description in state %s",
|
||||
fsmdef_state_name(fcb->state));
|
||||
fsmdef_state_name(event->state));
|
||||
break;
|
||||
|
||||
case CC_MSG_SETREMOTEDESC:
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state,
|
||||
msg->line, msg->call_id, dcb->caller_id.call_instance_id,
|
||||
strlib_empty(), PC_INVALID_STATE,
|
||||
"Cannot set remote description in state %s",
|
||||
fsmdef_state_name(fcb->state));
|
||||
ui_set_remote_description(evSetRemoteDescError, msg->line,
|
||||
msg->call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot set remote description in state %s",
|
||||
fsmdef_state_name(event->state));
|
||||
break;
|
||||
|
||||
case CC_MSG_ADDCANDIDATE:
|
||||
ui_ice_candidate_add(evAddIceCandidateError, fcb->state, msg->line,
|
||||
msg->call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_ice_candidate_add(evAddIceCandidateError, msg->line, msg->call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot add ICE candidate in state %s",
|
||||
fsmdef_state_name(fcb->state));
|
||||
fsmdef_state_name(event->state));
|
||||
break;
|
||||
|
||||
case CC_MSG_ADDSTREAM:
|
||||
|
@ -2459,7 +2458,7 @@ fsmdef_ev_default (sm_event_t *event)
|
|||
* getting through anyway. */
|
||||
FSM_DEBUG_SM(DEB_L_C_F_PREFIX"Cannot add or remove streams "
|
||||
"in state %s", DEB_L_C_F_PREFIX_ARGS(FSM, dcb->line,
|
||||
msg->call_id, __FUNCTION__), fsmdef_state_name(fcb->state));
|
||||
msg->call_id, __FUNCTION__), fsmdef_state_name(event->state));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -3151,14 +3150,14 @@ fsmdef_ev_createoffer (sm_event_t *event) {
|
|||
|
||||
local_sdp = sipsdp_write_to_buf(dcb->sdp->src_sdp, &local_sdp_len);
|
||||
if (!local_sdp) {
|
||||
ui_create_offer(evCreateOfferError, fcb->state, line, call_id,
|
||||
ui_create_offer(evCreateOfferError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not re-create local SDP for offer");
|
||||
FSM_DEBUG_SM("%s", get_debug_string(FSM_DBG_SDP_BUILD_ERR));
|
||||
return (fsmdef_release(fcb, cause, FALSE));
|
||||
}
|
||||
|
||||
ui_create_offer(evCreateOfferSuccess, fcb->state, line, call_id,
|
||||
ui_create_offer(evCreateOfferSuccess, line, call_id,
|
||||
dcb->caller_id.call_instance_id,
|
||||
strlib_malloc(local_sdp,-1), PC_NO_ERROR, NULL);
|
||||
free(local_sdp);
|
||||
|
@ -3180,7 +3179,7 @@ fsmdef_ev_createoffer (sm_event_t *event) {
|
|||
}
|
||||
|
||||
if (!has_stream) {
|
||||
ui_create_offer(evCreateOfferError, fcb->state, line, call_id,
|
||||
ui_create_offer(evCreateOfferError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot create SDP without any streams.");
|
||||
return SM_RC_END;
|
||||
|
@ -3190,7 +3189,7 @@ fsmdef_ev_createoffer (sm_event_t *event) {
|
|||
if (vcm_res) {
|
||||
FSM_DEBUG_SM(DEB_F_PREFIX"vcmGetIceParams returned an error",
|
||||
DEB_F_PREFIX_ARGS(FSM, __FUNCTION__));
|
||||
ui_create_offer(evCreateOfferError, fcb->state, line, call_id,
|
||||
ui_create_offer(evCreateOfferError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Failed to get ICE parameters for local SDP");
|
||||
return (fsmdef_release(fcb, cause, FALSE));
|
||||
|
@ -3222,7 +3221,7 @@ fsmdef_ev_createoffer (sm_event_t *event) {
|
|||
|
||||
cause = gsmsdp_create_local_sdp(dcb, FALSE, TRUE, TRUE, TRUE, TRUE);
|
||||
if (cause != CC_CAUSE_OK) {
|
||||
ui_create_offer(evCreateOfferError, fcb->state, line, call_id,
|
||||
ui_create_offer(evCreateOfferError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not create local SDP for offer;"
|
||||
" cause = %s", cc_cause_name(cause));
|
||||
|
@ -3232,7 +3231,7 @@ fsmdef_ev_createoffer (sm_event_t *event) {
|
|||
|
||||
cause = gsmsdp_encode_sdp_and_update_version(dcb, &msg_body);
|
||||
if (cause != CC_CAUSE_OK) {
|
||||
ui_create_offer(evCreateOfferError, fcb->state, line, call_id,
|
||||
ui_create_offer(evCreateOfferError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not encode local SDP for offer;"
|
||||
" cause = %s", cc_cause_name(cause));
|
||||
|
@ -3243,7 +3242,7 @@ fsmdef_ev_createoffer (sm_event_t *event) {
|
|||
dcb->local_sdp_complete = TRUE;
|
||||
|
||||
/* Pass offer SDP back to UI */
|
||||
ui_create_offer(evCreateOfferSuccess, fcb->state, line, call_id,
|
||||
ui_create_offer(evCreateOfferSuccess, line, call_id,
|
||||
dcb->caller_id.call_instance_id,
|
||||
strlib_malloc(msg_body.parts[0].body, -1), PC_NO_ERROR, NULL);
|
||||
cc_free_msg_body_parts(&msg_body);
|
||||
|
@ -3306,14 +3305,14 @@ fsmdef_ev_createanswer (sm_event_t *event) {
|
|||
|
||||
local_sdp = sipsdp_write_to_buf(dcb->sdp->src_sdp, &local_sdp_len);
|
||||
if (!local_sdp) {
|
||||
ui_create_answer(evCreateAnswerError, fcb->state, line, call_id,
|
||||
ui_create_answer(evCreateAnswerError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not re-create local SDP for answer");
|
||||
FSM_DEBUG_SM("%s", get_debug_string(FSM_DBG_SDP_BUILD_ERR));
|
||||
return (fsmdef_release(fcb, cause, FALSE));
|
||||
}
|
||||
|
||||
ui_create_answer(evCreateAnswerSuccess, fcb->state, line, call_id,
|
||||
ui_create_answer(evCreateAnswerSuccess, line, call_id,
|
||||
dcb->caller_id.call_instance_id,
|
||||
strlib_malloc(local_sdp,-1), PC_NO_ERROR, NULL);
|
||||
free(local_sdp);
|
||||
|
@ -3332,7 +3331,7 @@ fsmdef_ev_createanswer (sm_event_t *event) {
|
|||
if (vcm_res) {
|
||||
FSM_DEBUG_SM(DEB_F_PREFIX"vcmGetIceParams returned an error",
|
||||
DEB_F_PREFIX_ARGS(FSM, __FUNCTION__));
|
||||
ui_create_answer(evCreateAnswerError, fcb->state, line, call_id,
|
||||
ui_create_answer(evCreateAnswerError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not get ICE parameters for answer");
|
||||
return (fsmdef_release(fcb, cause, FALSE));
|
||||
|
@ -3374,7 +3373,7 @@ fsmdef_ev_createanswer (sm_event_t *event) {
|
|||
*/
|
||||
cause = gsmsdp_create_local_sdp(dcb, TRUE, has_audio, has_video, has_data, FALSE);
|
||||
if (cause != CC_CAUSE_OK) {
|
||||
ui_create_answer(evCreateAnswerError, fcb->state, line, call_id,
|
||||
ui_create_answer(evCreateAnswerError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not create local SDP for answer;"
|
||||
" cause = %s", cc_cause_name(cause));
|
||||
|
@ -3393,7 +3392,7 @@ fsmdef_ev_createanswer (sm_event_t *event) {
|
|||
/* create_answer */ TRUE);
|
||||
|
||||
if (cause != CC_CAUSE_OK) {
|
||||
ui_create_answer(evCreateAnswerError, fcb->state, line, call_id,
|
||||
ui_create_answer(evCreateAnswerError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not negotiate media lines; cause = %s",
|
||||
cc_cause_name(cause));
|
||||
|
@ -3402,7 +3401,7 @@ fsmdef_ev_createanswer (sm_event_t *event) {
|
|||
|
||||
cause = gsmsdp_encode_sdp_and_update_version(dcb, &msg_body);
|
||||
if (cause != CC_CAUSE_OK) {
|
||||
ui_create_answer(evCreateAnswerError, fcb->state, line, call_id,
|
||||
ui_create_answer(evCreateAnswerError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not encode SDP for answer; cause = %s",
|
||||
cc_cause_name(cause));
|
||||
|
@ -3413,7 +3412,7 @@ fsmdef_ev_createanswer (sm_event_t *event) {
|
|||
dcb->local_sdp_complete = TRUE;
|
||||
|
||||
/* Pass SDP back to UI */
|
||||
ui_create_answer(evCreateAnswerSuccess, fcb->state, line, call_id,
|
||||
ui_create_answer(evCreateAnswerSuccess, line, call_id,
|
||||
dcb->caller_id.call_instance_id,
|
||||
strlib_malloc(msg_body.parts[0].body, -1), PC_NO_ERROR, NULL);
|
||||
cc_free_msg_body_parts(&msg_body);
|
||||
|
@ -3449,25 +3448,25 @@ fsmdef_ev_setlocaldesc(sm_event_t *event) {
|
|||
if (dcb == NULL) {
|
||||
FSM_DEBUG_SM(DEB_F_PREFIX"dcb is NULL.",
|
||||
DEB_F_PREFIX_ARGS(FSM, __FUNCTION__));
|
||||
fsm_change_state(fcb, __LINE__, FSMDEF_S_CLOSED);
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, line, call_id,
|
||||
ui_set_local_description(evSetLocalDescError, line, call_id,
|
||||
0, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Unrecoverable error: dcb is NULL.");
|
||||
fsm_change_state(fcb, __LINE__, FSMDEF_S_CLOSED);
|
||||
return (SM_RC_CLEANUP);
|
||||
}
|
||||
|
||||
config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode));
|
||||
if (!sdpmode) {
|
||||
fsm_change_state(fcb, __LINE__, FSMDEF_S_CLOSED);
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, line, call_id,
|
||||
ui_set_local_description(evSetLocalDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "'sdpmode' configuration is false. This should "
|
||||
"never ever happen. Run for your lives!");
|
||||
fsm_change_state(fcb, __LINE__, FSMDEF_S_CLOSED);
|
||||
return (SM_RC_END);
|
||||
}
|
||||
|
||||
if (!dcb->sdp) {
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, line, call_id,
|
||||
ui_set_local_description(evSetLocalDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Setting of local SDP before calling "
|
||||
"createOffer or createAnswer is not currently supported.");
|
||||
|
@ -3477,12 +3476,12 @@ fsmdef_ev_setlocaldesc(sm_event_t *event) {
|
|||
switch (action) {
|
||||
|
||||
case JSEP_OFFER:
|
||||
if (fcb->state != FSMDEF_S_STABLE &&
|
||||
fcb->state != FSMDEF_S_HAVE_LOCAL_OFFER) {
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
if (event->state != FSMDEF_S_STABLE &&
|
||||
event->state != FSMDEF_S_HAVE_LOCAL_OFFER) {
|
||||
ui_set_local_description(evSetLocalDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot set local offer in state %s",
|
||||
fsmdef_state_name(fcb->state));
|
||||
fsmdef_state_name(event->state));
|
||||
return (SM_RC_END);
|
||||
}
|
||||
/* TODO: Parse incoming SDP and act on it. */
|
||||
|
@ -3490,12 +3489,12 @@ fsmdef_ev_setlocaldesc(sm_event_t *event) {
|
|||
break;
|
||||
|
||||
case JSEP_ANSWER:
|
||||
if (fcb->state != FSMDEF_S_HAVE_REMOTE_OFFER &&
|
||||
fcb->state != FSMDEF_S_HAVE_LOCAL_PRANSWER) {
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
if (event->state != FSMDEF_S_HAVE_REMOTE_OFFER &&
|
||||
event->state != FSMDEF_S_HAVE_LOCAL_PRANSWER) {
|
||||
ui_set_local_description(evSetLocalDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot set local answer in state %s",
|
||||
fsmdef_state_name(fcb->state));
|
||||
fsmdef_state_name(event->state));
|
||||
return (SM_RC_END);
|
||||
}
|
||||
/* TODO: Parse incoming SDP and act on it. */
|
||||
|
@ -3510,8 +3509,8 @@ fsmdef_ev_setlocaldesc(sm_event_t *event) {
|
|||
*/
|
||||
cause = gsmsdp_install_peer_ice_attributes(fcb);
|
||||
if (cause != CC_CAUSE_OK) {
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_set_local_description(evSetLocalDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not configure local ICE state"
|
||||
" from SDP; cause = %s", cc_cause_name(cause));
|
||||
return (SM_RC_END);
|
||||
|
@ -3526,8 +3525,8 @@ fsmdef_ev_setlocaldesc(sm_event_t *event) {
|
|||
if (dcb->dsp_out_of_resources == TRUE) {
|
||||
cc_call_state(fcb->dcb->call_id, fcb->dcb->line,
|
||||
CC_STATE_UNKNOWN, NULL);
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_set_local_description(evSetLocalDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Cannot start media channels; cause = %s",
|
||||
cc_cause_name(cause));
|
||||
return (SM_RC_END);
|
||||
|
@ -3540,21 +3539,21 @@ fsmdef_ev_setlocaldesc(sm_event_t *event) {
|
|||
break;
|
||||
|
||||
case JSEP_PRANSWER:
|
||||
if (fcb->state != FSMDEF_S_HAVE_REMOTE_OFFER &&
|
||||
fcb->state != FSMDEF_S_HAVE_LOCAL_PRANSWER) {
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
if (event->state != FSMDEF_S_HAVE_REMOTE_OFFER &&
|
||||
event->state != FSMDEF_S_HAVE_LOCAL_PRANSWER) {
|
||||
ui_set_local_description(evSetLocalDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot set local pranswer in state %s",
|
||||
fsmdef_state_name(fcb->state));
|
||||
fsmdef_state_name(event->state));
|
||||
return (SM_RC_END);
|
||||
}
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, msg->line,
|
||||
ui_set_local_description(evSetLocalDescError, msg->line,
|
||||
msg->call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Provisional answers are not yet supported");
|
||||
return (SM_RC_END);
|
||||
|
||||
default:
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, msg->line,
|
||||
ui_set_local_description(evSetLocalDescError, msg->line,
|
||||
msg->call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Unknown session description type: %d",action);
|
||||
return (SM_RC_END);
|
||||
|
@ -3563,16 +3562,16 @@ fsmdef_ev_setlocaldesc(sm_event_t *event) {
|
|||
/* Encode the current local SDP structure into a char buffer */
|
||||
local_sdp = sipsdp_write_to_buf(dcb->sdp->src_sdp, &local_sdp_len);
|
||||
if (!local_sdp) {
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, msg->line,
|
||||
msg->call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_set_local_description(evSetLocalDescError, msg->line, msg->call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not encode local SDP for local "
|
||||
"description");
|
||||
return (SM_RC_END);
|
||||
}
|
||||
|
||||
ui_set_local_description(evSetLocalDescSuccess, fcb->state, msg->line,
|
||||
msg->call_id, dcb->caller_id.call_instance_id,
|
||||
strlib_malloc(local_sdp,-1), PC_NO_ERROR, NULL);
|
||||
ui_set_local_description(evSetLocalDescSuccess, msg->line, msg->call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_malloc(local_sdp,-1),
|
||||
PC_NO_ERROR, NULL);
|
||||
|
||||
free(local_sdp);
|
||||
return (SM_RC_END);
|
||||
|
@ -3610,20 +3609,20 @@ fsmdef_ev_setremotedesc(sm_event_t *event) {
|
|||
if (dcb == NULL) {
|
||||
FSM_DEBUG_SM(DEB_F_PREFIX"dcb is NULL.",
|
||||
DEB_F_PREFIX_ARGS(FSM, __FUNCTION__));
|
||||
fsm_change_state(fcb, __LINE__, FSMDEF_S_CLOSED);
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, 0, strlib_empty(),
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
0, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Unrecoverable error: dcb is NULL.");
|
||||
fsm_change_state(fcb, __LINE__, FSMDEF_S_CLOSED);
|
||||
return (SM_RC_CLEANUP);
|
||||
}
|
||||
|
||||
config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode));
|
||||
if (!sdpmode) {
|
||||
fsm_change_state(fcb, __LINE__, FSMDEF_S_CLOSED);
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "'sdpmode' configuration is false. This should "
|
||||
"never ever happen. Run for your lives!");
|
||||
fsm_change_state(fcb, __LINE__, FSMDEF_S_CLOSED);
|
||||
return (SM_RC_END);
|
||||
}
|
||||
|
||||
|
@ -3633,8 +3632,8 @@ fsmdef_ev_setremotedesc(sm_event_t *event) {
|
|||
if (dcb->sdp && dcb->sdp->dest_sdp) {
|
||||
FSM_DEBUG_SM(DEB_F_PREFIX"Renegotiation not currently supported.",
|
||||
DEB_F_PREFIX_ARGS(FSM, __FUNCTION__));
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Renegotiation of session description is not "
|
||||
"currently supported. See Bug 840728 for status.");
|
||||
return (SM_RC_END);
|
||||
|
@ -3662,18 +3661,18 @@ fsmdef_ev_setremotedesc(sm_event_t *event) {
|
|||
|
||||
switch (action) {
|
||||
case JSEP_OFFER:
|
||||
if (fcb->state != FSMDEF_S_STABLE &&
|
||||
fcb->state != FSMDEF_S_HAVE_REMOTE_OFFER) {
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
if (event->state != FSMDEF_S_STABLE &&
|
||||
event->state != FSMDEF_S_HAVE_REMOTE_OFFER) {
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot set remote offer in state %s",
|
||||
fsmdef_state_name(fcb->state));
|
||||
fsmdef_state_name(event->state));
|
||||
return (SM_RC_END);
|
||||
}
|
||||
cause = gsmsdp_process_offer_sdp(fcb, &msg_body, TRUE);
|
||||
if (cause != CC_CAUSE_OK) {
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not process offer SDP; "
|
||||
"cause = %s", cc_cause_name(cause));
|
||||
return (SM_RC_END);
|
||||
|
@ -3693,8 +3692,8 @@ fsmdef_ev_setremotedesc(sm_event_t *event) {
|
|||
cause = gsmsdp_create_local_sdp(dcb, TRUE, has_audio, has_video,
|
||||
has_data, FALSE);
|
||||
if (cause != CC_CAUSE_OK) {
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not create local SDP; cause = %s",
|
||||
cc_cause_name(cause));
|
||||
FSM_DEBUG_SM("%s", get_debug_string(FSM_DBG_SDP_BUILD_ERR));
|
||||
|
@ -3705,8 +3704,8 @@ fsmdef_ev_setremotedesc(sm_event_t *event) {
|
|||
cause = gsmsdp_negotiate_media_lines(fcb, dcb->sdp,
|
||||
TRUE, TRUE, TRUE, FALSE);
|
||||
if (cause != CC_CAUSE_OK) {
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not negotiate media lines; cause = %s",
|
||||
cc_cause_name(cause));
|
||||
return (fsmdef_release(fcb, cause, FALSE));
|
||||
|
@ -3718,18 +3717,18 @@ fsmdef_ev_setremotedesc(sm_event_t *event) {
|
|||
break;
|
||||
|
||||
case JSEP_ANSWER:
|
||||
if (fcb->state != FSMDEF_S_HAVE_LOCAL_OFFER &&
|
||||
fcb->state != FSMDEF_S_HAVE_REMOTE_PRANSWER) {
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
if (event->state != FSMDEF_S_HAVE_LOCAL_OFFER &&
|
||||
event->state != FSMDEF_S_HAVE_REMOTE_PRANSWER) {
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot set remote answer in state %s",
|
||||
fsmdef_state_name(fcb->state));
|
||||
fsmdef_state_name(event->state));
|
||||
return (SM_RC_END);
|
||||
}
|
||||
cause = gsmsdp_negotiate_answer_sdp(fcb, &msg_body);
|
||||
if (cause != CC_CAUSE_OK) {
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not negotiate answer SDP; cause = %s",
|
||||
cc_cause_name(cause));
|
||||
return (SM_RC_END);
|
||||
|
@ -3741,8 +3740,8 @@ fsmdef_ev_setremotedesc(sm_event_t *event) {
|
|||
*/
|
||||
cause = gsmsdp_install_peer_ice_attributes(fcb);
|
||||
if (cause != CC_CAUSE_OK) {
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not configure local ICE state"
|
||||
" from SDP; cause = %s", cc_cause_name(cause));
|
||||
return (SM_RC_END);
|
||||
|
@ -3760,21 +3759,21 @@ fsmdef_ev_setremotedesc(sm_event_t *event) {
|
|||
break;
|
||||
|
||||
case JSEP_PRANSWER:
|
||||
if (fcb->state != FSMDEF_S_HAVE_LOCAL_OFFER &&
|
||||
fcb->state != FSMDEF_S_HAVE_REMOTE_PRANSWER) {
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
if (event->state != FSMDEF_S_HAVE_LOCAL_OFFER &&
|
||||
event->state != FSMDEF_S_HAVE_REMOTE_PRANSWER) {
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot set remote pranswer in state %s",
|
||||
fsmdef_state_name(fcb->state));
|
||||
fsmdef_state_name(event->state));
|
||||
return (SM_RC_END);
|
||||
}
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, msg->line,
|
||||
ui_set_local_description(evSetLocalDescError, msg->line,
|
||||
msg->call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Provisional answers are not yet supported");
|
||||
return (SM_RC_END);
|
||||
|
||||
default:
|
||||
ui_set_local_description(evSetLocalDescError, fcb->state, msg->line,
|
||||
ui_set_local_description(evSetLocalDescError, msg->line,
|
||||
msg->call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Unknown session description type: %d",action);
|
||||
return (SM_RC_END);
|
||||
|
@ -3789,14 +3788,14 @@ fsmdef_ev_setremotedesc(sm_event_t *event) {
|
|||
remote_sdp = sipsdp_write_to_buf(dcb->sdp->dest_sdp, &remote_sdp_len);
|
||||
|
||||
if (!remote_sdp) {
|
||||
ui_set_remote_description(evSetRemoteDescError, fcb->state, line,
|
||||
call_id, dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
ui_set_remote_description(evSetRemoteDescError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not serialize remote description;"
|
||||
" cause = %s", cc_cause_name(cause));
|
||||
return (SM_RC_END);
|
||||
}
|
||||
|
||||
ui_set_remote_description(evSetRemoteDescSuccess, fcb->state, line, call_id,
|
||||
ui_set_remote_description(evSetRemoteDescSuccess, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_malloc(remote_sdp,-1),
|
||||
PC_NO_ERROR, NULL);
|
||||
|
||||
|
@ -3980,14 +3979,14 @@ fsmdef_ev_addcandidate(sm_event_t *event) {
|
|||
|
||||
if (!dcb) {
|
||||
FSM_DEBUG_SM(DEB_F_PREFIX"dcb is NULL.", DEB_F_PREFIX_ARGS(FSM, __FUNCTION__));
|
||||
ui_ice_candidate_add(evAddIceCandidateError, fcb->state, line, call_id,
|
||||
ui_ice_candidate_add(evAddIceCandidateError, line, call_id,
|
||||
0, strlib_empty(), PC_INTERNAL_ERROR, "DCB has not been created.");
|
||||
return SM_RC_CLEANUP;
|
||||
}
|
||||
|
||||
config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode));
|
||||
if (sdpmode == FALSE) {
|
||||
ui_ice_candidate_add(evAddIceCandidateError, fcb->state, line, call_id,
|
||||
ui_ice_candidate_add(evAddIceCandidateError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "'sdpmode' configuration is false. This should "
|
||||
"never ever happen. Run for your lives!");
|
||||
|
@ -3999,7 +3998,7 @@ fsmdef_ev_addcandidate(sm_event_t *event) {
|
|||
"remote description been set yet?\n",
|
||||
DEB_F_PREFIX_ARGS(FSM, __FUNCTION__));
|
||||
|
||||
ui_ice_candidate_add(evAddIceCandidateError, fcb->state, line, call_id,
|
||||
ui_ice_candidate_add(evAddIceCandidateError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INVALID_STATE, "Cannot add remote ICE candidates before "
|
||||
"setting remote SDP.");
|
||||
|
@ -4046,14 +4045,14 @@ fsmdef_ev_addcandidate(sm_event_t *event) {
|
|||
remote_sdp = sipsdp_write_to_buf(dcb->sdp->dest_sdp, &remote_sdp_len);
|
||||
|
||||
if (!remote_sdp) {
|
||||
ui_ice_candidate_add(evAddIceCandidateError, fcb->state, line, call_id,
|
||||
ui_ice_candidate_add(evAddIceCandidateError, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_empty(),
|
||||
PC_INTERNAL_ERROR, "Could not serialize new SDP after adding ICE "
|
||||
"candidate.");
|
||||
return (SM_RC_END);
|
||||
}
|
||||
|
||||
ui_ice_candidate_add(evAddIceCandidate, fcb->state, line, call_id,
|
||||
ui_ice_candidate_add(evAddIceCandidate, line, call_id,
|
||||
dcb->caller_id.call_instance_id, strlib_malloc(remote_sdp,-1),
|
||||
PC_NO_ERROR, NULL);
|
||||
|
||||
|
|
|
@ -4749,7 +4749,7 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, boolean initial
|
|||
TODO(adam@nostrum.com): Figure out how to notify
|
||||
when streams gain tracks */
|
||||
ui_on_remote_stream_added(evOnRemoteStreamAdd,
|
||||
fcb_p->state, dcb_p->line, dcb_p->call_id,
|
||||
dcb_p->line, dcb_p->call_id,
|
||||
dcb_p->caller_id.call_instance_id,
|
||||
dcb_p->remote_media_stream_tbl->streams[j]);
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "sll_lite.h"
|
||||
#include "sessionConstants.h"
|
||||
#include "ccsdp.h"
|
||||
#include "fsmdef_states.h"
|
||||
|
||||
/* TODO: BLASBERG
|
||||
* fsm.h only needs the following from ccsip_core.h
|
||||
|
@ -66,6 +65,39 @@ typedef enum {
|
|||
FSMDEF_CALL_TYPE_MAX
|
||||
} fsmdef_call_types_t;
|
||||
|
||||
typedef enum {
|
||||
FSMDEF_S_MIN = -1,
|
||||
|
||||
FSMDEF_S_IDLE,
|
||||
|
||||
/* SIP States */
|
||||
FSMDEF_S_COLLECT_INFO,
|
||||
FSMDEF_S_CALL_SENT,
|
||||
FSMDEF_S_OUTGOING_PROCEEDING,
|
||||
FSMDEF_S_KPML_COLLECT_INFO,
|
||||
FSMDEF_S_OUTGOING_ALERTING,
|
||||
FSMDEF_S_INCOMING_ALERTING,
|
||||
FSMDEF_S_CONNECTING,
|
||||
FSMDEF_S_JOINING,
|
||||
FSMDEF_S_CONNECTED,
|
||||
FSMDEF_S_CONNECTED_MEDIA_PEND,
|
||||
FSMDEF_S_RELEASING,
|
||||
FSMDEF_S_HOLD_PENDING,
|
||||
FSMDEF_S_HOLDING,
|
||||
FSMDEF_S_RESUME_PENDING,
|
||||
FSMDEF_S_PRESERVED,
|
||||
|
||||
/* WebRTC States */
|
||||
FSMDEF_S_STABLE,
|
||||
FSMDEF_S_HAVE_LOCAL_OFFER,
|
||||
FSMDEF_S_HAVE_REMOTE_OFFER,
|
||||
FSMDEF_S_HAVE_REMOTE_PRANSWER,
|
||||
FSMDEF_S_HAVE_LOCAL_PRANSWER,
|
||||
FSMDEF_S_CLOSED,
|
||||
|
||||
FSMDEF_S_MAX
|
||||
} fsmdef_states_t;
|
||||
|
||||
typedef enum {
|
||||
FSMDEF_MRTONE_NO_ACTION = 0,
|
||||
FSMDEF_MRTONE_PLAYED_MONITOR_TONE,
|
||||
|
|
|
@ -52,7 +52,6 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
int state;
|
||||
int fsm_state;
|
||||
int attr;
|
||||
int inst;
|
||||
line_t line_id;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "phone_types.h"
|
||||
#include "string_lib.h"
|
||||
#include "vcm.h"
|
||||
#include "fsm.h"
|
||||
#include "ccapi.h"
|
||||
|
||||
#include "sessionConstants.h"
|
||||
|
@ -181,7 +180,6 @@ void ui_update_media_interface_change(line_t line, callid_t call_id, group_call_
|
|||
/* WebRTC upcalls for PeerConnectionImpl */
|
||||
|
||||
void ui_create_offer(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
|
@ -190,7 +188,6 @@ void ui_create_offer(call_events event,
|
|||
const char *format, ...);
|
||||
|
||||
void ui_create_answer(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
|
@ -199,7 +196,6 @@ void ui_create_answer(call_events event,
|
|||
const char *format, ...);
|
||||
|
||||
void ui_set_local_description(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
|
@ -208,7 +204,6 @@ void ui_set_local_description(call_events event,
|
|||
const char *format, ...);
|
||||
|
||||
void ui_set_remote_description(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
|
@ -217,7 +212,6 @@ void ui_set_remote_description(call_events event,
|
|||
const char *format, ...);
|
||||
|
||||
void ui_update_local_description(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
|
@ -226,7 +220,6 @@ void ui_update_local_description(call_events event,
|
|||
const char *format, ...);
|
||||
|
||||
void ui_ice_candidate_add(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
|
@ -235,7 +228,6 @@ void ui_ice_candidate_add(call_events event,
|
|||
const char *format, ...);
|
||||
|
||||
void ui_on_remote_stream_added(call_events event,
|
||||
fsmdef_states_t new_state,
|
||||
line_t nLine,
|
||||
callid_t nCallID,
|
||||
uint16_t call_instance_id,
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "ccapi_types.h"
|
||||
#include "peer_connection_types.h"
|
||||
#include "fsmdef_states.h"
|
||||
|
||||
/**
|
||||
* get Line on which this call is
|
||||
|
@ -23,13 +22,6 @@ cc_lineid_t CCAPI_CallInfo_getLine(cc_callinfo_ref_t handle);
|
|||
*/
|
||||
cc_call_state_t CCAPI_CallInfo_getCallState(cc_callinfo_ref_t handle);
|
||||
|
||||
/**
|
||||
* get FSM state
|
||||
* @param [in] handle - call info handle
|
||||
* @return fsm state
|
||||
*/
|
||||
fsmdef_states_t CCAPI_CallInfo_getFsmState(cc_callinfo_ref_t handle);
|
||||
|
||||
/**
|
||||
* get call attributes
|
||||
* @param [in] handle - call info handle
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef _FSMDEF_STATES_H_
|
||||
#define _FSMDEF_STATES_H_
|
||||
|
||||
typedef enum {
|
||||
FSMDEF_S_MIN = -1,
|
||||
|
||||
FSMDEF_S_IDLE,
|
||||
|
||||
/* SIP States */
|
||||
FSMDEF_S_COLLECT_INFO,
|
||||
FSMDEF_S_CALL_SENT,
|
||||
FSMDEF_S_OUTGOING_PROCEEDING,
|
||||
FSMDEF_S_KPML_COLLECT_INFO,
|
||||
FSMDEF_S_OUTGOING_ALERTING,
|
||||
FSMDEF_S_INCOMING_ALERTING,
|
||||
FSMDEF_S_CONNECTING,
|
||||
FSMDEF_S_JOINING,
|
||||
FSMDEF_S_CONNECTED,
|
||||
FSMDEF_S_CONNECTED_MEDIA_PEND,
|
||||
FSMDEF_S_RELEASING,
|
||||
FSMDEF_S_HOLD_PENDING,
|
||||
FSMDEF_S_HOLDING,
|
||||
FSMDEF_S_RESUME_PENDING,
|
||||
FSMDEF_S_PRESERVED,
|
||||
|
||||
/* WebRTC States */
|
||||
/* MUST be in the same order as PeerConnectionImpl::SignalingState */
|
||||
FSMDEF_S_STABLE,
|
||||
FSMDEF_S_HAVE_LOCAL_OFFER,
|
||||
FSMDEF_S_HAVE_REMOTE_OFFER,
|
||||
FSMDEF_S_HAVE_LOCAL_PRANSWER,
|
||||
FSMDEF_S_HAVE_REMOTE_PRANSWER,
|
||||
FSMDEF_S_CLOSED,
|
||||
|
||||
FSMDEF_S_MAX
|
||||
} fsmdef_states_t;
|
||||
|
||||
const char * fsmdef_state_name (int state);
|
||||
|
||||
#endif
|
|
@ -13,7 +13,6 @@ extern "C"
|
|||
{
|
||||
#include "ccapi_call.h"
|
||||
#include "ccapi_call_info.h"
|
||||
#include "fsmdef_states.h"
|
||||
}
|
||||
|
||||
static const char* logTag = "CC_SIPCCCallInfo";
|
||||
|
@ -57,16 +56,6 @@ cc_call_state_t CC_SIPCCCallInfo::getCallState()
|
|||
return CCAPI_CallInfo_getCallState(callinfo_ref);
|
||||
}
|
||||
|
||||
fsmdef_states_t CC_SIPCCCallInfo::getFsmState() const
|
||||
{
|
||||
return CCAPI_CallInfo_getFsmState(callinfo_ref);
|
||||
}
|
||||
|
||||
std::string CC_SIPCCCallInfo::fsmStateToString (fsmdef_states_t state) const
|
||||
{
|
||||
return fsmdef_state_name(state);
|
||||
}
|
||||
|
||||
std::string CC_SIPCCCallInfo::callStateToString (cc_call_state_t state)
|
||||
{
|
||||
std::string statestr = "";
|
||||
|
|
|
@ -35,7 +35,6 @@ namespace CSF
|
|||
~CC_SIPCCCallInfo ();
|
||||
|
||||
cc_call_state_t getCallState ();
|
||||
fsmdef_states_t getFsmState () const;
|
||||
bool getRingerState();
|
||||
|
||||
virtual cc_call_attr_t getCallAttr();
|
||||
|
@ -43,7 +42,6 @@ namespace CSF
|
|||
|
||||
virtual CC_LinePtr getline ();
|
||||
virtual std::string callStateToString (cc_call_state_t state);
|
||||
virtual std::string fsmStateToString (fsmdef_states_t state) const;
|
||||
virtual std::string callEventToString (ccapi_call_event_e callEvent);
|
||||
virtual cc_call_type_t getCallType();
|
||||
virtual std::string getCalledPartyName();
|
||||
|
|
Загрузка…
Ссылка в новой задаче