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 ;
@@ -631,13 +632,13 @@ int pn_awake_pn_contacts(struct sip_msg *req, ucontact_t **cts, int sz)
631632 for (end = cts + sz ; cts < end ; cts ++ ) {
632633 if (parse_uri ((* cts )-> c .s , (* cts )-> c .len , & puri ) != 0 ) {
633634 LM_ERR ("failed to parse Contact '%.*s'\n" ,
634- (* cts )-> c .len , ( * cts )-> c .s );
635+ (* cts )-> c .len , redact_pii (( * cts )-> c .s ) );
635636 continue ;
636637 }
637638
638639 if (pn_trigger_pn (req , * cts , & puri ) != 0 ) {
639640 LM_ERR ("failed to trigger PN for Contact: '%.*s'\n" ,
640- (* cts )-> c .len , ( * cts )-> c .s );
641+ (* cts )-> c .len , redact_pii (( * cts )-> c .s ) );
641642 continue ;
642643 }
643644
@@ -660,15 +661,15 @@ int pn_trigger_pn(struct sip_msg *req, const ucontact_t *ct,
660661 if (get_uri_param_val (ct_uri , & f -> uri_param_key , & f -> val ) != 0 ) {
661662 LM_ERR ("failed to locate '%.*s' URI param in Contact '%.*s'\n" ,
662663 f -> uri_param_key .len , f -> uri_param_key .s ,
663- ct -> c .len , ct -> c .s );
664+ ct -> c .len , redact_pii ( ct -> c .s ) );
664665 return -1 ;
665666 }
666667 }
667668
668669 if (ebr .notify_on_event (req , ev_ct_update , pn_ebr_filters ,
669670 pn_trim_pn_params , pn_inject_branch , pn_refresh_timeout ) != 0 ) {
670671 LM_ERR ("failed to EBR-subscribe to " UL_EV_CT_UPDATE ", Contact: %.*s\n" ,
671- ct -> c .len , ct -> c .s );
672+ ct -> c .len , redact_pii ( ct -> c .s ) );
672673 return -1 ;
673674 }
674675
@@ -693,7 +694,7 @@ int pn_has_uri_params(const str *ct, struct sip_uri *puri)
693694 puri = & _puri ;
694695
695696 if (parse_uri (ct -> s , ct -> len , puri ) != 0 ) {
696- LM_ERR ("failed to parse contact: '%.*s'\n" , ct -> len , ct -> s );
697+ LM_ERR ("failed to parse contact: '%.*s'\n" , ct -> len , redact_pii ( ct -> s ) );
697698 return 0 ;
698699 }
699700
@@ -791,7 +792,7 @@ int pn_async_process_purr(struct sip_msg *req, async_ctx *ctx, udomain_t *d)
791792 /* locate "pn-purr" in the R-URI */
792793 if (parse_sip_msg_uri (req ) < 0 ) {
793794 LM_ERR ("failed to parse R-URI: '%.*s'\n" ,
794- GET_RURI (req )-> len , GET_RURI (req )-> s );
795+ GET_RURI (req )-> len , redact_pii ( GET_RURI (req )-> s ) );
795796 return -1 ;
796797 }
797798
@@ -814,7 +815,7 @@ int pn_async_process_purr(struct sip_msg *req, async_ctx *ctx, udomain_t *d)
814815
815816 rt_uri = & ((rr_t * )req -> route -> parsed )-> nameaddr .uri ;
816817 if (parse_uri (rt_uri -> s , rt_uri -> len , & puri ) != 0 ) {
817- LM_ERR ("failed to parse Route URI: '%.*s'\n" , rt_uri -> len , rt_uri -> s );
818+ LM_ERR ("failed to parse Route URI: '%.*s'\n" , rt_uri -> len , redact_pii ( rt_uri -> s ) );
818819 return -1 ;
819820 }
820821
@@ -843,7 +844,7 @@ int pn_async_process_purr(struct sip_msg *req, async_ctx *ctx, udomain_t *d)
843844 purr -> len , purr -> s );
844845
845846 if (parse_uri (c -> c .s , c -> c .len , & puri ) != 0 ) {
846- LM_ERR ("failed to parse Contact: '%.*s'\n" , c -> c .len , c -> c .s );
847+ LM_ERR ("failed to parse Contact: '%.*s'\n" , c -> c .len , redact_pii ( c -> c .s ) );
847848 goto err_unlock ;
848849 }
849850
@@ -852,7 +853,7 @@ int pn_async_process_purr(struct sip_msg *req, async_ctx *ctx, udomain_t *d)
852853 if (get_uri_param_val (& puri , & f -> uri_param_key , & f -> val ) != 0 ) {
853854 LM_ERR ("failed to locate '%.*s' URI param in Contact '%.*s'\n" ,
854855 f -> uri_param_key .len , f -> uri_param_key .s ,
855- c -> c .len , c -> c .s );
856+ c -> c .len , redact_pii ( c -> c .s ) );
856857 goto err_unlock ;
857858 }
858859 }
@@ -861,7 +862,7 @@ int pn_async_process_purr(struct sip_msg *req, async_ctx *ctx, udomain_t *d)
861862 if (ebr .async_wait_for_event (req , ctx , ev_ct_update , pn_ebr_filters ,
862863 pn_trim_pn_params , pn_refresh_timeout ) != 0 ) {
863864 LM_ERR ("failed to EBR-subscribe to " UL_EV_CT_UPDATE ", ct: '%.*s'\n" ,
864- c -> c .len , c -> c .s );
865+ c -> c .len , redact_pii ( c -> c .s ) );
865866 goto err_unlock ;
866867 }
867868
@@ -892,7 +893,7 @@ int pn_add_reply_purr(const ucontact_t *ct)
892893 return 0 ;
893894
894895 if (parse_uri (ct -> c .s , ct -> c .len , & puri ) != 0 ) {
895- LM_ERR ("failed to parse Contact URI: '%.*s'\n" , ct -> c .len , ct -> c .s );
896+ LM_ERR ("failed to parse Contact URI: '%.*s'\n" , ct -> c .len , redact_pii ( ct -> c .s ) );
896897 return -1 ;
897898 }
898899
0 commit comments