Websocket channel with custom URI

Hi there,

I have an Asterisk GIT-master-009e3ef3f5 and I am playing with dialing websocket channels like this:

same => n,Dial(Websocket/connection1/c(slin16))

Config of websocket.conf

[connection1]
type = websocket_client
connection_type = per_call_config
uri = ws://localhost:8765

I’d like to pass some information towards my websocket server in URL or headers. I haven’t found any options to do this.

My goal would be to pass a variable in URL so the final URL would be ws://localhost:8765?variable=<dynamic_content_from_dialplan>

Is it possible to Dial a websocket like this, or to configure it, so it will always send a predefined variable?

Thanks a lot

Stano

Hmmmm. The only way to do that today would be to set a channel variable then retrieve it using ARI or AMI.

Interesting idea though. Go ahead and open an Improvement request at Asterisk Issue Tracker and I’ll see what it would take to add that capability.

Hi @gjoseph,

thanks a lot. I have opened it here: [improvement]: Websocket channel with custom URI · Issue #1352 · asterisk/asterisk · GitHub

Stano