From: Mark Michelson Date: Mon, 8 Jul 2013 13:57:28 +0000 (+0000) Subject: Fix some broken logic in sending outbound caller ID. X-Git-Tag: 13.0.0-beta1~1536 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fdeb52910cd267ea8837d1246712e1a06812337;p=thirdparty%2Fasterisk.git Fix some broken logic in sending outbound caller ID. * trust_id_outbound was required even when the caller ID was not marked private. This is against intentions and documentation. * We now check both name and number privacy instead of checking name privacy twice. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393793 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_sip_caller_id.c b/res/res_sip_caller_id.c index 2f40473512..3a8c267710 100644 --- a/res/res_sip_caller_id.c +++ b/res/res_sip_caller_id.c @@ -646,9 +646,9 @@ static void caller_id_outgoing_request(struct ast_sip_session *session, pjsip_tx connected_id = ast_channel_connected_effective_id(session->channel); if (session->inv_session->state < PJSIP_INV_STATE_CONFIRMED && - session->endpoint->trust_id_outbound && - (connected_id.name.presentation & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED && - (connected_id.name.presentation & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED) { + (session->endpoint->trust_id_outbound || + ((connected_id.name.presentation & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED && + (connected_id.number.presentation & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED))) { /* Only change the From header on the initial outbound INVITE. Switching it * mid-call might confuse some UAs. */