[asterisk-commits] kharwell: trunk r401886 - in /trunk: ./ channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Oct 25 11:09:06 CDT 2013
Author: kharwell
Date: Fri Oct 25 11:09:05 2013
New Revision: 401886
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=401886
Log:
chan_sip: Allow a sip peer to accept both AVP and AVPF calls
Adapts the behaviour of avpf to only impact the format of outgoing calls. For
inbound calls, both AVP and AVPF calls will be accepted regardless of the value
of avpf in the configuration.
(closes issue ASTERISK-22005)
Reported by: Torrey Searle
Patches:
optional_avpf_trunk.patch uploaded by tsearle (license 5334)
........
Merged revisions 401884 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 401885 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
trunk/ (props changed)
trunk/channels/chan_sip.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.
Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=401886&r1=401885&r2=401886
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Oct 25 11:09:05 2013
@@ -10242,11 +10242,26 @@
}
if ((!strcmp(protocol, "RTP/SAVPF") || !strcmp(protocol, "UDP/TLS/RTP/SAVPF")) && !ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF)) {
- ast_log(LOG_WARNING, "Received SAVPF profle in audio offer but AVPF is not enabled: %s\n", m);
- continue;
+ if (req->method != SIP_RESPONSE) {
+ ast_log(LOG_NOTICE, "Received SAVPF profle in audio offer but AVPF is not enabled, enabling: %s\n", m);
+ secure_audio = 1;
+ ast_set_flag(&p->flags[2], SIP_PAGE3_USE_AVPF);
+ }
+ else {
+
+ ast_log(LOG_WARNING, "Received SAVPF profle in audio answer but AVPF is not enabled: %s\n", m);
+ continue;
+ }
} else if ((!strcmp(protocol, "RTP/SAVP") || !strcmp(protocol, "UDP/TLS/RTP/SAVP")) && ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF)) {
- ast_log(LOG_WARNING, "Received SAVP profile in audio offer but AVPF is enabled: %s\n", m);
- continue;
+ if (req->method != SIP_RESPONSE) {
+ ast_log(LOG_NOTICE, "Received SAVP profle in audio offer but AVPF is enabled, disabling: %s\n", m);
+ secure_audio = 1;
+ ast_clear_flag(&p->flags[2], SIP_PAGE3_USE_AVPF);
+ }
+ else {
+ ast_log(LOG_WARNING, "Received SAVP profile in audio offer but AVPF is enabled: %s\n", m);
+ continue;
+ }
} else if (!strcmp(protocol, "UDP/TLS/RTP/SAVP") || !strcmp(protocol, "UDP/TLS/RTP/SAVPF")) {
secure_audio = 1;
@@ -10257,11 +10272,23 @@
} else if (!strcmp(protocol, "RTP/SAVP") || !strcmp(protocol, "RTP/SAVPF")) {
secure_audio = 1;
} else if (!strcmp(protocol, "RTP/AVPF") && !ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF)) {
- ast_log(LOG_WARNING, "Received AVPF profile in audio offer but AVPF is not enabled: %s\n", m);
- continue;
+ if (req->method != SIP_RESPONSE) {
+ ast_log(LOG_NOTICE, "Received AVPF profile in audio offer but AVPF is not enabled, enabling: %s\n", m);
+ ast_set_flag(&p->flags[2], SIP_PAGE3_USE_AVPF);
+ }
+ else {
+ ast_log(LOG_WARNING, "Received AVP profile in audio answer but AVPF is enabled: %s\n", m);
+ continue;
+ }
} else if (!strcmp(protocol, "RTP/AVP") && ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF)) {
- ast_log(LOG_WARNING, "Received AVP profile in audio offer but AVPF is enabled: %s\n", m);
- continue;
+ if (req->method != SIP_RESPONSE) {
+ ast_log(LOG_NOTICE, "Received AVP profile in audio answer but AVPF is enabled, disabling: %s\n", m);
+ ast_clear_flag(&p->flags[2], SIP_PAGE3_USE_AVPF);
+ }
+ else {
+ ast_log(LOG_WARNING, "Received AVP profile in audio answer but AVPF is enabled: %s\n", m);
+ continue;
+ }
} else if ((!strcmp(protocol, "UDP/TLS/RTP/SAVP") || !strcmp(protocol, "UDP/TLS/RTP/SAVPF")) &&
(!(dtls = ast_rtp_instance_get_dtls(p->rtp)) || !dtls->active(p->rtp))) {
ast_log(LOG_WARNING, "Received UDP/TLS in audio offer but DTLS is not enabled: %s\n", m);
More information about the asterisk-commits
mailing list