Add the connection_id parameter to user.auth, user.unregister, call.preroute and chan.startup messages.

git-svn-id: http://voip.null.ro/svn/yate@6089 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2016-02-08 15:06:38 +00:00
parent d05cc95e65
commit 4d9c024f52
1 changed files with 15 additions and 3 deletions

View File

@ -4541,6 +4541,9 @@ bool YateSIPEngine::checkUser(String& username, const String& realm, const Strin
m.addParam("ip_host",raddr);
m.addParam("ip_port",port);
m.addParam("ip_transport",message->getParty()->getProtoName());
YateSIPTransport* trans = YOBJECT(YateSIPTransport,message->getParty());
if (trans)
trans->fillMessage(m);
if (raddr)
m.addParam("address",SocketAddr::appendTo(raddr,rport));
// a dialogless INVITE could create a new call
@ -5364,11 +5367,11 @@ void YateSIPEndPoint::regRun(const SIPMessage* message, SIPTransaction* t)
hl = message->getHeader("User-Agent");
if (hl)
msg.setParam("device",*hl);
// Add transport if registering
if (expires && message->getParty()) {
// Add transport and also route if registering
if (message->getParty()) {
YateSIPTransport* trans = static_cast<YateSIPTransport*>(message->getParty()->getTransport());
if (trans)
trans->fillMessage(msg,true);
trans->fillMessage(msg,(0 != expires));
}
copySipHeaders(msg,*message,true,static_cast<const YateSIPEngine*>(t->getEngine())->foreignAuth());
SIPMessage* r = 0;
@ -5820,6 +5823,9 @@ YateSIPConnection::YateSIPConnection(SIPEvent* ev, SIPTransaction* tr)
m->addParam("ip_host",m_host);
m->addParam("ip_port",String(m_port));
m->addParam("ip_transport",m_tr->initialMessage()->getParty()->getProtoName());
YateSIPTransport* trans = YOBJECT(YateSIPTransport,m_tr->initialMessage()->getParty());
if (trans)
trans->fillMessage(*m);
m->addParam("sip_uri",uri);
m->addParam("sip_from",m_uri);
m->addParam("sip_to",ev->getMessage()->getHeaderValue("To"));
@ -5931,6 +5937,7 @@ YateSIPConnection::YateSIPConnection(SIPEvent* ev, SIPTransaction* tr)
s->addParam("called",uri.getUser());
if (m_user)
s->addParam(s_username,m_user);
s->copyParam(*m,YSTRING("connection_id"));
Engine::enqueue(s);
}
@ -6013,6 +6020,10 @@ YateSIPConnection::YateSIPConnection(Message& msg, const String& uri, const char
return;
}
setParty(m->getParty());
String connId;
YateSIPTransport* trans = YOBJECT(YateSIPTransport,m->getParty());
if (trans)
connId = trans->toString();
updateRtpNatAddress(&msg);
int maxf = msg.getIntValue(YSTRING("antiloop"),s_maxForwards);
m->addHeader("Max-Forwards",String(maxf));
@ -6126,6 +6137,7 @@ YateSIPConnection::YateSIPConnection(Message& msg, const String& uri, const char
s->setParam("calledfull",m_uri.getUser());
if (callid())
s->setParam("sip_callid",callid());
s->addParam("connection_id",connId);
Engine::enqueue(s);
}