diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a07523a223..e4c95b4b1d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12099,8 +12099,9 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho if ((ast_party_id_presentation(&p->owner->connected.id) & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED) { l = p->owner->connected.id.number.valid ? p->owner->connected.id.number.str : NULL; n = p->owner->connected.id.name.valid ? p->owner->connected.id.name.str : NULL; - } else if (!ast_test_flag(&p->flags[0], SIP_SENDRPID)) { - /* if we are not sending RPID and user wants his callerid restricted */ + } else { + /* Even if we are using RPID, we shouldn't leak information in the From if the user wants + * their callerid restricted */ l = CALLERID_UNKNOWN; n = l; d = FROMDOMAIN_INVALID;