Skip to content
Permalink
Browse files

Fixed the message header split when a parsing error occurs.

Parsing error log enhanced.
  • Loading branch information
jmillan committed Nov 19, 2012
1 parent 75b0a52 commit d5f34329d4c1a036e3001c64558e1416fd70a605
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/SIPMessage.js
@@ -281,12 +281,11 @@ JsSIP.IncomingMessage.prototype = {
}

//substitute '-' by '_' for grammar rule matching.
name = name.replace(/-/g, '_');
parsed = JsSIP.grammar.parse(value, name);
parsed = JsSIP.grammar.parse(value, name.replace(/-/g, '_'));

if(parsed === -1) {
this.headers[name].splice(idx, 1); //delete from headers
console.error(JsSIP.c.LOG_MESSAGE +'Error parsing Header ' + name + ':"' + value + '"');
console.error(JsSIP.c.LOG_MESSAGE +'Error parsing "' + name + '" header field with value: "' + value + '"');
return;
} else {
header.parsed = parsed;

0 comments on commit d5f3432

Please sign in to comment.
You can’t perform that action at this time.