Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 12343) +++ channels/chan_sip.c (working copy) @@ -661,6 +661,7 @@ unsigned int flags; /*!< SIP_ flags */ int timer_t1; /*!< SIP timer T1, ms rtt */ unsigned int sipoptions; /*!< Supported SIP sipoptions on the other end */ + int silence_supp; /*!< Show/Hide silenceSupp from header */ int capability; /*!< Special capability (codec) */ int jointcapability; /*!< Supported capability at both ends (codecs ) */ int peercapability; /*!< Supported peer capability */ @@ -788,6 +789,7 @@ char cid_num[80]; /*!< Caller ID num */ char cid_name[80]; /*!< Caller ID name */ int callingpres; /*!< Calling id presentation */ + int silence_supp; /*!< Show/Hide silenceSupp from header */ int inUse; /*!< Number of calls in use */ int call_limit; /*!< Limit of concurrent calls */ char vmexten[AST_MAX_EXTENSION]; /*!< Dialplan extension for MWI notify message*/ @@ -1907,6 +1909,7 @@ } ast_copy_flags(r, peer, SIP_FLAGS_TO_COPY); + r->silence_supp = peer->silence_supp; r->capability = peer->capability; r->prefs = peer->prefs; if (r->rtp) { @@ -4609,9 +4612,10 @@ &a_audio_next, &a_audio_left, debug); } - - ast_build_string(&a_audio_next, &a_audio_left, "a=silenceSupp:off - - - -\r\n"); - + /* Show hide silenceSupp from header */ + if (p->silence_supp) { + ast_build_string(&a_audio_next, &a_audio_left, "a=silenceSupp:off - - - -\r\n"); + } if ((m_audio_left < 2) || (m_video_left < 2) || (a_audio_left == 0) || (a_video_left == 0)) ast_log(LOG_WARNING, "SIP SDP may be truncated due to undersized buffer!!\n"); @@ -12068,6 +12072,7 @@ peer->pickupgroup = 0; peer->maxms = default_qualify; peer->prefs = default_prefs; + peer->silence_supp = TRUE; } /*! \brief Create temporary peer (used in autocreatepeer mode) */ @@ -12300,6 +12305,14 @@ ast_log(LOG_WARNING, "Qualification of peer '%s' should be 'yes', 'no', or a number of milliseconds at line %d of sip.conf\n", peer->name, v->lineno); peer->maxms = 0; } + } else if (!strcasecmp(v->name, "silencesupp")) { + if (!strcasecmp(v->value, "hide")) { + peer->silence_supp = FALSE; + } else if (!strcasecmp(v->value, "show")) { + peer->silence_supp = TRUE; + } else { + ast_log(LOG_WARNING, "silencesupp bad param on %s just use: 'show' or 'hide'\n", peer->name); + } } } if (!ast_test_flag((&global_flags_page2), SIP_PAGE2_IGNOREREGEXPIRE) && ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC) && realtime) {