b2b: return value of relayEvent

return -1 if the other leg doesn't exist
sayer/1.4-spce2.6
Stefan Sayer 16 years ago
parent bdc30b757a
commit 5bd17750ec

@ -543,7 +543,7 @@ void SBCDialog::process(AmEvent* ev)
AmB2BCallerSession::process(ev);
}
void SBCDialog::relayEvent(AmEvent* ev) {
int SBCDialog::relayEvent(AmEvent* ev) {
if ((call_profile.headerfilter != Transparent) &&
(ev->event_id == B2BSipRequest)) {
// header filter
@ -578,7 +578,7 @@ void SBCDialog::relayEvent(AmEvent* ev) {
}
}
AmB2BCallerSession::relayEvent(ev);
return AmB2BCallerSession::relayEvent(ev);
}
int SBCDialog::filterBody(AmSdp& sdp, bool is_a2b) {
@ -880,7 +880,7 @@ inline UACAuthCred* SBCCalleeSession::getCredentials() {
return &call_profile.auth_credentials;
}
void SBCCalleeSession::relayEvent(AmEvent* ev) {
int SBCCalleeSession::relayEvent(AmEvent* ev) {
if ((call_profile.headerfilter != Transparent) &&
(ev->event_id == B2BSipRequest)) {
// header filter
@ -915,7 +915,7 @@ void SBCCalleeSession::relayEvent(AmEvent* ev) {
}
}
AmB2BCalleeSession::relayEvent(ev);
return AmB2BCalleeSession::relayEvent(ev);
}
void SBCCalleeSession::onSipRequest(const AmSipRequest& req) {

@ -126,7 +126,7 @@ class SBCDialog : public AmB2BCallerSession
void onCancel();
protected:
void relayEvent(AmEvent* ev);
int relayEvent(AmEvent* ev);
void onSipReply(const AmSipReply& reply, int old_dlg_status,
const string& trans_method);
@ -147,7 +147,7 @@ class SBCCalleeSession
SBCCallProfile call_profile;
protected:
void relayEvent(AmEvent* ev);
int relayEvent(AmEvent* ev);
void onSipRequest(const AmSipRequest& req);
void onSipReply(const AmSipReply& reply, int old_dlg_status,

@ -252,15 +252,19 @@ void AmB2BSession::onInvite2xx(const AmSipReply& reply)
}
}
void AmB2BSession::relayEvent(AmEvent* ev)
int AmB2BSession::relayEvent(AmEvent* ev)
{
DBG("AmB2BSession::relayEvent: id=%s\n",
other_id.c_str());
if(!other_id.empty())
AmSessionContainer::instance()->postEvent(other_id,ev);
else
if(!other_id.empty()) {
if (!AmSessionContainer::instance()->postEvent(other_id,ev))
return -1;
} else {
delete ev;
}
return 0;
}
void AmB2BSession::onOtherBye(const AmSipRequest& req)
@ -587,7 +591,7 @@ void AmB2BCallerSession::onB2BEvent(B2BEvent* ev)
AmB2BSession::onB2BEvent(ev);
}
void AmB2BCallerSession::relayEvent(AmEvent* ev)
int AmB2BCallerSession::relayEvent(AmEvent* ev)
{
if(other_id.empty()){
@ -605,7 +609,7 @@ void AmB2BCallerSession::relayEvent(AmEvent* ev)
}
}
AmB2BSession::relayEvent(ev);
return AmB2BSession::relayEvent(ev);
}
void AmB2BCallerSession::onSessionStart(const AmSipRequest& req)

@ -166,8 +166,8 @@ class AmB2BSession: public AmSession
/** reset relation with other leg */
virtual void clear_other();
/** Relay one event to the other side. */
virtual void relayEvent(AmEvent* ev);
/** Relay one event to the other side. @return 0 on success */
virtual int relayEvent(AmEvent* ev);
/** send a relayed SIP Request */
void relaySip(const AmSipRequest& req);
@ -251,7 +251,7 @@ class AmB2BCallerSession: public AmB2BSession
protected:
AmSipRequest invite_req;
virtual void createCalleeSession();
void relayEvent(AmEvent* ev);
int relayEvent(AmEvent* ev);
/** Tell if the session should
* relay early media SDPs to

Loading…
Cancel
Save