From 2b9849625cc6a64bafc6f3f4f4e30d6a4af2e0ca Mon Sep 17 00:00:00 2001 From: George Joseph Date: Wed, 24 Feb 2016 16:25:09 -0700 Subject: res_pjsip_caller_id: Anonymize 'From' when caller id presentation is prohibited Per RFC3325, the 'From' header is now anonymized on outgoing calls when caller id presentation is prohibited. TID = trust_id_outbound PRO = Set(CALLERID(pres)=prohib) USR = endpoint/from_user DOM = endpoint/from_domain PAI = YES(privacy=off), NO(not sent), PRI(privacy=full) (assumes send_pai=yes) Conditions |Result --------------------|---------------------------------------------------- TID PRO USR DOM |PAI FROM --------------------|---------------------------------------------------- Y Y abc def.ghi |PRI "Anonymous" Y Y abc |PRI "Anonymous" Y Y def.ghi |PRI "Anonymous" Y Y |PRI "Anonymous" Y N abc def.ghi |YES Y N abc |YES > Y N def.ghi |YES "Caller Name" @def.ghi> Y N |YES "Caller Name" @> N Y abc def.ghi |NO "Anonymous" N Y abc |NO "Anonymous" N Y def.ghi |NO "Anonymous" N Y |NO "Anonymous" N N abc def.ghi |YES N N abc |YES > N N def.ghi |YES "Caller Name" @def.ghi> N N |YES "Caller Name" @> ASTERISK-25791 #close Reported-by: Anthony Messina Change-Id: I2c82a5ca1413c2c00fb62ea95b0ae8e97af54dc9 --- include/asterisk/res_pjsip.h | 10 ++++++++++ include/asterisk/res_pjsip_session.h | 2 ++ 2 files changed, 12 insertions(+) (limited to 'include') diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index 3008475c3..66370186a 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -2247,4 +2247,14 @@ int ast_sip_set_tpselector_from_transport(const struct ast_sip_transport *transp */ int ast_sip_set_tpselector_from_transport_name(const char *transport_name, pjsip_tpselector *selector); +/*! + * \brief Set name and number information on an identity header. + * + * \param pool Memory pool to use for string duplication + * \param id_hdr A From, P-Asserted-Identity, or Remote-Party-ID header to modify + * \param id The identity information to apply to the header + */ +void ast_sip_modify_id_header(pj_pool_t *pool, pjsip_fromto_hdr *id_hdr, + const struct ast_party_id *id); + #endif /* _RES_PJSIP_H */ diff --git a/include/asterisk/res_pjsip_session.h b/include/asterisk/res_pjsip_session.h index 613984713..55401e7c7 100644 --- a/include/asterisk/res_pjsip_session.h +++ b/include/asterisk/res_pjsip_session.h @@ -151,6 +151,8 @@ struct ast_sip_session { enum ast_sip_session_t38state t38state; /*! The AOR associated with this session */ struct ast_sip_aor *aor; + /*! From header saved at invite creation */ + pjsip_fromto_hdr *saved_from_hdr; }; typedef int (*ast_sip_session_request_creation_cb)(struct ast_sip_session *session, pjsip_tx_data *tdata); -- cgit v1.2.3