]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Jon Bonilla (Manwe) pointed out on the -dev list:
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 3 Dec 2008 14:09:35 +0000 (14:09 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 3 Dec 2008 14:09:35 +0000 (14:09 +0000)
"I guess that having only ip-phones in mind is not a good approach. Since it is
possible to have a sip proxy connected to asterisk we could receive a 407
(unauthorized) or 483 (too many hops) as response and dialog ending would not be
a good behavior."
So modified.

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

channels/chan_sip.c

index a98afc3d9bde7a3b8a18543a0b5ded3f226ebd9c..26fcec09a2a15ffa2cb9b78f8f43de71052620cb 100644 (file)
@@ -12873,13 +12873,12 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
 
        /* RFC 3261 Section 15 specifies that if we receive a 408 or 481
         * in response to a BYE, then we should end the current dialog
-        * and session. There is no mention in the spec of other 4XX responses,
-        * but it is known that at least one phone manufacturer potentially
-        * will send a 404 in response to a BYE, so we'll be liberal in what
-        * we accept and end the dialog and session if we receive any 4XX 
-        * response to a BYE.
+        * and session.  It is known that at least one phone manufacturer
+        * potentially will send a 404 in response to a BYE, so we'll be
+        * liberal in what we accept and end the dialog and session if we
+        * receive any of those responses to a BYE.
         */
-       if (resp >= 400 && resp < 500 && sipmethod == SIP_BYE) {
+       if ((resp == 404 || resp == 408 || resp == 481) && sipmethod == SIP_BYE) {
                ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
                return;
        }