summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorDavid Vossel <dvossel@digium.com>2010-01-12 16:14:41 +0000
committerDavid Vossel <dvossel@digium.com>2010-01-12 16:14:41 +0000
commitfa0ef8031dab6a50134e14c80ab4cf69ed11fa45 (patch)
tree618a809c3085a04e2389f7f79c3cbbb58411f61c /channels/chan_sip.c
parentbd2c63a59d6ca500ee753cf8b4fe896bef8722d8 (diff)
fixes text support in sdp answer
The code that handled setting 'm=text' in the sdp was not executing in the correct order. The check to see if text was needed came after the check to add 'm=text' to the sdp, this resulted in 'm=text' always being set to 0 because it looked like text was never required. (closes issue #16457) Reported by: peterj Patches: textportinsdp.diff uploaded by peterj (license 951) issue16457.diff uploaded by dvossel (license 671) Tested by: peterj git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 931be30c1..e2afa6895 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10568,13 +10568,29 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
p->sessionversion++;
}
- /* Check if we need video in this call */
- if (add_audio && (p->jointcapability & AST_FORMAT_VIDEO_MASK) && !p->novideo) {
- if (p->vrtp) {
- needvideo = TRUE;
- ast_debug(2, "This call needs video offers!\n");
- } else
- ast_debug(2, "This call needs video offers, but there's no video support enabled!\n");
+ if (add_audio) {
+ /* Check if we need video in this call */
+ if ((p->jointcapability & AST_FORMAT_VIDEO_MASK) && !p->novideo) {
+ if (p->vrtp) {
+ needvideo = TRUE;
+ ast_debug(2, "This call needs video offers!\n");
+ } else
+ ast_debug(2, "This call needs video offers, but there's no video support enabled!\n");
+ }
+ /* Check if we need text in this call */
+ if ((p->jointcapability & AST_FORMAT_TEXT_MASK) && !p->notext) {
+ if (sipdebug_text)
+ ast_verbose("We think we can do text\n");
+ if (p->trtp) {
+ if (sipdebug_text) {
+ ast_verbose("And we have a text rtp object\n");
+ }
+ needtext = TRUE;
+ ast_debug(2, "This call needs text offers! \n");
+ } else {
+ ast_debug(2, "This call needs text offers, but there's no text support enabled ! \n");
+ }
+ }
}
get_our_media_address(p, needvideo, needtext, &sin, &vsin, &tsin, &dest, &vdest, &tdest);
@@ -10610,19 +10626,6 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
ast_verbose("Video is at %s port %d\n", ast_inet_ntoa(p->ourip.sin_addr), ntohs(vdest.sin_port));
}
- /* Check if we need text in this call */
- if((capability & AST_FORMAT_TEXT_MASK) && !p->notext) {
- if (sipdebug_text)
- ast_verbose("We think we can do text\n");
- if (p->trtp) {
- if (sipdebug_text)
- ast_verbose("And we have a text rtp object\n");
- needtext = TRUE;
- ast_debug(2, "This call needs text offers! \n");
- } else
- ast_debug(2, "This call needs text offers, but there's no text support enabled ! \n");
- }
-
/* Ok, we need text. Let's add what we need for text and set codecs.
Text is handled differently than audio since we can not transcode. */
if (needtext) {