Skip to content
Permalink
Browse files

Fixed Contact and Record-Route header split.

  • Loading branch information
jmillan committed Nov 14, 2012
1 parent 07a082c commit 0e8c5cfff2d3b0f4897379b42e8ef46dc875b6f3
Showing with 12 additions and 5 deletions.
  1. +12 −5 src/Parser.js
@@ -87,12 +87,14 @@ JsSIP.Parser = (function() {
}
break;
case 'record-route':
header = header_value.split(',');
header = header_value.match(/([^\"\',]*((\'[^\']*\')*||(\"[^\"]*\")*))+/gm);
length = header.length;
parsed = 0;

for(idx=0; idx < length; idx++) {
message.addHeader('record-route', header[idx]);
if (header[idx].length > 0) {
message.addHeader('record-route', header[idx]);
}
}
break;
case 'call-id':
@@ -105,12 +107,17 @@ JsSIP.Parser = (function() {
break;
case 'contact':
case 'm':
header = header_value.split(',');
header = header_value.match(/([^\"\',]*((\'[^\']*\')*||(\"[^\"]*\")*))+/gm);
length = header.length;

for(idx=0; idx < length; idx++) {
message.addHeader('contact', header[idx]);
parsed = message.parseHeader('contact', idx);
if (header[idx].length > 0) {
message.addHeader('contact', header[idx]);
parsed = message.parseHeader('contact', idx);
if (parsed === undefined) {
break;
}
}
}
break;
case 'content-length':

0 comments on commit 0e8c5cf

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