From 86de47ff3140d2d04e72c9977a3b3fc21cff54d0 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 8 Sep 2010 10:41:50 -0500 Subject: [PATCH] dont put an rpid in 183 or 200 if pass-callee-id is false --- src/mod/endpoints/mod_sofia/mod_sofia.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 5954a8436a..19a44f43e1 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -697,7 +697,11 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) { char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_RESPONSE_HEADER_PREFIX); - char *cid = generate_pai_str(session); + char *cid = NULL; + + if (sofia_test_pflag(tech_pvt->profile, PFLAG_PASS_CALLEE_ID)) { + cid = generate_pai_str(session); + } if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) && tech_pvt->early_sdp && strcmp(tech_pvt->early_sdp, tech_pvt->local_sdp_str)) { /* The SIP RFC for SOA forbids sending a 183 with one sdp then a 200 with another but it won't do us much good unless @@ -2165,7 +2169,11 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) { char *extra_header = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX); - char *cid = generate_pai_str(session); + char *cid = NULL; + + if (sofia_test_pflag(tech_pvt->profile, PFLAG_PASS_CALLEE_ID)) { + cid = generate_pai_str(session); + } if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) && tech_pvt->early_sdp && strcmp(tech_pvt->early_sdp, tech_pvt->local_sdp_str)) {