Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ws connect to asterisk #184

Open
DavidGOrtega opened this issue Oct 17, 2024 · 2 comments
Open

ws connect to asterisk #184

DavidGOrtega opened this issue Oct 17, 2024 · 2 comments

Comments

@DavidGOrtega
Copy link

DavidGOrtega commented Oct 17, 2024

Hi!

I have looked thought the issues, docs... on how to connect via ws. The only reference that I have found is specifying the transport.

I have tried to connect to my asterisk instance with a sipUri like sip:trunk.mydomain.com:8088/ws;transport=ws of course I have tried the canonical that I use with our softphone 008 ws:trunk.mydomain.com:8088/ws but no luck yet.

Im trying with

srf.request(sipUri, registerMessage, (err, req) => {

ws:trunk.mydomain.com:8088/ws gives the error

Error: invalid request-uri: REGISTER ws:trunk.mydomain.com:8088/ws;transport=ws SIP/2.0
    at DrachtioAgent.<anonymous> (/Users/davidgortega/Documents/projects/kunzite/008Q/node_modules/drachtio-srf/lib/drachtio-agent.js:315:21)
    at DrachtioAgent._onMsg (/Users/davidgortega/Documents/projects/kunzite/008Q/node_modules/drachtio-srf/lib/drachtio-agent.js:749:11)
    at WireProtocol.emit (node:events:517:28)
    at WireProtocol._onData (/Users/davidgortega/Documents/projects/kunzite/008Q/node_modules/drachtio-srf/lib/wire-protocol.js:306:14)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:368:12)
    at readableAddChunk (node:internal/streams/readable:341:9)
    at Readable.push (node:internal/streams/readable:278:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

with sip:trunk.mydomain.com:8088/ws;transport=ws drachtio-server crashes

drachtio-server  | 2024-10-17 13:54:28.202854 SipDialogController::doSendRequestOutsideDialog - using client-specified call-id: 678896
drachtio-server  | 2024-10-17 13:54:28.202905 isLocalSipUri: checking to see if this is one of mine: sip:trunk.mydomain.com:8088ws;transport=ws
drachtio-server  | drachtio: sip_basic.c:240: sip_request_create: Assertion `b == end' failed.

Any help would be appreciated.
Thanks

@danvirsen
Copy link
Contributor

The SIP URIs you tried aren't valid.
Have you tried with sip:trunk.mydomain.com:8088;transport=ws?

@DavidGOrtega
Copy link
Author

Hi @danvirsen thanks for the reply.

The SIP URIs you tried aren't valid.
Have you tried with sip:trunk.mydomain.com:8088;transport=ws?

No one should be listening at sip:trunk.mydomain.com:8088. Asterisk is launching the socket at sip:trunk.mydomain.com:8088/ws

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants