[Serusers] ser 0.10 doucmentation

Steven C. Blair blairs at isc.upenn.edu
Thu Jun 5 02:28:10 CEST 2008


Martin:

 Thanks. That helps. I have some questions in-line below.

-Steve

________________________________________
From: Martin Hoffmann [hn at nvnc.de]
Sent: Wednesday, June 04, 2008 2:40 PM
To: Steven C. Blair
Cc: Jiri Kuthan; serusers at iptel.org
Subject: Re: [Serusers] ser 0.10 doucmentation

Steven C. Blair wrote:
>
>  I was asking for documentation because avpops commands from my
>  ser-0.9.7-pre3 config do not work on a ser-0.10.x config. Not only
>  are the tables different but they way one references parts of the sip
>  header is different too. Is there documentation on any of these
>  topics?

I am afraid, there is not much. The only thing by way of documentation
is ser-advanced.cfg and ser-oob.cfg. Jan also had a presentation
introducing the new features. Not sure if this one is available online.

We had intentions to have some admin guide before releasing SER 2.0, but
it seems that nobody has the time, so insisting would delay 2.0 even
more.

In a nutshell:

Attributes can now be addresses by prefixing them with a dollar sign and
can be used directly in the config. For instance, you can assign a value
simply by saying

   $foo = "bar";

[scb] OK, now I see.

Similarly, you can check for a value in an if:

   if ($foo == "bar") { route(DO_STUFF); }

Most function that used to expect a string literal are now happy with
the name of an attribute as well.

There are several classes of attributes though. This is an extension to
the old model where attributes where prefixed with "caller_" or
"callee_" depending on who they were for. This prefix is now "$t." or
"$f." for "to" and "from". Addtionally, you can have attributes for the
URI, user, domain, and globally. If you want to address those, the
prefix gets a second letter t, u, d, g respectively. Thus, "$tu.foo" is
the variable to for the from user.

[scb] Is URI the same as $ruri in SER0.9.x?

[scb] Please explain how "$tu.foo" is the variable to for the from user. I do not understand.


You load these attributes from the database with the functions from the
avp_db and domain modules. For the domain, this is done automagically
with load_domain() if you set the module parameter load_domain_attrs to
yes. For the user and uri attributes, you use the function load_attrs().
First parameter is the prefix where the attributes should go, ie.,
either "$tr", "$fr", "$tu", or "$fu". Second parameter is the URI or
user ID.

[scb] OK. I see now. I will try to change my SER 0.9 example.

Speaking of which, there is a difference now between users and URIs.
This makes the old aliases table deprecated. Instead, the database
table uri assignes URIs to user IDs. The module uri does the mapping
between the two.

Then there is selects. That's those things with the at sign in front.
They are read only and allow access to many things in the request. Most
important headers are available this way: @from gives you the (entire)
>From header (or rather the entire header field value), @to gives To, and
so on. Even better: @from.uri gives you the URI in the From header
field. More? Sure: @from.uri.user gives you the username part of the URI
in the From header field.

As I said, there is not much documentation for all this now. But with
these basics, if you read carefully through ser-advanced.cfg and
ser-oob.cfg, you should get the hang of it. If you have questions,
please ask.

[scb] Thank you I will take another look and email again if I have more questions.

Best regards,
Martin



More information about the sr-users mailing list