]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
make SIP_CODEC behave as it suggests (bug #2566)
authorRussell Bryant <russell@russellbryant.com>
Tue, 5 Oct 2004 02:13:00 +0000 (02:13 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 5 Oct 2004 02:13:00 +0000 (02:13 +0000)
Correction: The last commit for cdr_odbc.c was actually bug #2569.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@3913 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 4bca746552d3d9794dcdbc9767e82f16a1c3ac61..6443b7d5a30e36e4fc831002f1c408bebc5813fd 100755 (executable)
@@ -1851,7 +1851,11 @@ static int sip_answer(struct ast_channel *ast)
                        fmt=ast_getformatbyname(codec);
                        if (fmt) {
                                ast_log(LOG_NOTICE, "Changing codec to '%s' for this call because of ${SIP_CODEC) variable\n",codec);
-                               p->jointcapability=fmt;
+                               if (p->jointcapability & fmt) {
+                                       p->jointcapability &= fmt;
+                                       p->capability &= fmt;
+                               } else
+                                       ast_log(LOG_NOTICE, "Ignoring ${SIP_CODEC} variable because it is not shared by both ends.\n");
                        } else ast_log(LOG_NOTICE, "Ignoring ${SIP_CODEC} variable because of unrecognized/not configured codec (check allow/disallow in sip.conf): %s\n",codec);
                }