aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-16 12:14:53 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-16 12:14:53 +0000
commitbfa699873067bdb5da1d13e475fc8882946b03ec (patch)
tree6b2f8a1a3b904b6579bfc393e0f589510b1dfa2f /channels
parentc55d56714d3abbb46f6e2aa94e9b6ed4fff06b24 (diff)
Merged revisions 54787 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r54787 | oej | 2007-02-16 13:06:23 +0100 (Fri, 16 Feb 2007) | 2 lines Issue #7541 - Handle multipart attachments to SIP messages - even if boundary is quoted. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@54806 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index ef367917f..20a14f0fb 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4870,6 +4870,7 @@ static int find_sdp(struct sip_request *req)
const char *search;
char *boundary;
unsigned int x;
+ int boundaryisquoted = FALSE;
content_type = get_header(req, "Content-Type");
@@ -4889,15 +4890,24 @@ static int find_sdp(struct sip_request *req)
return 0;
search += 10;
-
if (ast_strlen_zero(search))
return 0;
+ /* If the boundary is quoted with ", remove quote */
+ if (*search == '\"') {
+ search++;
+ boundaryisquoted = TRUE;
+ }
+
/* make a duplicate of the string, with two extra characters
at the beginning */
boundary = ast_strdupa(search - 2);
boundary[0] = boundary[1] = '-';
+ /* Remove final quote */
+ if (boundaryisquoted)
+ boundary[strlen(boundary) - 1] = '\0';
+
/* search for the boundary marker, but stop when there are not enough
lines left for it, the Content-Type header and at least one line of
body */