]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ensure that T.38 INVITEs generated by Asterisk properly result in T.38 being enabled.
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 21 Aug 2009 20:23:45 +0000 (20:23 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 21 Aug 2009 20:23:45 +0000 (20:23 +0000)
(closes issue #15373)
Reported by: dcolombo
Patches:
      chan_sip.patch uploaded by mbrancaleoni (license 342)
Tested by: dcolombo, mbrancaleoni

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

channels/chan_sip.c

index 5bb560691c49498280785ae6963333efc09815a8..87b4c6aa344d278fe915f698ef942f8ca1199801 100644 (file)
@@ -5370,8 +5370,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
                                        ast_verbose("Found RTP video format %d\n", codec);
                                ast_rtp_set_m_type(newvideortp, codec);
                        }
-               } else if (p->udptl && ( (sscanf(m, "image %30d udptl t38%n", &x, &len) == 1 && len > 0) || 
-                (sscanf(m, "image %30d UDPTL t38%n", &x, &len) == 1 && len >= 0) )) {
+               } else if (p->udptl && ((sscanf(m, "image %30d udptl t38%n", &x, &len) == 1 && len > 0) || 
+                                       (sscanf(m, "image %30d UDPTL t38%n", &x, &len) == 1 && len >= 0))) {
                        if (debug)
                                ast_verbose("Got T.38 offer in SDP in dialog %s\n", p->callid);
                        p->offered_media[SDP_IMAGE].offered = TRUE;
@@ -5379,9 +5379,11 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
                        numberofmediastreams++;
                        
                        if (p->owner && p->lastinvite) {
-                               p->t38.state = T38_PEER_REINVITE; /* T38 Offered in re-invite from remote party */
-                               if (option_debug > 1)
-                                       ast_log(LOG_DEBUG, "T38 state changed to %d on channel %s\n", p->t38.state, p->owner ? p->owner->name : "<none>" );
+                               if(p->t38.state != T38_LOCAL_REINVITE) {
+                                       p->t38.state = T38_PEER_REINVITE; /* T38 Offered in re-invite from remote party */
+                                       if (option_debug > 1)
+                                               ast_log(LOG_DEBUG, "T38 state changed to %d on channel %s\n", p->t38.state, p->owner ? p->owner->name : "<none>" );
+                               }
                        } else {
                                p->t38.state = T38_PEER_DIRECT; /* T38 Offered directly from peer in first invite */
                                p->t38.direct = 1;