optionally relay early media (180 .. 183) into caller leg of B2B sessions.

note this effects only applications where call is accepted before creating
second call leg, i.e. it does not affect call_timer/auth_b2b.

based on a patch by Tom van der Geer 



git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1362 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 17 years ago
parent 51f29b52c3
commit c0f8e76d2d

@ -236,7 +236,7 @@ void AmB2BSession::relaySip(const AmSipRequest& orig, const AmSipReply& reply)
AmB2BCallerSession::AmB2BCallerSession()
: AmB2BSession(),
callee_status(None)
callee_status(None), sip_relay_early_media_sdp(false)
{
}
@ -244,6 +244,11 @@ AmB2BCallerSession::~AmB2BCallerSession()
{
}
void AmB2BCallerSession::set_sip_relay_early_media_sdp(bool r)
{
sip_relay_early_media_sdp = r;
}
void AmB2BCallerSession::terminateLeg()
{
AmB2BSession::terminateLeg();
@ -275,6 +280,10 @@ void AmB2BCallerSession::onB2BEvent(B2BEvent* ev)
case Ringing:
if(reply.code < 200){
if ((!sip_relay_only) && sip_relay_early_media_sdp &&
reply.code>=180 && reply.code<=183 && (!reply.body.empty())) {
reinviteCaller(reply);
}
callee_status = Ringing;
}

@ -191,6 +191,12 @@ class AmB2BCallerSession: public AmB2BSession
virtual void createCalleeSession();
void relayEvent(AmEvent* ev);
/** Tell if the session should
* relay early media SDPs to
* caller leg
*/
bool sip_relay_early_media_sdp;
public:
AmB2BCallerSession();
virtual ~AmB2BCallerSession();
@ -215,6 +221,7 @@ class AmB2BCallerSession: public AmB2BSession
AmSipRequest* getInviteReq() { return &invite_req; }
void set_sip_relay_early_media_sdp(bool r);
};
/** \brief Callee leg of a B2B session */

Loading…
Cancel
Save