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";
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.
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.
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.
Best regards, Martin