But the name of the header changes for each transaction/dialog?
Yes, that's intended - I do not want to store AVPs in a contact-specific way (otherwise, if I use i:11 from Bogdan's example, the script overwrites previous values on a second call from the same terminal, nonregarding that the first call might not yet be closed) but in a call-specific manner, i.e. the attribute name (string) identifies the call-id that the value stored in the AVP belongs to. Like stated in a previous answer - it's about creating a P-Charging-Vector according to RFC 3455 in the core and inserting it into all forward and reply messages.
The AVP name should be created and last exactly for the duration of a SIP transaction. The timestamp is required to guarantee the uniqueness of the value (must not be re-used for a duration of at least one month). A distinct AVP name is required for any call (identified by a distinct call id).
--Joachim
Joachim Fabini wrote:
Not sure if I understand the problem correctly. Does the
name of the
header change?
No, it does not change during the lifetime of the AVP. The name is set to the call-id and stays constant as long as the AVP exists. The problem is imho the content of pseudo-variables can not be used as the names of AVPs.
--Joachim
# AVP 101 with alias modparam("avpops","avp_aliases","myheaderavp=I:101");
avp_printf("$myheaderavp", "$hdr(call-id)-$Ts"); avp_pushto("$Myheader","$myheaderavp");
klaus
Joachim Fabini wrote:
Hi,
Is there a way or workaround to generate AVPs with header values as AVP name? It seems to me that the current AVP concept defines the AVPs at OpenSER startup, so header-value-based names are not feasible.
What I need is the following: Store/retrieve a (key,value) pair where the key is the current message's call-id and the value some combination of header values and pseudo- variables.
e.g. use the ops avp_printf("$hdr(call-id)", "$hdr(call-id)-$Ts"); avp_pushto("$Myheader","$hdr(call-id)");
in order to append the following header to the SIP message: Myheader: 23459@10.0.0.1-4235627623
Any idea how to do this in OpenSER?
thanks in advance --Joachim
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users