Bläddra i källkod

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
Supreeth Herle 1 år sedan
förälder
incheckning
adbb2bc992

+ 9 - 2
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},
 				&regex_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);
 

+ 1 - 0
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 */

+ 2 - 2
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