2828#include "../../usr_avp.h"
2929#include "../../data_lump.h"
3030#include "../../data_lump_rpl.h"
31+ #include "../../redact_pii.h"
3132
3233#include "../../modules/usrloc/ul_evi.h"
3334#include "../../modules/event_routing/api.h"
@@ -280,7 +281,7 @@ enum pn_action pn_inspect_ct_params(struct sip_msg *req, const str *ct_uri)
280281 int i , is_cap_query = 1 , is_handled_upstream = 0 ;
281282
282283 if (parse_uri (ct_uri -> s , ct_uri -> len , & puri ) != 0 ) {
283- LM_ERR ("failed to parse Contact URI '%.*s'\n" , ct_uri -> len , ct_uri -> s );
284+ LM_ERR ("failed to parse Contact URI '%.*s'\n" , ct_uri -> len , redact_pii ( ct_uri -> s ) );
284285 return -1 ;
285286 }
286287
@@ -551,7 +552,7 @@ static struct usr_avp *pn_trim_pn_params(evi_params_t *params)
551552 pn_has_uri_params (& p -> val .s , & puri )) {
552553 if (pn_remove_uri_params (& puri , p -> val .s .len , & _sval ) != 0 ) {
553554 LM_ERR ("failed to remove PN params from Contact '%.*s'\n" ,
554- p -> val .s .len , p -> val .s .s );
555+ p -> val .s .len , redact_pii ( p -> val .s .s ) );
555556 sval = & p -> val .s ;
556557 } else {
557558 sval = & _sval ;
@@ -641,13 +642,13 @@ int pn_awake_pn_contacts(struct sip_msg *req, ucontact_t **cts, int sz,
641642 for (end = cts + sz ; cts < end ; cts ++ ) {
642643 if (parse_uri ((* cts )-> c .s , (* cts )-> c .len , & puri ) != 0 ) {
643644 LM_ERR ("failed to parse Contact '%.*s'\n" ,
644- (* cts )-> c .len , ( * cts )-> c .s );
645+ (* cts )-> c .len , redact_pii (( * cts )-> c .s ) );
645646 continue ;
646647 }
647648
648649 if (pn_trigger_pn (req , * cts , & puri ) != 0 ) {
649650 LM_ERR ("failed to trigger PN for Contact: '%.*s'\n" ,
650- (* cts )-> c .len , ( * cts )-> c .s );
651+ (* cts )-> c .len , redact_pii (( * cts )-> c .s ) );
651652 continue ;
652653 }
653654
@@ -670,7 +671,7 @@ int pn_trigger_pn(struct sip_msg *req, const ucontact_t *ct,
670671 if (get_uri_param_val (ct_uri , & f -> uri_param_key , & f -> val ) != 0 ) {
671672 LM_ERR ("failed to locate '%.*s' URI param in Contact '%.*s'\n" ,
672673 f -> uri_param_key .len , f -> uri_param_key .s ,
673- ct -> c .len , ct -> c .s );
674+ ct -> c .len , redact_pii ( ct -> c .s ) );
674675 return -1 ;
675676 }
676677 }
@@ -679,7 +680,7 @@ int pn_trigger_pn(struct sip_msg *req, const ucontact_t *ct,
679680 pn_trim_pn_params , pn_notify_branch , pn_refresh_timeout ,
680681 EBR_SUBS_EXPIRE_NOTIFY ) != 0 ) {
681682 LM_ERR ("failed to EBR-subscribe to " UL_EV_CT_UPDATE ", Contact: %.*s\n" ,
682- ct -> c .len , ct -> c .s );
683+ ct -> c .len , redact_pii ( ct -> c .s ) );
683684 return -1 ;
684685 }
685686
@@ -704,7 +705,7 @@ int pn_has_uri_params(const str *ct, struct sip_uri *puri)
704705 puri = & _puri ;
705706
706707 if (parse_uri (ct -> s , ct -> len , puri ) != 0 ) {
707- LM_ERR ("failed to parse contact: '%.*s'\n" , ct -> len , ct -> s );
708+ LM_ERR ("failed to parse contact: '%.*s'\n" , ct -> len , redact_pii ( ct -> s ) );
708709 return 0 ;
709710 }
710711
@@ -802,7 +803,7 @@ int pn_async_process_purr(struct sip_msg *req, async_ctx *ctx, udomain_t *d)
802803 /* locate "pn-purr" in the R-URI */
803804 if (parse_sip_msg_uri (req ) < 0 ) {
804805 LM_ERR ("failed to parse R-URI: '%.*s'\n" ,
805- GET_RURI (req )-> len , GET_RURI (req )-> s );
806+ GET_RURI (req )-> len , redact_pii ( GET_RURI (req )-> s ) );
806807 return -1 ;
807808 }
808809
@@ -825,7 +826,7 @@ int pn_async_process_purr(struct sip_msg *req, async_ctx *ctx, udomain_t *d)
825826
826827 rt_uri = & ((rr_t * )req -> route -> parsed )-> nameaddr .uri ;
827828 if (parse_uri (rt_uri -> s , rt_uri -> len , & puri ) != 0 ) {
828- LM_ERR ("failed to parse Route URI: '%.*s'\n" , rt_uri -> len , rt_uri -> s );
829+ LM_ERR ("failed to parse Route URI: '%.*s'\n" , rt_uri -> len , redact_pii ( rt_uri -> s ) );
829830 return -1 ;
830831 }
831832
@@ -854,7 +855,7 @@ int pn_async_process_purr(struct sip_msg *req, async_ctx *ctx, udomain_t *d)
854855 purr -> len , purr -> s );
855856
856857 if (parse_uri (c -> c .s , c -> c .len , & puri ) != 0 ) {
857- LM_ERR ("failed to parse Contact: '%.*s'\n" , c -> c .len , c -> c .s );
858+ LM_ERR ("failed to parse Contact: '%.*s'\n" , c -> c .len , redact_pii ( c -> c .s ) );
858859 goto err_unlock ;
859860 }
860861
@@ -863,7 +864,7 @@ int pn_async_process_purr(struct sip_msg *req, async_ctx *ctx, udomain_t *d)
863864 if (get_uri_param_val (& puri , & f -> uri_param_key , & f -> val ) != 0 ) {
864865 LM_ERR ("failed to locate '%.*s' URI param in Contact '%.*s'\n" ,
865866 f -> uri_param_key .len , f -> uri_param_key .s ,
866- c -> c .len , c -> c .s );
867+ c -> c .len , redact_pii ( c -> c .s ) );
867868 goto err_unlock ;
868869 }
869870 }
@@ -872,7 +873,7 @@ int pn_async_process_purr(struct sip_msg *req, async_ctx *ctx, udomain_t *d)
872873 if (ebr .async_wait_for_event (req , ctx , ev_ct_update , pn_ebr_filters ,
873874 pn_trim_pn_params , pn_refresh_timeout ) != 0 ) {
874875 LM_ERR ("failed to EBR-subscribe to " UL_EV_CT_UPDATE ", ct: '%.*s'\n" ,
875- c -> c .len , c -> c .s );
876+ c -> c .len , redact_pii ( c -> c .s ) );
876877 goto err_unlock ;
877878 }
878879
@@ -903,7 +904,7 @@ int pn_add_reply_purr(const ucontact_t *ct)
903904 return 0 ;
904905
905906 if (parse_uri (ct -> c .s , ct -> c .len , & puri ) != 0 ) {
906- LM_ERR ("failed to parse Contact URI: '%.*s'\n" , ct -> c .len , ct -> c .s );
907+ LM_ERR ("failed to parse Contact URI: '%.*s'\n" , ct -> c .len , redact_pii ( ct -> c .s ) );
907908 return -1 ;
908909 }
909910
0 commit comments