Index: chan_sip.c =================================================================== --- chan_sip.c (revision 12369) +++ chan_sip.c (working copy) @@ -598,6 +598,7 @@ #define SIP_PAGE2_DEBUG_CONSOLE (1 << 6) #define SIP_PAGE2_DYNAMIC (1 << 7) /*!< Dynamic Peers register with Asterisk */ #define SIP_PAGE2_SELFDESTRUCT (1 << 8) /*!< Automatic peers need to destruct themselves */ +#define SIP_PAGE2_HIDE_SILENCESUPP (1 << 9) /*!< Show/Hide silenceSupp=off from SDP Header */ /* SIP packet flags */ #define SIP_PKT_DEBUG (1 << 0) /*!< Debug this packet */ @@ -661,6 +662,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 hide_silencesupp; /*!< Show/Hide SilenceSupp */ int capability; /*!< Special capability (codec) */ int jointcapability; /*!< Supported capability at both ends (codecs ) */ int peercapability; /*!< Supported peer capability */ @@ -1966,7 +1968,11 @@ r->rtpkeepalive = peer->rtpkeepalive; if (peer->call_limit) ast_set_flag(r, SIP_CALL_LIMIT); - + if (ast_test_flag(&peer->flags_page2, SIP_PAGE2_HIDE_SILENCESUPP)) { + r->hide_silencesupp = TRUE; + } else { + r->hide_silencesupp = FALSE; + } return 0; } @@ -4609,9 +4615,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->hide_silencesupp) { + 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"); @@ -7594,8 +7601,8 @@ regex_t regexbuf; int havepattern = FALSE; -#define FORMAT2 "%-25.25s %-15.15s %-3.3s %-3.3s %-3.3s %-8s %-10s\n" -#define FORMAT "%-25.25s %-15.15s %-3.3s %-3.3s %-3.3s %-8d %-10s\n" +#define FORMAT2 "%-25.25s %-15.15s %-3.3s %-3.3s %-3.3s %-3.3s %-8s %-10s\n" +#define FORMAT "%-25.25s %-15.15s %-3.3s %-3.3s %-3.3s %-3.3s %-8d %-10s\n" char name[256]; char iabuf[INET_ADDRSTRLEN]; @@ -7626,7 +7633,7 @@ } if (!s) { /* Normal list */ - ast_cli(fd, FORMAT2, "Name/username", "Host", "Dyn", "Nat", "ACL", "Port", "Status"); + ast_cli(fd, FORMAT2, "Name/username", "Host", "Dyn", "Nat", "ACL", "HsS", "Port", "Status"); } ASTOBJ_CONTAINER_TRAVERSE(&peerl, 1, do { @@ -7667,6 +7674,7 @@ ast_test_flag((&iterator->flags_page2), SIP_PAGE2_DYNAMIC) ? " D " : " ", /* Dynamic or not? */ (ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? " N " : " ", /* NAT=yes? */ iterator->ha ? " A " : " ", /* permit/deny */ + ast_test_flag((&iterator->flags_page2),SIP_PAGE2_HIDE_SILENCESUPP) ? "yes" : "no", /* Hide SilenceSupp from header */ ntohs(iterator->addr.sin_port), status); if (!s) {/* Normal CLI list */ @@ -7675,7 +7683,7 @@ ast_test_flag((&iterator->flags_page2), SIP_PAGE2_DYNAMIC) ? " D " : " ", /* Dynamic or not? */ (ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? " N " : " ", /* NAT=yes? */ iterator->ha ? " A " : " ", /* permit/deny */ - + ast_test_flag((&iterator->flags_page2),SIP_PAGE2_HIDE_SILENCESUPP) ? "yes" : "no", /* Hide SilenceSupp from header */ ntohs(iterator->addr.sin_port), status); } else { /* Manager format */ /* The names here need to be the same as other channels */ @@ -7689,6 +7697,7 @@ "Dynamic: %s\r\n" "Natsupport: %s\r\n" "ACL: %s\r\n" + "HideSilenceSupp: %s\r\n" "Status: %s\r\n\r\n", idtext, iterator->name, @@ -7697,6 +7706,7 @@ ast_test_flag((&iterator->flags_page2), SIP_PAGE2_DYNAMIC) ? "yes" : "no", /* Dynamic or not? */ (ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? "yes" : "no", /* NAT=yes? */ iterator->ha ? "yes" : "no", /* permit/deny */ + ast_test_flag((&iterator->flags_page2),SIP_PAGE2_HIDE_SILENCESUPP) ? "yes" : "no", /* Hide SilenceSupp from header */ status); } @@ -12300,6 +12310,12 @@ 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, "hidesilencesupp")) { + if (!strcasecmp(v->value, "yes")) { + ast_set_flag((&peer->flags_page2), SIP_PAGE2_HIDE_SILENCESUPP); + } else if (strcasecmp(v->value, "no")) { + ast_log(LOG_WARNING, "hidesilencesupp bad param on %s just use: 'yes' or 'no'\n", peer->name); + } } } if (!ast_test_flag((&global_flags_page2), SIP_PAGE2_IGNOREREGEXPIRE) && ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC) && realtime) {