aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-04 21:54:38 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-04 21:54:38 +0000
commitbbaea5b8195aa4fcc557f51b16b4cfd7d8c45042 (patch)
treeece3d857bbadc133642690cd097e28bf6b134000 /channels
parent737d1121a972f2298e3e419642c358e21d5486fb (diff)
Various video fixes (bug #688)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2616 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d1d690de1..273d7477c 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -59,6 +59,7 @@
#include <mysql/mysql.h>
#endif
+#define VIDEO_CODEC_MASK 0x1fc0000 // Video codecs from H.261 thru AST_FORMAT_MAX_VIDEO
#ifndef IPTOS_MINCOST
#define IPTOS_MINCOST 0x02
#endif
@@ -2058,10 +2059,12 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
while(*codecs && (*codecs < 33)) codecs++;
}
}
+ if (p->vrtp)
+ ast_rtp_pt_clear(p->vrtp); // Must be cleared in case no m=video line exists
+
if (p->vrtp && (sscanf(m, "video %d RTP/AVP %n", &x, &len) == 1)) {
vportno = x;
// Scan through the RTP payload types specified in a "m=" line:
- ast_rtp_pt_clear(p->vrtp);
codecs = m + len;
while(strlen(codecs)) {
if (sscanf(codecs, "%d%n", &codec, &len) != 1) {
@@ -2781,7 +2784,7 @@ static int add_sdp(struct sip_request *resp, struct sip_pvt *p, struct ast_rtp *
if ((sizeof(m) <= strlen(m) - 2) || (sizeof(m2) <= strlen(m2) - 2) || (sizeof(a) == strlen(a)) || (sizeof(a2) == strlen(a2)))
ast_log(LOG_WARNING, "SIP SDP may be truncated due to undersized buffer!!\n");
len = strlen(v) + strlen(s) + strlen(o) + strlen(c) + strlen(t) + strlen(m) + strlen(a);
- if (p->vrtp)
+ if ((p->vrtp) && (p->jointcapability & VIDEO_CODEC_MASK)) // only if video response is appropriate
len += strlen(m2) + strlen(a2);
snprintf(costr, sizeof(costr), "%d", len);
add_header(resp, "Content-Type", "application/sdp");
@@ -2793,7 +2796,7 @@ static int add_sdp(struct sip_request *resp, struct sip_pvt *p, struct ast_rtp *
add_line(resp, t);
add_line(resp, m);
add_line(resp, a);
- if (p->vrtp) {
+ if ((p->vrtp) && (p->jointcapability & VIDEO_CODEC_MASK)) { // only if video response is appropriate
add_line(resp, m2);
add_line(resp, a2);
}