MayamaTakeshi / sip-lab

A node module that helps to write SIP functional tests
3 stars 2 forks source link

allocate_tls_tpfactory allowing creation transport using the same port #104

Open MayamaTakeshi opened 4 weeks ago

MayamaTakeshi commented 4 weeks ago

This code:

    const t1 = sip.transport.create({address: "127.0.0.1", type: 'tls'})
    const t2 = sip.transport.create({address: "127.0.0.1", type: 'tls'})

    console.log("t1", t1)
    console.log("t2", t2)

resulted in:

t1 { id: 0, address: '127.0.0.1', port: 6060 }
t2 { id: 1, address: '127.0.0.1', port: 6060 }

Need to check if this also happens with tcp.

MayamaTakeshi commented 4 weeks ago

I checked tcp and there is no problem. This code:

    t1 = sip.transport.create({address: "127.0.0.1", port: 6060, type: 'tcp'})
    t2 = sip.transport.create({address: "127.0.0.1", port: 6060, type: 'tcp'})

fails as expected:

allocate_tcp_tpfactory ipaddr=127.0.0.1 port=6060
allocate_tcp_tpfactory ipaddr=127.0.0.1 port=6060
status=120098
Error: Unable to start TCP transport
    at Object.create (/home/takeshi/src/git/MayamaTakeshi/sip-lab/index.js:42:38)
    at test (/home/takeshi/src/git/MayamaTakeshi/sip-lab/t:20:24)
    at Object.<anonymous> (/home/takeshi/src/git/MayamaTakeshi/sip-lab/t:405:1)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)