Hello,
some time ago I created a new branch in GIT named 'daniel/xavp' that includes code for a new pseudo-variable class 'xavp' - name being a shortcut to 'extended attribute value pair'. I collected some design details in wiki:
http://sip-router.org/wiki/devel/xavp
It is not a replacement for current AVP api implementation, although in the future can replace it. In the past we had couple of discussions about the limitations of avps which I tried to overcome. Here are some highlights of xavp design:
- string names only - various tests showed that having the complex addressing scheme with integer id and string name does not pay off performance gains. XAVP computes and integer id for each name that is used to speed up comparison
- possibility to store more data types - AVP allow string and integer data types. More can be handled by XAVP, including a generic data type where you can build your own structure and store it in the list. This is good for example to store custom structures for transaction lifetine -- right now dialog module needs to store reference to dialog structure. Optimizations can be done for any case of serial forking -- uri, dst uri, q, etc can be stored in a structure without a need to parse and build it from an encoded value stored in one or many avps
- possibility to group XAVPs inside another XAVP - practically is building lists of XAVPs. This should overcome issues with naming conflicts between modules - e.g., dispatacher module can group its avps in a list named "dispatacher", lcr module in a list named 'lcrl, then there can be XAVP with name 'uri' in both lists, without the risk of misusage. Another benefit would be reducing the number of parameters, right now each module exports a parameter to set the name for each AVP, with xavp there is need for one parameter to set the name of the list, then inside that list the module is free to use predefined names without the risk of overlapping.
- xavp having value integer or string can be used directly in config, whether they are in a sublist or not
Check the wiki (link above) for more. Looking forward for comments, suggestions and improvements.
Cheers, Daniel