Add the SIP channel ID to the user.auth message.
git-svn-id: http://voip.null.ro/svn/yate@6092 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
f1ddfd1e5f
commit
40d4e7824e
1 changed files with 15 additions and 8 deletions
|
@ -4496,6 +4496,7 @@ bool YateSIPEngine::copyAuthParams(NamedList* dest, const NamedList& src, bool o
|
||||||
{ "ip_host", 1 },
|
{ "ip_host", 1 },
|
||||||
{ "ip_port", 1 },
|
{ "ip_port", 1 },
|
||||||
{ "address", 1 },
|
{ "address", 1 },
|
||||||
|
{ "id", 1 },
|
||||||
{ "billid", 1 },
|
{ "billid", 1 },
|
||||||
{ "handlers", 1 },
|
{ "handlers", 1 },
|
||||||
{ 0, 0 },
|
{ 0, 0 },
|
||||||
|
@ -4571,6 +4572,7 @@ bool YateSIPEngine::checkUser(String& username, const String& realm, const Strin
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params) {
|
if (params) {
|
||||||
|
m.copyParam(*params,"id");
|
||||||
m.copyParam(*params,"number");
|
m.copyParam(*params,"number");
|
||||||
m.copyParam(*params,"caller");
|
m.copyParam(*params,"caller");
|
||||||
m.copyParam(*params,"called");
|
m.copyParam(*params,"called");
|
||||||
|
@ -5480,6 +5482,13 @@ bool YateSIPEndPoint::generic(const SIPMessage* message, SIPTransaction* t, cons
|
||||||
m.addParam("module",plugin.name());
|
m.addParam("module",plugin.name());
|
||||||
m.addParam("route_type","msg");
|
m.addParam("route_type","msg");
|
||||||
}
|
}
|
||||||
|
YateSIPConnection* conn = 0;
|
||||||
|
if (message->getParam("To","tag")) {
|
||||||
|
SIPDialog dlg(*message);
|
||||||
|
conn = plugin.findDialog(dlg,true);
|
||||||
|
if (conn)
|
||||||
|
m.addParam("id",conn->id());
|
||||||
|
}
|
||||||
String host;
|
String host;
|
||||||
int portNum = 0;
|
int portNum = 0;
|
||||||
message->getParty()->getAddr(host,portNum,false);
|
message->getParty()->getAddr(host,portNum,false);
|
||||||
|
@ -5503,6 +5512,7 @@ bool YateSIPEndPoint::generic(const SIPMessage* message, SIPTransaction* t, cons
|
||||||
DDebug(&plugin,DebugAll,"User '%s' age %d",user.c_str(),age);
|
DDebug(&plugin,DebugAll,"User '%s' age %d",user.c_str(),age);
|
||||||
if ((age < 0) || (age > 10)) {
|
if ((age < 0) || (age > 10)) {
|
||||||
setAuthError(t,m,age >= 0);
|
setAuthError(t,m,age >= 0);
|
||||||
|
TelEngine::destruct(conn);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5510,14 +5520,10 @@ bool YateSIPEndPoint::generic(const SIPMessage* message, SIPTransaction* t, cons
|
||||||
YateSIPTransport* trans = YOBJECT(YateSIPTransport,message->getParty());
|
YateSIPTransport* trans = YOBJECT(YateSIPTransport,message->getParty());
|
||||||
if (trans)
|
if (trans)
|
||||||
trans->fillMessage(m);
|
trans->fillMessage(m);
|
||||||
if (message->getParam("To","tag")) {
|
|
||||||
SIPDialog dlg(*message);
|
|
||||||
YateSIPConnection* conn = plugin.findDialog(dlg,true);
|
|
||||||
if (conn) {
|
if (conn) {
|
||||||
m.userData(conn);
|
m.userData(conn);
|
||||||
conn->complete(m);
|
conn->complete(m);
|
||||||
conn->deref();
|
TelEngine::destruct(conn);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
m.addParam(s_username,user,false);
|
m.addParam(s_username,user,false);
|
||||||
|
|
||||||
|
@ -7086,6 +7092,7 @@ bool YateSIPConnection::checkUser(SIPTransaction* t, bool refuse)
|
||||||
if (m_user.null() || m_line)
|
if (m_user.null() || m_line)
|
||||||
return true;
|
return true;
|
||||||
NamedList params("");
|
NamedList params("");
|
||||||
|
params.addParam("id",id());
|
||||||
params.addParam("billid",billid(),false);
|
params.addParam("billid",billid(),false);
|
||||||
int age = t->authUser(m_user,false,¶ms);
|
int age = t->authUser(m_user,false,¶ms);
|
||||||
if ((age >= 0) && (age <= 10))
|
if ((age >= 0) && (age <= 10))
|
||||||
|
|
Loading…
Reference in a new issue