Module: kamailio
Branch: master
Commit: adbb2bc992d1582aece9d075da6329e0643fb5e3
URL:
https://github.com/kamailio/kamailio/commit/adbb2bc992d1582aece9d075da6329e…
Author: Supreeth Herle <herlesupreeth(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-11-30T10:18:47+01:00
ims_qos: option to set DLG_MOBILE_ORIGINATING for
rx_add_media_component_description_avp()
- alternative to DLG_MOBILE_REGISTER that can be set with mod param
dialog_direction
---
Modified: src/modules/ims_qos/ims_qos_mod.c
Modified: src/modules/ims_qos/ims_qos_mod.h
Modified: src/modules/ims_qos/rx_aar.c
---
Diff:
https://github.com/kamailio/kamailio/commit/adbb2bc992d1582aece9d075da6329e…
Patch:
https://github.com/kamailio/kamailio/commit/adbb2bc992d1582aece9d075da6329e…
---
diff --git a/src/modules/ims_qos/ims_qos_mod.c b/src/modules/ims_qos/ims_qos_mod.c
index eaa323dcd5b..428a898df40 100644
--- a/src/modules/ims_qos/ims_qos_mod.c
+++ b/src/modules/ims_qos/ims_qos_mod.c
@@ -166,7 +166,8 @@ int omit_flow_ports = 0;
int rs_default_bandwidth = 0;
int rr_default_bandwidth = 0;
-ims_qos_params_t _imsqos_params = {.recv_mode = 0};
+ims_qos_params_t _imsqos_params = {
+ .recv_mode = 0, .dlg_direction = DLG_MOBILE_REGISTER};
/* commands wrappers and fixups */
static int w_rx_aar(struct sip_msg *msg, char *route, char *dir, char *id,
@@ -255,7 +256,9 @@ static param_export_t params[] = {{"rx_dest_realm",
PARAM_STR, &rx_dest_realm},
®ex_sdp_ip_prefix_to_maintain_in_fd},
{"include_rtcp_fd", INT_PARAM, &include_rtcp_fd},
{"suspend_transaction", INT_PARAM, &_ims_qos_suspend_transaction},
- {"recv_mode", PARAM_INT, &_imsqos_params.recv_mode}, {0, 0, 0}};
+ {"recv_mode", PARAM_INT, &_imsqos_params.recv_mode},
+ {"dialog_direction", PARAM_INT, &_imsqos_params.dlg_direction},
+ {0, 0, 0}};
/** module exports */
@@ -277,6 +280,10 @@ static int mod_init(void)
callback_singleton = shm_malloc(sizeof(int));
*callback_singleton = 0;
+ if(_imsqos_params.dlg_direction != DLG_MOBILE_ORIGINATING) {
+ _imsqos_params.dlg_direction = DLG_MOBILE_REGISTER;
+ }
+
/*register space for event processor*/
register_procs(1);
diff --git a/src/modules/ims_qos/ims_qos_mod.h b/src/modules/ims_qos/ims_qos_mod.h
index fe061ec9a92..28d59d1d191 100644
--- a/src/modules/ims_qos/ims_qos_mod.h
+++ b/src/modules/ims_qos/ims_qos_mod.h
@@ -52,6 +52,7 @@
typedef struct ims_qos_params
{
int recv_mode;
+ int dlg_direction;
} ims_qos_params_t;
/** callback functions */
diff --git a/src/modules/ims_qos/rx_aar.c b/src/modules/ims_qos/rx_aar.c
index 19e66b8fe89..91ed4345a42 100644
--- a/src/modules/ims_qos/rx_aar.c
+++ b/src/modules/ims_qos/rx_aar.c
@@ -82,6 +82,7 @@ extern str af_signaling_ip;
extern str af_signaling_ip6;
extern str component_media_type;
extern str flow_protocol;
+extern ims_qos_params_t _imsqos_params;
str IMS_Serv_AVP_val = {"IMS Services", 12};
str IMS_Em_Serv_AVP_val = {"Emergency IMS Call", 18};
@@ -613,7 +614,6 @@ int add_media_components(AAAMessage *aar, struct sip_msg *req,
ipA = req_sdp_session->ip_addr;
portA = req_sdp_stream->port;
-
ipB = rpl_sdp_session->ip_addr;
portB = rpl_sdp_stream->port;
}
@@ -1130,7 +1130,7 @@ int rx_send_aar_register(struct sip_msg *msg, AAASession *auth,
&via_host, &port_from,
ip_version == AF_INET ? &af_signaling_ip : &af_signaling_ip6,
&port_to, &flow_protocol, &raw_stream, &raw_stream,
- DLG_MOBILE_REGISTER, AVP_EPC_Flow_Usage_AF_Signaling);
+ _imsqos_params.dlg_direction, AVP_EPC_Flow_Usage_AF_Signaling);
/* Add specific action AVP's */
rx_add_specific_action_avp(aar, 1); // CHARGING_CORRELATION_EXCHANGE