[SR-Dev] avp naming

Daniel-Constantin Mierla miconda at gmail.com
Thu Mar 12 16:59:48 CET 2009


Hello,

working to integrate the PV module I reached the AVPs and after a short 
analyze I wonder (and ask you) whether you should drop the naming scheme 
we have in Kamailio (integer id and string name) and stick to string 
names all the time. ser seems to use mostly that although looks like 
support for ID is still there, but I cannot see how they can be used 
with the naming scheme in config (e.g., is it possible to have $f.i:34 
in config to refer to avp with id 34?).

The benefits I see:
- complexity in dealing with integer id or string name
- avp name aliases removed

Note that even for string-named AVPs there is an integer id computed and 
used in comparisons to speed up.

Jan in an email some time ago mentioned that no performance penalty 
could be observed. I pasted most of the content of Jan's email about ser 
avps at:
http://sip-router.org/wiki/devel/avps-ser

Looking at the code where there are lot of IF name is string or integer, 
I wonder if really worth the complexity. Today we have lot of other 
variables for quick and shared-memory operations ($var(...), $shv(...), 
$sht(...), $dbr(...) and latest $mct(...)), avps not being anymore used 
for everywhere.

Drawback is the naming scheme backward compatibility. We can treat 
"i:20" simply as string or throw error at startup (I prefer the second 
because is cleaner in long time).

Opinions?

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://www.asipto.com




More information about the sr-dev mailing list