就是把 usrloc 放到 redis
系统: Debian 13
Kamailio 版本:6.1.1
loadmodule "db_redis.so"
modparam("db_redis", "schema_path", "/usr/share/kamailio/db_redis/kamailio")
modparam("db_redis", "keys", "location=entry:username,ruid&usrdom:username,domain&timer:partition,keepalive&expiry:expires&master:")
loadmodule "usrloc.so"
modparam("usrloc", "timer_interval", 60)
modparam("usrloc", "timer_procs", 1)
modparam("usrloc", "use_domain", 0)
modparam("usrloc", "db_url","redis://localhost:6379/0")
modparam("usrloc", "db_mode",3)
Eyebeam 注册
MicriSIP 注册
redis_cli
>KEYS *
-
"location:expiry::2026-03-30 14:28:18"
-
"location:entry::1002:uloc-69ca17b6-2cac-2"
-
"location:timer::7:1"
-
"location:expiry::2026-03-30 14:32:31"
-
"location:timer::6:1"
-
"location:entry::1001:uloc-69ca17b6-2cac-1"
-
"location:master"
-
"location::index::master"
-
"location::index::expiry"
-
"location::index::timer"
> SCAN 0 MATCH location:entry::1001:uloc-*
-
"7"
-
- "location:entry::1001:uloc-69ca17b6-2cac-1"
用这个也行
> KEYS location:entry::1001:uloc-*
但这个命令不推荐
>HGETALL location:entry::1001:uloc-69ca17b6-2cac-1
-
"q"
-
"-1.000000"
-
"connection_id"
-
"-1"
-
"user_agent"
-
"eyeBeam release 1011d stamp 40820"
-
"socket"
-
"udp:192.168.1.199:5060"
-
"cflags"
-
"64"
-
"server_id"
-
"0"
-
"keepalive"
-
"1"
-
"cseq"
-
"4"
-
"expires"
-
"2026-03-30 14:31:01"
-
"partition"
-
"6"
-
"instance"
-
""
-
"contact"
-
"sip:1001@192.168.1.171:51706;rinstance=aefa8beff9e36c5a;transport=udp"
-
"username"
-
"1001"
-
"flags"
-
"0"
-
"callid"
-
"NWFlOTAxNTEyMTI5NGY5MmY4NDg4OTJjMzBlY2M1NTU."
-
"reg_id"
-
"0"
-
"path"
-
""
-
"last_modified"
-
"2026-03-30 14:30:01"
-
"received"
-
"sip:192.168.1.171:51706"
-
"methods"
-
"5087"
-
"ruid"
-
"uloc-69ca17b6-2cac-1"