Fixed registration/routing of gatekeeper users.

git-svn-id: http://voip.null.ro/svn/yate@455 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2005-07-17 15:02:20 +00:00
parent c74f0ea384
commit fc264df312
3 changed files with 17 additions and 17 deletions

View File

@ -1537,17 +1537,16 @@ H323GatekeeperRequest::Response YateGatekeeperServer::OnRegistration(H323Gatekee
* we deal just with the first callSignalAddress, since openh323
* don't give a shit for multi hosted boxes.
*/
Message *m = new Message("user.register");
m->addParam("username",alias);
m->addParam("driver","h323");
m->addParam("data",ips);
if (!Engine::dispatch(m) && !m->retValue().null())
return H323GatekeeperRequest::Reject;
Message m("user.register");
m.addParam("username",alias);
m.addParam("driver","h323");
m.addParam("data",ips);
if (Engine::dispatch(m))
return H323GatekeeperRequest::Confirm;
}
return H323GatekeeperRequest::Reject;
}
else
return (H323Transaction::Response)i;
return H323GatekeeperRequest::Confirm;
return (H323Transaction::Response)i;
}
H323GatekeeperRequest::Response YateGatekeeperServer::OnUnregistration(H323GatekeeperURQ& request)
@ -1559,14 +1558,13 @@ H323GatekeeperRequest::Response YateGatekeeperServer::OnUnregistration(H323Gatek
PString alias = H323GetAliasAddressString(request.urq.m_endpointAlias[j]);
if (alias.IsEmpty())
return H323GatekeeperRequest::Reject;
Message *m = new Message("user.unregister");
m->addParam("username",alias);
Engine::dispatch(m);
Message m("user.unregister");
m.addParam("username",alias);
if (Engine::dispatch(m))
return H323GatekeeperRequest::Confirm;
}
}
else
return (H323Transaction::Response)i;
return H323GatekeeperRequest::Confirm;
return (H323Transaction::Response)i;
}
BOOL YateGatekeeperServer::TranslateAliasAddressToSignalAddress(const H225_AliasAddress& alias,H323TransportAddress& address)

View File

@ -136,6 +136,7 @@ bool RouteHandler::received(Message &msg)
if (data) {
Debug("RegFile",DebugInfo,"Routed '%s' via '%s'",username,data);
msg.retValue() = data;
msg.setParam("driver",s_cfg.getValue(username,"driver"));
return true;
}
return false;

View File

@ -152,7 +152,7 @@ bool RegistHandler::received(Message &msg)
m_init= true;
}
String username = c_safe(msg.getValue("username"));
String techno = c_safe(msg.getValue("techno"));
String techno = c_safe(msg.getValue("driver"));
String data = c_safe(msg.getValue("data"));
Lock lock(dbmutex);
@ -237,7 +237,8 @@ bool RouteHandler::received(Message &msg)
s_route_no++;
return false;
}
msg.retValue() = String(PQgetvalue(respgsql,0,1));
msg.setParam("driver",PQgetvalue(respgsql,0,0));
msg.retValue() = PQgetvalue(respgsql,0,1);
Debug(DebugInfo,"Routing call to '%s' in context '%s' using '%s' tehnology and data in " FMT64 " usec",
called.c_str(),context.c_str(),msg.retValue().c_str(),Time::now()-tmr);
s_route_yes++;