Hi all,
Unfortunately the previous thread on this topic ended
without a definitive statement or conclusion, probably
because of the New Year holiday (btw, Happy New Year to
all of you!). So here's another try:
OpenSER is currently session stateful but not call
stateful. This is valid also/especially for the AVP
module: You can store AVPs on a per-contact base but
(imho) _not_ specific to a call or dialog. The reason
for this is that the AVP module does not allow/
implement the use of call-dependent variables as AVP
names.
Adding this feature to OpenSER doesn't require a change
in interfaces (implementation effort is another topic ;).
It's just about enabling the use of AVP or header values
(like, e.g. call-id) as the _name_ of another AVP for
DBS storage.
I attach a specific example below.
Can some of the developers and/or maintainers please
comment and/or give some hints on the feasibility of
this approach?
Is it possible to add this feature to OpenSER? What
effort is required to add this enhancement to the AVP
module? Please come back if some details are unclear,
I might have missed something important.
Many thanks in advance for your reply and help,
Best regards
--Joachim
PS: Example: The task is to process any SIP message that
passes through our proxy. We must compute a unique ID
specific to the call on the first message belonging to
this call and store it in DBS. Whenever another message
that is part of this call/dialog arrives, we retrieve the
unique ID from the DBS and, e.g., append it as a specific
header field value.
The only way how this can be done is to use some call-
specific AVP name (e.g. call-id), as we do not have any
influence on the structure of the AVP value (so regexp-
search based on AVP value does not help).
# This is the AVP name that is required to retrieve
# our specific, call-dependent AVP value from the
# database whenever a message that belongs to this
# call passes our OpenSER proxy.
avp_printf("s:myTmpHeaderName", "$from/username$hdr(call-id)");
# This is the value we'd like to store. Could be also
# only "$Ts", i.e., we can _not_ rely on regular
# expression search for later retrieving the AVP
# from the DBS based on its value.
avp_printf("s:myTmpHeaderValue", "$hdr(call-id)-$Ts");
# This storing of the call-dependent info in DBS does
# currently not work. OpenSER complains at start-up
# about the variable AVP name/key on both of the
# following lines. The former variant seems much more
# flexible to me than the latter one.
avp_db_store("s:myTmpHeaderName","s:myTmpHeaderValue");
avp_db_store("$hdr(call-id)","s:myTmpHeaderValue");
# This load obviously does also not work.
avp_db_load("$hdr(call-id)","s:myTmpHeaderValue");