ERRNO -> RES, exception on error

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1569 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 16 years ago
parent 8590f5773c
commit c38b248495

@ -65,10 +65,12 @@ EXEC_ACTION_START(ConfPostEventAction) {
unsigned int ev;
if (str2i(ev_id, ev)) {
ERROR("decoding conference event id '%s'\n", ev_id.c_str());
sc_sess->SET_RES(DSM_RES_UNKNOWN_ARG);
return false;
}
AmConferenceStatus::postConferenceEvent(channel_id, ev, sess->getLocalTag());
sc_sess->SET_RES(DSM_RES_OK);
} EXEC_ACTION_END;
static bool ConferenceJoinChannel(DSMConfChannel** dsm_chan,
@ -94,6 +96,7 @@ static bool ConferenceJoinChannel(DSMConfChannel** dsm_chan,
sess->getLocalTag());
if (NULL == chan) {
ERROR("obtaining conference channel\n");
throw DSMException("conference");
return false;
}
if (NULL != *dsm_chan) {
@ -130,9 +133,9 @@ EXEC_ACTION_START(ConfJoinAction) {
// add to garbage collector
sc_sess->transferOwnership(dsm_chan);
sc_sess->SET_ERRNO(DSM_ERRNO_OK);
sc_sess->SET_RES(DSM_RES_OK);
} else {
sc_sess->SET_ERRNO(DSM_ERRNO_UNKNOWN_ARG);
sc_sess->SET_RES(DSM_RES_UNKNOWN_ARG);
}
} EXEC_ACTION_END;
@ -160,10 +163,12 @@ EXEC_ACTION_START(ConfLeaveAction) {
DSMConfChannel* chan = getDSMConfChannel(sc_sess);
if (NULL == chan) {
WARN("app error: trying to leave conference, but channel not found\n");
sc_sess->SET_ERRNO(DSM_ERRNO_UNKNOWN_ARG);
sc_sess->SET_RES(DSM_RES_UNKNOWN_ARG);
return false;
}
chan->release();
sc_sess->SET_RES(DSM_RES_OK);
} EXEC_ACTION_END;
CONST_ACTION_2P(ConfRejoinAction, ',', true);
@ -179,9 +184,9 @@ EXEC_ACTION_START(ConfRejoinAction) {
}
if (ConferenceJoinChannel(&chan, sess, sc_sess, channel_id, mode)) {
sc_sess->SET_ERRNO(DSM_ERRNO_OK);
sc_sess->SET_RES(DSM_RES_OK);
} else {
sc_sess->SET_ERRNO(DSM_ERRNO_UNKNOWN_ARG);
sc_sess->SET_RES(DSM_RES_UNKNOWN_ARG);
}
} EXEC_ACTION_END;
@ -193,4 +198,5 @@ EXEC_ACTION_START(ConfSetPlayoutTypeAction) {
sess->rtp_str.setPlayoutType(JB_PLAYOUT);
else
sess->rtp_str.setPlayoutType(SIMPLE_PLAYOUT);
sc_sess->SET_RES(DSM_RES_OK);
} EXEC_ACTION_END;

@ -1,12 +1,14 @@
Actions:
conference.join(string roomname [, string mode])
mode = "" | speakonly | listenonly
Throws "conference" Exception if conference can not be joined (currently never).
conference.leave()
destroy conference channel. Close playlist first!!!!!
conference.rejoin(string roomname [, string mode])
mode = "" | speakonly | listenonly
Throws "conference" Exception if conference can not be joined (currently never).
conference.postEvent(string roomname, int event_id)

Loading…
Cancel
Save