From: Kevin P. Fleming Date: Fri, 21 Aug 2009 20:23:45 +0000 (+0000) Subject: Ensure that T.38 INVITEs generated by Asterisk properly result in T.38 being enabled. X-Git-Tag: 1.4.26.2~4^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79221dad8d224e6a2fb3c40e63af0335a1914b82;p=thirdparty%2Fasterisk.git Ensure that T.38 INVITEs generated by Asterisk properly result in T.38 being enabled. (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 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 5bb560691c..87b4c6aa34 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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 : "" ); + 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 : "" ); + } } else { p->t38.state = T38_PEER_DIRECT; /* T38 Offered directly from peer in first invite */ p->t38.direct = 1;