Add login/logout failure error to user.notify message.
git-svn-id: http://voip.null.ro/svn/yate@4677 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
9b2884b121
commit
5b718f2810
|
@ -107,7 +107,7 @@ public:
|
|||
inline int remotePort() const
|
||||
{ return m_remotePort; }
|
||||
private:
|
||||
void setRegistered(bool registered, const char* reason = 0);
|
||||
void setRegistered(bool registered, const char* reason = 0, const char* error = 0);
|
||||
String m_name;
|
||||
String m_username; // Username
|
||||
String m_password; // Password
|
||||
|
@ -610,7 +610,7 @@ YIAXLine::~YIAXLine()
|
|||
}
|
||||
|
||||
// Set the registered status, emits user.notify messages if necessary
|
||||
void YIAXLine::setRegistered(bool registered, const char* reason)
|
||||
void YIAXLine::setRegistered(bool registered, const char* reason, const char* error)
|
||||
{
|
||||
if ((m_registered == registered) && !reason)
|
||||
return;
|
||||
|
@ -621,8 +621,8 @@ void YIAXLine::setRegistered(bool registered, const char* reason)
|
|||
m->addParam("protocol","iax");
|
||||
m->addParam("username",m_username);
|
||||
m->addParam("registered",String::boolText(registered));
|
||||
if (reason)
|
||||
m->addParam("reason",reason);
|
||||
m->addParam("reason",reason,false);
|
||||
m->addParam("error",error,false);
|
||||
Engine::enqueue(m);
|
||||
}
|
||||
}
|
||||
|
@ -792,7 +792,7 @@ void YIAXLineContainer::regTerminate(IAXEvent* event)
|
|||
line->toString().c_str(),what,tf,line->m_remoteAddr.c_str(),
|
||||
line->m_remotePort,reason.safe());
|
||||
clearTransaction(line);
|
||||
line->setRegistered(ok,reason);
|
||||
line->setRegistered(ok,reason,event->type() == IAXEvent::Reject ? "noauth" : 0);
|
||||
remove = !line->m_register;
|
||||
}
|
||||
line->unlock();
|
||||
|
|
|
@ -601,7 +601,7 @@ private:
|
|||
void clearTransaction();
|
||||
void detectLocal(const SIPMessage* msg);
|
||||
void keepalive();
|
||||
void setValid(bool valid, const char* reason = 0);
|
||||
void setValid(bool valid, const char* reason = 0, const char* error = 0);
|
||||
virtual void changing();
|
||||
|
||||
String m_registrar;
|
||||
|
@ -6573,7 +6573,7 @@ void YateSIPLine::setupAuth(SIPMessage* msg) const
|
|||
msg->setAutoAuth(getAuthName(),m_password);
|
||||
}
|
||||
|
||||
void YateSIPLine::setValid(bool valid, const char* reason)
|
||||
void YateSIPLine::setValid(bool valid, const char* reason, const char* error)
|
||||
{
|
||||
DDebug(&plugin,DebugInfo,"YateSIPLine(%s) setValid(%u,%s) current=%u [%p]",
|
||||
c_str(),valid,reason,m_valid,this);
|
||||
|
@ -6588,8 +6588,8 @@ void YateSIPLine::setValid(bool valid, const char* reason)
|
|||
if (m_domain)
|
||||
m->addParam("domain",m_domain);
|
||||
m->addParam("registered",String::boolText(valid));
|
||||
if (reason)
|
||||
m->addParam("reason",reason);
|
||||
m->addParam("reason",reason,false);
|
||||
m->addParam("error",error,false);
|
||||
Engine::enqueue(m);
|
||||
}
|
||||
}
|
||||
|
@ -6774,7 +6774,7 @@ bool YateSIPLine::process(SIPEvent* ev)
|
|||
default:
|
||||
// detect local address even from failed attempts - helps next time
|
||||
detectLocal(msg);
|
||||
setValid(false,msg->reason);
|
||||
setValid(false,msg->reason,lookup(msg->code,dict_errors,String(msg->code)));
|
||||
if (!m_keepTcpOffline)
|
||||
setParty();
|
||||
Debug(&plugin,DebugWarn,"SIP line '%s' logon failure %d: %s",
|
||||
|
|
Loading…
Reference in New Issue