Module: kamailio
Branch: master
Commit: 1aa95fbc87c6ec118d7675b5c9c0e01a61de091b
URL:
https://github.com/kamailio/kamailio/commit/1aa95fbc87c6ec118d7675b5c9c0e01…
Author: Carsten Bock <carsten(a)ng-voice.com>
Committer: Carsten Bock <carsten(a)ng-voice.com>
Date: 2015-09-14T21:48:06+02:00
Add Rx-Specific-Action AVPs to work with some PCRFs
---
Modified: modules/ims_qos/rx_aar.c
Modified: modules/ims_qos/rx_avp.c
Modified: modules/ims_qos/rx_avp.h
---
Diff:
https://github.com/kamailio/kamailio/commit/1aa95fbc87c6ec118d7675b5c9c0e01…
Patch:
https://github.com/kamailio/kamailio/commit/1aa95fbc87c6ec118d7675b5c9c0e01…
---
diff --git a/modules/ims_qos/rx_aar.c b/modules/ims_qos/rx_aar.c
index 13d91ac..2840cb0 100644
--- a/modules/ims_qos/rx_aar.c
+++ b/modules/ims_qos/rx_aar.c
@@ -796,6 +796,15 @@ int rx_send_aar(struct sip_msg *req, struct sip_msg *res,
goto error;
}
+ /* Add specific action AVP's */
+ rx_add_specific_action_avp(aar, 1); // CHARGING_CORRELATION_EXCHANGE
+ rx_add_specific_action_avp(aar, 2); // INDICATION_OF_LOSS_OF_BEARER
+ rx_add_specific_action_avp(aar, 3); // INDICATION_RECOVERY_OF_BEARER
+ rx_add_specific_action_avp(aar, 4); // INDICATION_RELEASE_OF_BEARER
+ rx_add_specific_action_avp(aar, 5); // INDICATION_ESTABLISHMENT_OF_BEARER (now void)
+ rx_add_specific_action_avp(aar, 6); // IP-CAN_CHANGE
+ rx_add_specific_action_avp(aar, 12); // ACCESS_NETWORK_INFO_REPORT
+
show_callsessiondata(p_session_data);
LM_DBG("Unlocking AAA session...\n");
@@ -886,6 +895,15 @@ int rx_send_aar_register(struct sip_msg *msg, AAASession* auth,
saved_transactio
/* Add media component description avp for register*/
rx_add_media_component_description_avp_register(aar);
+ /* Add specific action AVP's */
+ rx_add_specific_action_avp(aar, 1); // CHARGING_CORRELATION_EXCHANGE
+ rx_add_specific_action_avp(aar, 2); // INDICATION_OF_LOSS_OF_BEARER
+ rx_add_specific_action_avp(aar, 3); // INDICATION_RECOVERY_OF_BEARER
+ rx_add_specific_action_avp(aar, 4); // INDICATION_RELEASE_OF_BEARER
+ rx_add_specific_action_avp(aar, 5); // INDICATION_ESTABLISHMENT_OF_BEARER (now void)
+ rx_add_specific_action_avp(aar, 6); // IP-CAN_CHANGE
+ rx_add_specific_action_avp(aar, 12); // ACCESS_NETWORK_INFO_REPORT
+
/* Add Framed IP address AVP*/
if (!rx_add_framed_ip_avp(&aar->avpList, ip, ip_version)) {
LM_ERR("Unable to add framed IP AVP\n");
diff --git a/modules/ims_qos/rx_avp.c b/modules/ims_qos/rx_avp.c
index a0a79f9..5f8cb5a 100644
--- a/modules/ims_qos/rx_avp.c
+++ b/modules/ims_qos/rx_avp.c
@@ -900,3 +900,22 @@ inline int rx_get_result_code(AAAMessage *msg, unsigned int *data) {
}
+/**
+ * Creates and adds an Acct-Application-Id AVP.
+ * @param msg - the Diameter message to add to.
+ * @param data - the value for the AVP payload
+ * @return CSCF_RETURN_TRUE on success or 0 on error
+ */
+inline int rx_add_specific_action_avp(AAAMessage *msg, unsigned int data) {
+ char x[4];
+ set_4bytes(x, data);
+
+ return
+ rx_add_avp(msg, x, 4,
+ AVP_IMS_Specific_Action,
+ AAA_AVP_FLAG_MANDATORY|AAA_AVP_FLAG_VENDOR_SPECIFIC,
+ IMS_vendor_id_3GPP,
+ AVP_DUPLICATE_DATA,
+ __FUNCTION__);
+}
+
diff --git a/modules/ims_qos/rx_avp.h b/modules/ims_qos/rx_avp.h
index 85c5cb3..894a3fd 100644
--- a/modules/ims_qos/rx_avp.h
+++ b/modules/ims_qos/rx_avp.h
@@ -93,5 +93,6 @@ AAA_AVP* rx_create_codec_data_avp(str *raw_sdp_stream, int number, int
direction
inline int rx_get_result_code(AAAMessage *msg, unsigned int *data);
unsigned int rx_get_abort_cause(AAAMessage *msg);
+inline int rx_add_specific_action_avp(AAAMessage *msg, unsigned int data);
#endif /*__PCC_AVP_H*/