<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<pre wrap="">I could implement openser as a registrar(only) server .Thanks to the team<span
class="moz-txt-citetags"> </span>openser for the timely help.I would like to know what all can be done using
<span class="moz-txt-citetags"> </span>openser/kamailio as a registrar server alone. i.e. in the real world<span
class="moz-txt-citetags"> </span>scenario how does openser can be useful as a registrar sever alone.I would
<span class="moz-txt-citetags"> </span>like to make myself clear by pointing to the below example. i can integrate<span
class="moz-txt-citetags"> </span>openser and asterisk and make openser as a registrar (only)server and can
<span class="moz-txt-citetags"> </span>make use of asterisk for call functionality purposes.. Similarly, i would<span
class="moz-txt-citetags"> </span>like to know where openser fits in (openser should only be used as a
<span class="moz-txt-citetags"> </span>registrar server again).
<span class="moz-txt-citetags"> </span>Your responses can speed up my research work..
<span class="moz-txt-citetags"></span>
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>Saúl Ibarra wrote:
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>You are doing save_location before authentication. You should first
<span class="moz-txt-citetags">> </span>challenge the REGISTER for authentication and then do save_location.
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>2009/10/6, Rajesh <a
class="moz-txt-link-rfc2396E"
href="mailto:Rajesh.sreedharan@siptech.com"><Rajesh.sreedharan@siptech.com></a>:
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>Dear All,
<span class="moz-txt-citetags">> </span> I would like my kamailio server to act (only) as a
<span class="moz-txt-citetags">> </span>Registrar server. I have configured my kamilio for performing
<span class="moz-txt-citetags">> </span>authentication successfully, but this time i find that authentication is
<span class="moz-txt-citetags">> </span>not being done.Your views on my cfg is greatly appreciated.
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span># ------------------ module loading ----------------------------------
<span class="moz-txt-citetags">> </span>debug=3
<span class="moz-txt-citetags">> </span>log_stderror=yes
<span class="moz-txt-citetags">> </span>mpath="<i
class="moz-txt-slash"><span class="moz-txt-tag">/</span>usr/local/lib/kamailio/modules<span
class="moz-txt-tag">/</span></i>"
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>loadmodule "db_mysql.so"
<span class="moz-txt-citetags">> </span>loadmodule "mi_fifo.so"
<span class="moz-txt-citetags">> </span>loadmodule "sl.so"
<span class="moz-txt-citetags">> </span>loadmodule "pv.so"
<span class="moz-txt-citetags">> </span>loadmodule "usrloc.so"
<span class="moz-txt-citetags">> </span>loadmodule "registrar.so"
<span class="moz-txt-citetags">> </span>loadmodule "textops.so"
<span class="moz-txt-citetags">> </span>loadmodule "uri_db.so"
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>loadmodule "auth.so"
<span class="moz-txt-citetags">> </span>loadmodule "auth_db.so"
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>port=5060
<span class="moz-txt-citetags">> </span># ----------------- setting module-specific parameters ---------------
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span># ----- mi_fifo params -----
<span class="moz-txt-citetags">> </span>modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span># ----- auth_db params -----
<span class="moz-txt-citetags">> </span>/* uncomment the following lines if you want to enable the DB based
<span class="moz-txt-citetags">> </span> authentication */
<span class="moz-txt-citetags">> </span>modparam("auth_db", "calculate_ha1", yes)
<span class="moz-txt-citetags">> </span>modparam("auth_db", "password_column", "password")
<span class="moz-txt-citetags">> </span>modparam("auth_db", "db_url","mysql://openser:openserrw@localhost/openser")
<span class="moz-txt-citetags">> </span>modparam("auth_db", "load_credentials", "")
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span># -- usrloc params --
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>modparam("usrloc", "db_url",
<span class="moz-txt-citetags">> </span><a
class="moz-txt-link-rfc2396E"
href="mailto:mysql://openser:openserrw@192.168.64.75/openser">"mysql://openser:openserrw@192.168.64.75/openser"</a>)
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>modparam("usrloc", "db_mode", 3)
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span># ------------------------- request routing logic -------------------
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span># main routing logic
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>route{
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span> # initial sanity checks -- too long messages
<span class="moz-txt-citetags">> </span> if (msg:len >= 2048 ) {
<span class="moz-txt-citetags">> </span> sl_send_reply("513", "Message too big");
<span class="moz-txt-citetags">> </span> exit;
<span class="moz-txt-citetags">> </span> };
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span> if (!uri==myself) {
<span class="moz-txt-citetags">> </span> sl_send_reply("400", "Bad destination, only register
<span class="moz-txt-citetags">> </span>messages destined for this server are accepted");
<span class="moz-txt-citetags">> </span> exit;
<span class="moz-txt-citetags">> </span> };
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span> # the only valid message for the registrar is the register message
<span class="moz-txt-citetags">> </span> # other messages are answered with an error message
<span class="moz-txt-citetags">> </span> if (uri==myself) {
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span> if (method=="REGISTER") {
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span> sl_send_reply("100", "Trying");
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span> if(!save("location")) {
<span class="moz-txt-citetags">> </span> sl_reply_error();
<span class="moz-txt-citetags">> </span> };
<span class="moz-txt-citetags">> </span> exit;
<span class="moz-txt-citetags">> </span> } else {
<span class="moz-txt-citetags">> </span> sl_send_reply("403", "Forbidden");
<span class="moz-txt-citetags">> </span> exit;
<span class="moz-txt-citetags">> </span> };
<span class="moz-txt-citetags">> </span> };
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span># Authentication route
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span> if (is_method("REGISTER"))
<span class="moz-txt-citetags">> </span> {
<span class="moz-txt-citetags">> </span> # authenticate the REGISTER requests (uncomment to enable auth)
<span class="moz-txt-citetags">> </span> if (!www_authorize("192.168.64.75", "subscriber"))
<span class="moz-txt-citetags">> </span> {
<span class="moz-txt-citetags">> </span> www_challenge("192.168.64.75", "0");
<span class="moz-txt-citetags">> </span> exit;
<span class="moz-txt-citetags">> </span> }
<span class="moz-txt-citetags">> </span> ###the following lines are uncommented
<span class="moz-txt-citetags">> </span> if ($au!=$tU)
<span class="moz-txt-citetags">> </span> {
<span class="moz-txt-citetags">> </span> sl_send_reply("403","Forbidden auth ID");
<span class="moz-txt-citetags">> </span> exit;
<span class="moz-txt-citetags">> </span> }
<span class="moz-txt-citetags">> </span> }
<span class="moz-txt-citetags">> </span> else
<span class="moz-txt-citetags">> </span> {
<span class="moz-txt-citetags">> </span> # authenticate if from local subscriber (uncomment to enable auth)
<span class="moz-txt-citetags">> </span> if (from_uri==myself)
<span class="moz-txt-citetags">> </span> {
<span class="moz-txt-citetags">> </span> if (!proxy_authorize("", "subscriber"))
<span class="moz-txt-citetags">> </span> {
<span class="moz-txt-citetags">> </span> proxy_challenge("", "0");
<span class="moz-txt-citetags">> </span> exit;
<span class="moz-txt-citetags">> </span> }
<span class="moz-txt-citetags">> </span> if (is_method("PUBLISH"))
<span class="moz-txt-citetags">> </span> {
<span class="moz-txt-citetags">> </span> if ($au!=$tU) {
<span class="moz-txt-citetags">> </span> sl_send_reply("403","Forbidden auth ID");
<span class="moz-txt-citetags">> </span> exit;
<span class="moz-txt-citetags">> </span> }
<span class="moz-txt-citetags">> </span> } else {
<span class="moz-txt-citetags">> </span> if ($au!=$fU) {
<span class="moz-txt-citetags">> </span> sl_send_reply("403","Forbidden auth ID");
<span class="moz-txt-citetags">> </span> exit;
<span class="moz-txt-citetags">> </span> }
<span class="moz-txt-citetags">> </span> }
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span> consume_credentials();
<span class="moz-txt-citetags">> </span> # caller authenticated
<span class="moz-txt-citetags">> </span> }
<span class="moz-txt-citetags">> </span> }
<span class="moz-txt-citetags">> </span> return;
<span class="moz-txt-citetags">> </span>}
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>--
<span class="moz-txt-citetags">> </span>Regards,
<span class="moz-txt-citetags">> </span>Rajesh
<span class="moz-txt-citetags">></span></pre>
</body>
</html>