Thanks for the detailed reply, outstanding!
I am however still having problems with the following entry in my ser.cfg:
is_user_in("Request-URI", "voicemail")
Any idea when this will be addressed?
/w
-----Original Message-----
From: Jan Janak [mailto:jan@iptel.org]
Sent: Thursday, March 09, 2006 2:12 AM
To: warren(a)mccoubrey.org
Cc: serusers(a)lists.iptel.org
Subject: Re: [Serusers] Ser-0.9.6 --> CVS -head = ouch
warren(a)ofelo.com wrote:
Hello All,
I encountered a few problems while migrating from Ser-0.9.6 to the
latest code in CVS. In general, I wish that the job would have been
less painful. The documentation (i.e. READMEs) requires updating in a
bad way.
This is work in progress, sorry about that.
Here are the problems I encountered when SER parsed my
ser.cfg file.
1. modparam("group", "use_domain", 0) is NO longer valid even though
the
README in the module group says so. How do I do this in the latest code
base?
use_domain parameters in modules are no more needed. This was a hack for
multi-domain support which never worked well.
In CVS head username columns have been changed to uid and domain columns
have been changed to did. uid is a unique identifier of every user which
does not change across domains (for example user with uid janakj can have
URIs in two domains with different usernames, like sip:jan@iptel.org and
sip:jan.janak@sip-router.org).
The trick here is that the database contains uids anywhere and thus the
domain column in most tables is not needed (because uids are unique even
without domains).
SER then looks up the uid of the user when doing authentication and
stores that value in an attribute. Most module functions use that
attribute then when they need the true identity of the user.
The same for domains, in true multi-domain setups each virtual domain
can have several aliases which should work in exactly the same way, for
example for virtual domain
iptel.org we have the following hostnames:
iptel.org--+--iptel.org
+-sip.iptel.org
+-proxy.iptel.org
+-195.37.77.101
And all of them can be used in From/To/Request URI. So in this case
we would use string "iptel.org" as did and that would be used everywhere
in the database (and it would also work for
sip.iptel.org,
proxy.iptel.org, and so on). Note that did could also be something
shorter, such as "1" (when you want to use numbers as dids).
So, when upgrading 0.9.6 to CVS head, you need to assign uid for every
user and did for every virtual domain. How do you do it depends on your
requirements, in the simplest case you can use SIP URI usernames as
uids and canonical hostnames as dids. In more complex scenarios (where
interaction with some other systems, like custom provisioning or billing
systems that you have already deployed) you might want to use more complex
identifiers as uid and did, such as the ones generated by uuidgen tool.
uids and dids do not change over time, so if I have uid janakj and
SIP URI sip:jan@iptel.org and if I decided to change my SIP URI (because
I receive too much SPAM/calls) to, for example, sip:jj@iptel.org then
I will still have uid janakj in the system and thus I will still see
my old call details in serweb, for example.
2. is_user_in("Request-URI",
"voicemail") is NO longer valid. What is
the new command?
That one is still available, there is a bug in the interface declaration,
I will fix it in a moment.
The new sytax is: is_user_in("$t.uid", "voicemail") where $t.uid is
the
uid of the callee (which can be retrieved using
lookup_user("Request-URI").
3. check_to() is NO longer valid even though the
README in the uri_db
module says so. What is the new command for this?
The correct way is now:
lookup_user("Request-URI");
if (!$t.uid) {
sl_reply("404", "Not Found");
break;
};
That is, first try to lookup the uid of the user and if it does not exist
it means that the user does not exist in the system.
lookup_user function maps SIP URIs to uids based on the contents of uri
table, which maps SIP-URI to uid and vice versa.
4. check_from() is NO longer valid even though the
README in the uri_db
module says so. What is the new command for this?
Similar as before, if you authenticate the user then proxy_authenticate
function will set the $f.uid attribute, so you can just do:
if (!f.uid) ...
after authentication, if you do not authenticate then you can use
lookup_user("From") function to obtain the uid of the caller.
5. is_user("replicator") is NO longer valid.
What is the new command
for this?
That one is still available.
Sorry about all this confusion, all this is work in progress and we are
working on detailed upgrade instructions and documentation which will
describe the new SER internals.
Jan.