drachtio-siprec-recording-server
drachtio-siprec-recording-server copied to clipboard
Error: expected multipart SIPREC body
I run test with command : npm test
and i receiver error: expected multipart SIPREC body
i was debuged and i saw error in file test/parser.js line 35
////
const segments = data.split(\n${delimiter}
);
const regex = /.Content-Type:\s+(.)\n.\n([\s\S.])$/;
const req = { payload: [] };
for (let i = 1; i < segments.length; i++) {
const arr = regex.exec(segments[i]);
if (!arr) {
continue;
}
req.payload.push({ type: arr[1], content: arr[2] });
}
/// arr alway null so payload null and show error. please help me. thank a alot.
running npm test
on the main branch works successfully for me. Perhaps you checked out the files such that line endings were changed or something? Please show the output of the failing test
this is my screen log when i run test.
i use node v12.22.9
@thieplehuu Parser works for me
test('parser: Broadworks SIPREC payload', (t) => { parseAndVerifyPayload('broadworks-offer-2.txt', '--foobar', t) ; }) ;
tniemczak@debian:~/drachtio-siprec-recording-server$ npm test
[email protected] test NODE_ENV=test node test/ | ./node_modules/.bin/tap-spec
parser: Broadworks SIPREC payload
✔ parsed first SDP
✔ parsed second SDP
✔ parsed caller aor
✔ parsed session id 6ce942a2-1490-4eea-9a14-61e32ca706ba
✔ parsed recording session id: 00FA0800705D4C5DCAAC41
total: 5 passing: 5 duration: 244ms
tniemczak@debian:~/drachtio-siprec-recording-server$