MT#56321 Use the P-DSM-App instead of the P-Early-Announce

Since the P-Early-Announce has gotten deprecated, it's required
to stop using it. And instead start using the P-DSM-App header, which
now carries the same information as parameter ';early-annonce='.

Change-Id: I7f0f378143d0b6600a239084cd51935a31df3d08
mr11.3.1
Donat Zenichev 3 years ago
parent 91039bb8a9
commit 14ad7f85f6

@ -552,16 +552,19 @@ void CallLeg::onInitialReply(B2BSipReplyEvent *e)
{
/* 100-199 */
if (e->reply.code < 200) {
string announce = getHeader(e->reply.hdrs, SIP_HDR_P_EARLY_ANNOUNCE);
dlg->setForcedEarlyAnnounce(announce.find("force") != std::string::npos);
string announce = getHeader(e->reply.hdrs, SIP_HDR_P_DSM_APP);
string p_dsm_app_param = get_header_param(announce, "early-announce");
dlg->setForcedEarlyAnnounce(p_dsm_app_param == "force");
/* exceptionally treat 183 with the 'P-Early-Announce: force',
/* exceptionally treat 183 with the 'P-DSM-App: <app-name>;early-announce=force',
similarly to the 200OK response, this will properly update the caller
with the late SDP capabilities (an early announcement),
which has been put on hold during the transfer
DSM applications using it:
- early_dbprompt (early_announce) */
- early_dbprompt (early_announce)
- pre_announce
- play_last_caller */
if (e->reply.code == 183 && !announce.empty() && dlg->getForcedEarlyAnnounce()) {
b2bInitial2xx(e->reply, e->forward);
} else {

@ -292,10 +292,11 @@ void AmB2BSession::onB2BEvent(B2BEvent* ev)
} else {
/* ensure that 'P-Early-Announce: force' is not present */
/* ensure that 'P-DSM-App: <app-name>;early-announce=force' is not present */
if (reply_ev->reply.code == 183 && !dlg->getForcedEarlyAnnounce()) {
string announce = getHeader(reply_ev->reply.hdrs, SIP_HDR_P_EARLY_ANNOUNCE);
dlg->setForcedEarlyAnnounce(announce.find("force") != std::string::npos);
string announce = getHeader(reply_ev->reply.hdrs, SIP_HDR_P_DSM_APP);
string p_dsm_app_param = get_header_param(announce, "early-announce");
dlg->setForcedEarlyAnnounce(p_dsm_app_param == "force");
}
/* don't forget to reset the force_early_announce, if 200 OK in the same leg received */
@ -334,7 +335,7 @@ void AmB2BSession::onB2BEvent(B2BEvent* ev)
if (dlg->getUACInvTransPending()) {
DBG("changed session, but UAC INVITE trans pending\n");
} else {
DBG("Received 183 with P-Early-Announce: force, refreshing media session.\n");
DBG("Received 183 with <;early-announce=force>, refreshing media session.\n");
setMute(true);
AmMediaProcessor::instance()->removeSession(this);

@ -407,8 +407,9 @@ bool AmSipDialog::onRxReplyStatus(const AmSipReply& reply)
/* 100-199 */
if (reply.code < 200) {
string announce = getHeader(reply.hdrs, SIP_HDR_P_EARLY_ANNOUNCE, true);
setForcedEarlyAnnounce(announce.find("force") != std::string::npos);
string announce = getHeader(reply.hdrs, SIP_HDR_P_DSM_APP, true);
string p_dsm_app_param = get_header_param(announce, "early-announce");
setForcedEarlyAnnounce(p_dsm_app_param == "force");
/* we should always keep Route set for this leg updated in case
the provisional response updates the list of routes for any reason */
@ -418,7 +419,7 @@ bool AmSipDialog::onRxReplyStatus(const AmSipReply& reply)
setRouteSet(reply.route);
}
/* exceptionally treat 183 with the 'P-Early-Announce: force',
/* exceptionally treat 183 with the 'P-DSM-App: <app-name>;early-announce=force',
similarly to the 200OK response, this will properly update the caller
with the late SDP capabilities (an early announcement),
which has been put on hold during the transfer
@ -429,7 +430,7 @@ bool AmSipDialog::onRxReplyStatus(const AmSipReply& reply)
- early_dbprompt (early_announce)
- pre_announce */
if (reply.code == 183 && !announce.empty() && getForcedEarlyAnnounce()) {
DBG("This is 183 with <P-Early-Announce: force>, treated exceptionally as 200OK.\n");
DBG("This is 183 with <;early-announce=force>, treated exceptionally as 200OK.\n");
setStatus(Connected);
setFaked183As200(true); /* remember that this is a faked 200OK, indeed 183 */
@ -510,7 +511,7 @@ bool AmSipDialog::onRxReplyStatus(const AmSipReply& reply)
bool cont = true;
/* For those exceptional 183 with the 'P-Early-Announce: force'
/* For those exceptional 183 with the 'P-DSM-App: <app-name>;early-announce=force'
we don't want to fully imitate 200OK processing, and send ACK
further processing with ACK is only applied to real 200OK responses */
if ( (reply.code >= 200) && (reply.code < 300) &&

@ -59,7 +59,7 @@ protected:
// Reliable provisional reply support
Am100rel rel100;
/* Needed to properly handle 183->200OK faking, when 'P-Early-Announce: force'
/* Needed to properly handle 183->200OK faking, when 'P-DSM-App: <app-name>;early-announce=force'
* is added into 183, and we have to treat 183 similarly to 200OK.
* Means, we have to embed the early media into already established media session.
*/

@ -54,7 +54,6 @@
#define SIP_HDR_EVENT "Event"
#define SIP_HDR_SUBSCRIPTION_STATE "Subscription-State"
#define SIP_HDR_REPLACES "Replaces"
#define SIP_HDR_P_EARLY_ANNOUNCE "P-Early-Announce"
#define SIP_HDR_P_DSM_APP "P-DSM-App"
#define SIP_HDR_COL(_hdr) _hdr ":"

Loading…
Cancel
Save