b2b API changed: onOtherReply may absorb replies

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@523 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 19 years ago
parent 6998274a9a
commit 8836f205ae

@ -195,7 +195,7 @@ void MyCCDialog::process(AmEvent* ev)
AmB2BCallerSession::process(ev);
}
void MyCCDialog::onOtherReply(const AmSipReply& reply) {
bool MyCCDialog::onOtherReply(const AmSipReply& reply) {
DBG("OnOtherReply \n");
if (state == CC_Dialing) {
if (reply.code < 200) {
@ -226,6 +226,7 @@ void MyCCDialog::onOtherReply(const AmSipReply& reply) {
// AmB2BCallerSession::onOtherReply(reply);
// as it tears down the call if callee could
// not be reached
return false;
}
void MyCCDialog::onOtherBye(const AmSipRequest& req) {

@ -61,7 +61,7 @@ class MyCCDialog : public AmB2BCallerSession
void process(AmEvent* ev);
void onBye(const AmSipRequest& req);
protected:
void onOtherReply(const AmSipReply& reply);
bool onOtherReply(const AmSipReply& reply);
void onOtherBye(const AmSipRequest& req);
};

@ -717,11 +717,12 @@ void IvrDialog::onOtherBye(const AmSipRequest& req)
AmB2BSession::onOtherBye(req);
}
void IvrDialog::onOtherReply(const AmSipReply& r)
bool IvrDialog::onOtherReply(const AmSipReply& r)
{
if(callPyEventHandler("onOtherReply","is",
r.code,r.reason.c_str()))
AmB2BSession::onOtherReply(r);
return false;
}
void IvrDialog::onSipReply(const AmSipReply& r) {

@ -145,7 +145,7 @@ class IvrDialog : public AmB2BCallerSession
void onDtmf(int event, int duration_msec);
void onOtherBye(const AmSipRequest& req);
void onOtherReply(const AmSipReply& r);
bool onOtherReply(const AmSipReply& r);
void onSipReply(const AmSipReply& r);
void onSipRequest(const AmSipRequest& r);

@ -178,10 +178,11 @@ void AmB2BSession::onOtherBye(const AmSipRequest& req)
terminateLeg();
}
void AmB2BSession::onOtherReply(const AmSipReply& reply)
bool AmB2BSession::onOtherReply(const AmSipReply& reply)
{
if(reply.code >= 300)
terminateLeg();
return false;
}
void AmB2BSession::terminateLeg()
@ -233,6 +234,8 @@ void AmB2BCallerSession::terminateOtherLeg()
void AmB2BCallerSession::onB2BEvent(B2BEvent* ev)
{
bool processed = false;
if(ev->event_id == B2BSipReply){
AmSipReply& reply = ((B2BSipReplyEvent*)ev)->reply;
@ -268,7 +271,7 @@ void AmB2BCallerSession::onB2BEvent(B2BEvent* ev)
terminateOtherLeg();
}
onOtherReply(reply);
processed = onOtherReply(reply);
break;
default:
@ -277,7 +280,8 @@ void AmB2BCallerSession::onB2BEvent(B2BEvent* ev)
}
}
AmB2BSession::onB2BEvent(ev);
if (!processed)
AmB2BSession::onB2BEvent(ev);
}
void AmB2BCallerSession::relayEvent(AmEvent* ev)

@ -151,8 +151,12 @@ class AmB2BSession: public AmSession
// Other leg received a BYE
virtual void onOtherBye(const AmSipRequest& req);
/** INVITE from other leg has been replied */
virtual void onOtherReply(const AmSipReply& reply);
/**
* Reply received from other leg has been replied
* @return true if reply was processed (should be absorbed)
* @return false if reply was not processed
*/
virtual bool onOtherReply(const AmSipReply& reply);
AmB2BSession()
: sip_relay_only(true)

Loading…
Cancel
Save