Client support for the most trivial call forking with only one 2xx answer.

git-svn-id: http://yate.null.ro/svn/yate/trunk@1067 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2006-10-05 22:37:36 +00:00
parent 7d10934a2b
commit 6ddad0a013
4 changed files with 23 additions and 2 deletions

View File

@ -25,6 +25,12 @@
; prack: bool: Enable acknowledging provisional 1xx answers (RFC 3262)
;prack=disable
; info: bool: Accept incoming INFO messages
;info=enable
; fork: bool: Follow first forked 2xx answer on early dialogs
;fork=enable
; progress: bool: Send an "183 Session Progress" just after successfull routing
;progress=disable

View File

@ -235,7 +235,7 @@ SIPTransaction* SIPEngine::addMessage(SIPMessage* message)
return new SIPTransaction(message,this,message->isOutgoing());
}
SIPTransaction* SIPEngine::forkInvite(SIPMessage* answer, const SIPTransaction* trans)
SIPTransaction* SIPEngine::forkInvite(SIPMessage* answer, SIPTransaction* trans)
{
// TODO: build new transaction or CANCEL
Debug(this,DebugInfo,"Message %p was a forked INVITE answer [%p]",answer,this);

View File

@ -1080,7 +1080,7 @@ public:
* @param trans One of the transactions part of the same INVITE
* @return Pointer to new transaction or NULL if message is ignored
*/
virtual SIPTransaction* forkInvite(SIPMessage* answer, const SIPTransaction* trans);
virtual SIPTransaction* forkInvite(SIPMessage* answer, SIPTransaction* trans);
/**
* Get the timeout to be used for transactions involving human interaction.

View File

@ -167,6 +167,7 @@ public:
virtual bool checkUser(const String& username, const String& realm, const String& nonce,
const String& method, const String& uri, const String& response,
const SIPMessage* message, GenObject* userData);
virtual SIPTransaction* forkInvite(SIPMessage* answer, SIPTransaction* trans);
inline bool prack() const
{ return m_prack; }
inline bool info() const
@ -176,6 +177,7 @@ private:
YateSIPEndPoint* m_ep;
bool m_prack;
bool m_info;
bool m_fork;
};
class YateSIPLine : public String
@ -933,6 +935,7 @@ YateSIPEngine::YateSIPEngine(YateSIPEndPoint* ep)
m_info = s_cfg.getBoolValue("general","info",true);
if (m_info)
addAllowed("INFO");
m_fork = s_cfg.getBoolValue("general","fork",true);
NamedList *l = s_cfg.getSection("methods");
if (l) {
unsigned int len = l->length();
@ -947,6 +950,18 @@ YateSIPEngine::YateSIPEngine(YateSIPEndPoint* ep)
}
}
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"));
return trans;
}
return SIPEngine::forkInvite(answer,trans);
}
bool YateSIPEngine::buildParty(SIPMessage* message)
{
return m_ep->buildParty(message);