summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2013-10-25 16:09:05 +0000
committerKevin Harwell <kharwell@digium.com>2013-10-25 16:09:05 +0000
commit9ba7742431251631b3ed693aa8c7e160cef3d723 (patch)
tree038813f1f4f1b6620568b3845b31d1aff377568f
parentce7cddc362a5c231ba366b26d6493593fed5a8b6 (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c43
1 files changed, 35 insertions, 8 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 9a4d28448..791d6936c 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10242,11 +10242,26 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
}
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 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
} 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);