Added support for following forked transactions' 1xx provisional messages.

git-svn-id: http://voip.null.ro/svn/yate@6318 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2018-07-03 12:19:25 +00:00
parent 1a8b055ed2
commit 7de893f3c1
2 changed files with 19 additions and 6 deletions

View File

@ -154,6 +154,11 @@
; This parameter is applied on reload
;fork=enable
; fork_early: bool: Also follow forked 1xx on early dialogs
; Ignored if fork following on 2xx is disabled
; This parameter is applied on reload
;fork_early=disable
; progress: bool: Send an "183 Session Progress" just after successfull routing
;progress=disable

View File

@ -672,6 +672,7 @@ private:
bool m_prack;
bool m_info;
bool m_fork;
bool m_forkEarly;
bool m_foreignAuth;
};
@ -4555,6 +4556,7 @@ void YateSIPEngine::initialize(NamedList* params)
params = &dummy;
lazyTrying(params->getBoolValue("lazy100",false));
m_fork = params->getBoolValue("fork",true);
m_forkEarly = params->getBoolValue("fork_early",false);
m_flags = params->getIntValue("flags",m_flags);
m_foreignAuth = params->getBoolValue("auth_foreign",false);
m_reqTransCount = params->getIntValue("sip_req_trans_count",4,2,10,false);
@ -4572,12 +4574,18 @@ void YateSIPEngine::initialize(NamedList* params)
SIPTransaction* YateSIPEngine::forkInvite(SIPMessage* answer, SIPTransaction* trans)
{
if (m_fork && trans->isActive() && (answer->code/100) == 2)
{
Debug(this,DebugNote,"Changing early dialog tag because of forked 2xx");
trans->setDialogTag(answer->getParamValue("To","tag"));
trans->processMessage(answer);
return trans;
if (m_fork && (answer->code > 100) && trans->isActive()) {
switch (answer->code / 100) {
case 1:
if (!m_forkEarly)
break;
// fall through
case 2:
Debug(this,DebugNote,"Changing early dialog tag because of forked %d",answer->code);
trans->setDialogTag(answer->getParamValue("To","tag"));
trans->processMessage(answer);
return trans;
}
}
return SIPEngine::forkInvite(answer,trans);
}