Hello,
On 3/13/13 10:00 AM, Victor V. Kustov wrote:
Hello, Daniel. Thanks for reply.
do you want to check if caller (origin) is
registered or if callee
(destination) is registered? Like one can call to pstn only if has a
phone registered for itself?
In our scheme all calls forwards to PSTN GW, if that
call from our to
our users, GW turn call back and kamailio receive it as incoming.
So, no "local calls" in this scheme.
For outgoing calls (to PSTN) i want check caller (origin) is registered.
For incoming calls (from PSTN) i want callee is registered.
Need cache registrations (DB, memcached or something). I try that way:
1. REGISTER - if ok, than we save("location").
2. Other methods - check !registered("location") or
!lookup("location").
But in INVITE seems both !registered("location")
and !lookup("location") return TRUE. I dont understand why.
In topicstart letter i citate part of my cfg: in INVITE i check
registration again and it work - registered users may call to PSTN,
unregged may not. But no cache for registration and look as overhead.
Must be more "beauty" solution.
when you need to check if caller is
registered use:
- registered("location", "$fu")
See more details at:
-
http://kamailio.org/docs/modules/stable/modules/registrar.html#id2512620
If used without the second parameter is checking if R-URI ($ru) is
registered.
Cheers,
Daniel
--
Daniel-Constantin Mierla -
http://www.asipto.com
http://twitter.com/#!/miconda -
http://www.linkedin.com/in/miconda
Kamailio World Conference, April 16-17, 2013, Berlin
-
http://conference.kamailio.com -