Hello,
http://www.kamailio.org/wiki/cookbooks/5.5.x/pseudovariables#avp_id_-_avps
AVPs are special variables that are attached to SIP transactions. It is R/W variable (you can assign values to it directly in configuration file).
Call scenario: Alice calls Bob.
Here I set the AVP: route[REQINIT] { if (is_method("INVITE")){ $avp(ICID_AVP) = $hdr(P-Charging-Vector); }
Receiving 200 Ok at onreply_route[term_reply] { } I can access the AVP.
Other scenario: Alice calls Bob. Alice cancels the call. In this case I can't access the AVP. route[term_subsequent] { if (is_method("CANCEL")){ if (t_lookup_cancel()) { xlog("L_INFO", "INVITE transaction exists"); xlog("L_INFO", "ICID_AVP [$avp(ICID_AVP)]\n"); } } } 2023-03-23T09:11:56.332778+01:00 172.29.21.53 vict2-scscf[44536] - [logSDID@20306 resource="xlog"] INFO: <script>: INVITE transaction exists 2023-03-23T09:11:56.333292+01:00 172.29.21.53 vict2-scscf[44536] - [logSDID@20306 resource="xlog"] INFO: <script>: ICID_AVP [<null>]
What could be the problem? Thanks!
BR Theo
Hello,
the CANCEL is an own transaction, so you can not access AVPs from the INVITE transaction. Refer e.g., to RFC 3261, section 9.1.
Cheers,
Henning
From: Scherney Theodor Theodor.Scherney@kontron.com Sent: Donnerstag, 23. März 2023 09:37 To: Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org Subject: [sr-dev] $avp(id) - AVPs - Problem
Hello,
http://www.kamailio.org/wiki/cookbooks/5.5.x/pseudovariables#avp_id_-_avps
AVPs are special variables that are attached to SIP transactions. It is R/W variable (you can assign values to it directly in configuration file).
Call scenario: Alice calls Bob.
Here I set the AVP: route[REQINIT] { if (is_method("INVITE")){ $avp(ICID_AVP) = $hdr(P-Charging-Vector); }
Receiving 200 Ok at onreply_route[term_reply] { } I can access the AVP.
Other scenario: Alice calls Bob. Alice cancels the call. In this case I can't access the AVP. route[term_subsequent] { if (is_method("CANCEL")){ if (t_lookup_cancel()) { xlog("L_INFO", "INVITE transaction exists"); xlog("L_INFO", "ICID_AVP [$avp(ICID_AVP)]\n"); } } } 2023-03-23T09:11:56.332778+01:00 172.29.21.53 vict2-scscf[44536] - [logSDID@20306 resource="xlog"] INFO: <script>: INVITE transaction exists 2023-03-23T09:11:56.333292+01:00 172.29.21.53 vict2-scscf[44536] - [logSDID@20306 resource="xlog"] INFO: <script>: ICID_AVP [<null>]
What could be the problem? Thanks!
BR Theo