From f0c834965c8c9fec31e010bfa142a4e97be5315c Mon Sep 17 00:00:00 2001 From: mnicholson Date: Wed, 22 Sep 2010 17:39:12 +0000 Subject: Handle media specific T.38 SDP information (closes issue #16647) Reported by: kwemheuer git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@288412 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_sip.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'channels') diff --git a/channels/chan_sip.c b/channels/chan_sip.c index b9996c1a5..c652460eb 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5463,9 +5463,11 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) /* Host information */ struct ast_hostent audiohp; struct ast_hostent videohp; + struct ast_hostent imagehp; struct ast_hostent sessionhp; struct hostent *hp = NULL; /*!< RTP Audio host IP */ struct hostent *vhp = NULL; /*!< RTP video host IP */ + struct hostent *ihp = NULL; /*!< UDPTL host IP */ int portno = -1; /*!< RTP Audio port number */ int vportno = -1; /*!< RTP Video port number */ int udptlportno = -1; /*!< UDPTL Image port number */ @@ -5541,6 +5543,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) processed = TRUE; hp = &sessionhp.hp; vhp = hp; + ihp = hp; } break; case 'a': @@ -5675,6 +5678,11 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) processed = TRUE; vhp = &videohp.hp; } + } else if (image) { + if (process_sdp_c(value, &imagehp)) { + processed = TRUE; + ihp = &imagehp.hp; + } } break; case 'a': @@ -5709,7 +5717,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) } /* Sanity checks */ - if (!hp && !vhp) { + if (!hp && !vhp && !ihp) { ast_log(LOG_WARNING, "Insufficient information in SDP (c=)...\n"); return -1; } @@ -5844,7 +5852,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) ast_log(LOG_DEBUG, "Peer T.38 UDPTL is set behind NAT and with destination, destination address now %s\n", ast_inet_ntoa(isin.sin_addr)); } } else - memcpy(&isin.sin_addr, hp->h_addr, sizeof(isin.sin_addr)); + memcpy(&isin.sin_addr, ihp->h_addr, sizeof(isin.sin_addr)); ast_udptl_set_peer(p->udptl, &isin); if (debug) ast_log(LOG_DEBUG,"Peer T.38 UDPTL is at port %s:%d\n",ast_inet_ntoa(isin.sin_addr), ntohs(isin.sin_port)); -- cgit v1.2.3