drachtio-siprec-recording-client
drachtio-siprec-recording-client copied to clipboard
npm test fail
I have installed your siprec-server with rtpengine and now want to test it using siprec-client.
I have installed drachtio-siprec-client for the same but I am not getting success if I test it using "npm test". I try to figure it out but not get any success. There are no call on sipp with uas and uac when test run.
I have share you full logs for fs_cli, drachtio docker and console log when run test.
Console Log: https://pastebin.freeswitch.org/view/fdf8cf94 Drachtio Docker Log: https://pastebin.freeswitch.org/view/47b15426 Freeswitch Log: https://pastebin.freeswitch.org/view/05d31702
please update to the latest and retry
Still it's failing with below error. And your new build is failing in Travis ci also.
[root@ip-172-31-23-246 drachtio-siprec-recording-client]# npm test
[email protected] test /usr/src/drachtio-siprec-recording-client NODE_ENV=test node test/ | ./node_modules/.bin/tap-spec
starting docker network for sip tests..
siprec invite test
/usr/src/drachtio-siprec-recording-client/app.js:21 localHostPorts.push({host: arr[2], port: arr[3]}); ^
TypeError: Cannot read property '2' of null
at /usr/src/drachtio-siprec-recording-client/app.js:21:39
at Array.map (
npm ERR! Test failed. See above for more details.
@davehorton I am getting this value for hostport: udp/[::1]:5060,udp/172.33.0.2:5060,udp/127.0.0.1:5060 and in hp I get udp/[::1]:5060 so not able to get array with host and port. I changed app.js code with below code to resolve above error.
if (config.has('drachtio.host')) {
srf.connect(config.get('drachtio'));
srf
.on('connect', (err, hostport) => {
const hp = hostport.split(",");
const arr = /([a-z]+)\/([0-9\.]+):(\d+)/.exec(hp[1]);
localHostPorts.push({host: arr[2], port: arr[3]});
logger.info(`successfully connected to drachtio listening on ${JSON.stringify(localHostPorts)}`);
})
Now call work but it's take too much time due to one test showing fail. I think start_docker is failing some where. Here my log:
[root@ip-172-31-23-246 drachtio-siprec-recording-client]# npm test
> [email protected] test /usr/src/drachtio-siprec-recording-client
> NODE_ENV=test node test/ | ./node_modules/.bin/tap-spec
starting docker network for sip tests..
stdout:
Creating freeswitch ... done
Creating drachtio ... done
Creating sipp_siprec_server ...
Creating freeswitch ...
Creating drachtio ...
freeswitch freeswitch is ready
✔ docker is up
✖ test timed out after 180000ms
--------------------------------
operator: fail
stack: |-
Error: test timed out after 180000ms
at Test.assert [as _assert] (/usr/src/drachtio-siprec-recording-client/node_modules/tape/lib/test.js:224:54)
at Test.bound [as _assert] (/usr/src/drachtio-siprec-recording-client/node_modules/tape/lib/test.js:76:32)
at Test.fail (/usr/src/drachtio-siprec-recording-client/node_modules/tape/lib/test.js:317:10)
at Test.bound [as fail] (/usr/src/drachtio-siprec-recording-client/node_modules/tape/lib/test.js:76:32)
at Timeout._onTimeout (/usr/src/drachtio-siprec-recording-client/node_modules/tape/lib/test.js:138:14)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
siprec invite test
{"level":30,"time":1618646624528,"msg":"successfully connected to drachtio listening on [{\"host\":\"172.33.0.2\",\"port\":\"5060\"}]","pid":27728,"hostname":"ip-172-31-23-246.ca-central-1.compute.internal","v":1}
cmd: docker run -t --rm --net test_siprec -v /usr/src/drachtio-siprec-recording-client/test/scenarios:/tmp drachtio/sipp sipp -m 1 -sf /tmp/uac_siprec_pcap.xml drachtio
{"level":30,"time":1618646625731,"msg":"received INVITE from 172.33.0.6: uri: sip:[email protected] {\"family\":\"ipv4\",\"scheme\":\"sip\",\"user\":\"service\",\"host\":\"172.33.0.4\",\"port\":null,\"params\":{},\"headers\":{}}","pid":27728,"hostname":"ip-172-31-23-246.ca-central-1.compute.internal","callid":"[email protected]","v":1}
{"level":30,"time":1618646626523,"msg":"created conference: anon-7a4e6754-f029-48ca-871a-ba8917f63780","pid":27728,"hostname":"ip-172-31-23-246.ca-central-1.compute.internal","callid":"[email protected]","v":1}
.. .. ..
.. .. ..
.. .. ..
{"level":30,"time":1618646635141,"msg":"ending call","pid":27728,"hostname":"ip-172-31-23-246.ca-central-1.compute.internal","callid":"[email protected]","v":1}
✔ sip test passed
stopping docker network..
Stopping drachtio ... done
Stopping sipp_siprec_server ... done
Stopping sipp_uas ... done
Stopping freeswitch ... done
Removing drachtio ... done
Removing sipp_siprec_server ... done
Removing sipp_uas ... done
Removing freeswitch ... done
Removing network test_siprec
Failed Tests: There was 1 failure
starting docker network for sip tests..
✖ test timed out after 180000ms
total: 3
passing: 2
failing: 1
duration: 3m 16.3s
npm ERR! Test failed. See above for more details.