[OpenSIPS-Users] Need help in memory caching in opensips 3.0 .

Sasmita Panda spanda at 3clogic.com
Fri May 29 12:35:21 EST 2020


Hi ,

I am trying to do memory caching for authentication .  Followed the below
link.
https://www.opensips.org/Documentation/Tutorials-MemoryCaching

my DB looks like below .
| id | username | domain               | password | email_address | ha1 |
ha1b | rpid |
+----+----------+--------------------------------------------+----------+---------------+-----+------+------+
|  1 | 7878     | fs-reg.i3clogic.com | som123 |               |     |
 | NULL |

loadmodule "cachedb_local.so"
#loading auth module
loadmodule "auth.so"
loadmodule "auth_db.so"

modparam("auth_db", "db_url", "mysql://root:cccl0g1c@localhost/opensips")
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "user_column", "username")
#modparam("auth_db", "use_domain", 1)
modparam("auth_db", "domain_column", "domain")
modparam("auth_db", "password_column", "password")
modparam("auth_db", "load_credentials", "$avp(55)=password")

modparam("auth","username_spec","$avp(54)")
modparam("auth","password_spec","$avp(55)")

 if(cache_fetch("local","passwd_$tu",$avp(55))) {
                $avp(54) = $tU;
                if (!pv_www_authorize("")) {
                        # authentication failed -> do challenge
                        www_challenge("", "1");
                        exit;
                };
        } else {
                if (!www_authorize("", "subscriber")) {
                        # authentication failed -> do challenge
                        www_challenge("", "1");
                        exit;
                };
                # after DB authentication, the password is available
                cache_store("local","passwd_$tu","$avp(55)",1200);
        }


This thing I have done . While doing DB authentication its working , but
which doing through memory caching its giving error "Incorrect Password" .
Whats wrong I  am doing . please help me .

*Thanks & Regards*
*Sasmita Panda*
*Senior Network Testing and Software Engineer*
*3CLogic , ph:07827611765*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200529/e3f31c0f/attachment-0001.html>


More information about the Users mailing list