aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-20 13:28:33 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-20 13:28:33 +0000
commitda365df9f3406fb07ee1fcd3eb089bc4b4024cba (patch)
tree4d49d0e0f6d8ed41772644ffa6e911fde3e2d9fc /channels
parent267fa0ccddcdeca8191cfac4dc9ba5a01d1080af (diff)
parse SDP properly even when we are debugging. (Thanks fenlander!)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@35094 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a3c9653ad..e9f6757f8 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4631,23 +4631,19 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
iterator = req->sdp_start;
while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') {
char* mimeSubtype = ast_strdupa(a); /* ensures we have enough space */
- if (!strcasecmp(a, "sendonly")) {
- sendonly = 1;
- continue;
- } else if (!strcasecmp(a, "sendrecv")) {
- sendonly = 0;
- continue;
- } else if (option_debug) {
+ if (option_debug > 1) {
+ int breakout = FALSE;
+
/* If we're debugging, check for unsupported sdp options */
if (!strcasecmp(a, "inactive")) {
/* Inactive media streams: Not supported */
if (debug)
ast_verbose("Got unsupported a:inactive in SDP offer \n");
- continue;
+ breakout = TRUE;
} else if (!strncasecmp(a, "rtcp:", (size_t) 5)) {
if (debug)
ast_verbose("Got unsupported a:rtcp in SDP offer \n");
- continue;
+ breakout = TRUE;
} else if (!strncasecmp(a, "fmtp:", (size_t) 5)) {
/* Format parameters: Not supported */
/* Note: This is used for codec parameters, like bitrate for
@@ -4655,27 +4651,36 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
See RFC2327 for an example */
if (debug)
ast_verbose("Got unsupported a:fmtp in SDP offer \n");
- continue;
+ breakout = TRUE;
} else if (!strncasecmp(a, "framerate:", (size_t) 10)) {
/* Video stuff: Not supported */
if (debug)
ast_verbose("Got unsupported a:framerate in SDP offer \n");
- continue;
+ breakout = TRUE;
} else if (!strncasecmp(a, "maxprate:", (size_t) 9)) {
/* Video stuff: Not supported */
if (debug)
ast_verbose("Got unsupported a:maxprate in SDP offer \n");
- continue;
+ breakout = TRUE;
} else if (!strncasecmp(a, "crypto:", (size_t) 7)) {
/* SRTP stuff, not yet supported */
if (debug)
ast_verbose("Got unsupported a:crypto in SDP offer \n");
- continue;
+ breakout = TRUE;
} else if (!strncasecmp(a, "ptime:", (size_t) 6)) {
if (debug)
ast_verbose("Got unsupported a:ptime in SDP offer \n");
- continue;
+ breakout = TRUE;
}
+ if (breakout) /* We have a match, skip to next header */
+ continue;
+ }
+ if (!strcasecmp(a, "sendonly")) {
+ sendonly = 1;
+ continue;
+ } else if (!strcasecmp(a, "sendrecv")) {
+ sendonly = 0;
+ continue;
} else if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) != 2)
continue;
/* We have a rtpmap to handle */