[sr-dev] git:master: modules/ims_registrar_pcscf: new parameter force_icscf_uri

Richard Good richard.good at smilecoms.com
Mon Aug 25 12:55:24 CEST 2014


Module: sip-router
Branch: master
Commit: a00ee5174b573edd243caf4de68113e9460791eb
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a00ee5174b573edd243caf4de68113e9460791eb

Author: Richard Good <richard.good at smilecoms.com>
Committer: Richard Good <richard.good at smilecoms.com>
Date:   Mon Aug 25 12:53:38 2014 +0200

modules/ims_registrar_pcscf: new parameter force_icscf_uri
	New module parameter force_icscf_uri - if set we use it as the ICSCF next hop
	If not set (default) we use DNS SRV to find ICSCF next hop

---

 modules/ims_registrar_pcscf/reg_mod.c   |    7 +++----
 modules/ims_registrar_pcscf/subscribe.c |    6 ++++++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/ims_registrar_pcscf/reg_mod.c b/modules/ims_registrar_pcscf/reg_mod.c
index 0c2ba77..06febf9 100644
--- a/modules/ims_registrar_pcscf/reg_mod.c
+++ b/modules/ims_registrar_pcscf/reg_mod.c
@@ -82,7 +82,8 @@ int ignore_contact_rxport_check = 0;                             /**!< ignore po
 
 time_t time_now;
 char * pcscf_uri = "sip:pcscf.ims.smilecoms.com:4060";
-str pcscf_uri_str;
+char * force_icscf_uri = "";
+
 unsigned int pending_reg_expires = 30;			/**!< parameter for expiry time of a pending registration before receiving confirmation from SCSCF */
 
 int is_registered_fallback2ip = 0;
@@ -157,6 +158,7 @@ static param_export_t params[] = {
         {"subscribe_to_reginfo",        INT_PARAM, &subscribe_to_reginfo                },
         {"subscription_expires",        INT_PARAM, &subscription_expires                },
         {"ignore_contact_rxport_check", INT_PARAM, &ignore_contact_rxport_check         },
+	{"force_icscf_uri",		STR_PARAM, &force_icscf_uri			},
 //	{"store_profile_dereg",	INT_PARAM, &store_data_on_dereg},
 	{0, 0, 0}
 };
@@ -196,9 +198,6 @@ int fix_parameters() {
 	str s;
 	pv_spec_t avp_spec;
 
-	pcscf_uri_str.s = pcscf_uri;
-	pcscf_uri_str.len = strlen(pcscf_uri);
-
 	if (rcv_avp_param && *rcv_avp_param) {
 		s.s = rcv_avp_param; s.len = strlen(s.s);
 		if (pv_parse_spec(&s, &avp_spec)==0
diff --git a/modules/ims_registrar_pcscf/subscribe.c b/modules/ims_registrar_pcscf/subscribe.c
index bf5bb8e..cc2065d 100644
--- a/modules/ims_registrar_pcscf/subscribe.c
+++ b/modules/ims_registrar_pcscf/subscribe.c
@@ -36,6 +36,7 @@
 
 extern pua_api_t pua;
 extern char* pcscf_uri;
+extern char * force_icscf_uri;
 
 #define P_ASSERTED_IDENTITY_HDR_PREFIX	"P-Asserted-Identity: <"
 
@@ -45,6 +46,7 @@ int reginfo_subscribe_real(struct sip_msg* msg, pv_elem_t* uri, str* service_rou
 	int uri_buf_len = 512;
 	subs_info_t subs;
 	str server_address = {pcscf_uri, strlen(pcscf_uri)};
+	str outbound_proxy = {force_icscf_uri, strlen (force_icscf_uri)};
 	str p_asserted_identity_header;
 	
 	int len = strlen(P_ASSERTED_IDENTITY_HDR_PREFIX) + server_address.len + 1 + CRLF_LEN;
@@ -89,6 +91,10 @@ int reginfo_subscribe_real(struct sip_msg* msg, pv_elem_t* uri, str* service_rou
 	subs.contact= &server_address;
 	subs.extra_headers = &p_asserted_identity_header;
 	
+	if(outbound_proxy.s && outbound_proxy.len) {
+	    subs.outbound_proxy= &outbound_proxy;
+	}
+	
 	subs.flag|= UPDATE_TYPE;
 	
 	if(pua.send_subscribe(&subs)< 0) {




More information about the sr-dev mailing list