SIP client card, as intercom

For video for my door intercom , can just add a lovelace camera view card, untill you have video call enabled :slight_smile:

how do you actually handle audio with this card? does it use the mic/speaker from the android itself?

1 Like

Is it also possble to have DTMF signals on roadmap? Useful for intercom, so we can open a door? Or maybe already possible? Normally I need to enter like #1 within a call

Yes, it uses the standard browser mic/speaker.

I will add DTMF signals on roadmap with high priority. I was thinking about a button which will send a configured DTMF signal to the current session. Or do you have another idea?

Thanks for the feedback. :slight_smile:

Ouch, hope you get it working. FreePBX can be very difficult.

Good luck! :+1:

yeah, button is OK, we can predefine those or make some favorites

right now, setting it up, just finisher freepbx part and rebooted , but i always struggle to loading custom cards !! : grrr :sa:
edit: reboot fixed it…

image

how does this work? how can i call this card? as what kind of extension is this one regstered? not sure if i understand it correct? i also created 1 extension with all those extra stuff like in wiki, that was on extension 2003 … so is this card registered as 2003 ?

The card is registered as the according clientID. So if you have clientID1 configured as extension 101, the client with that clientID will be registered as 101. The button of its own extension will say “you: name”

You can now also set a name for the button by adding name: <name> to a client.

image

hmm, i’m missing something here, so in freepbx i created extensin 2003 , with all that extra stuff and encryption, then added below

          - type: custom:sipjs-client-card
            server: wss://192.168.0.174:8090/ws
            ringtone: /local/ringtone.mp3
            clients:
              deviceID1:
                aor: sip:[email protected]
                username: 2003

image

at this point, i should see extension 2003 as registered in freepbx? or am i misunderstanding? it it that i can at this point only call extension 2003 ?

this is also strange, right? if i do from chrome? all steps are done from wiki, and freepbx is rebooted

That should be fine, i get that too.

at deviceID1 you need to put your deviceID. You can find that by typing localStorage["lovelace-player-device-id"] in your browsers console. And if you want to register you need to add the password.

ahh ok!! :slight_smile:
ok, changed, now its indeed like below, it recognizes me, also uncommented password…
but i still dont see 2003 as registered, and i also unable to call 2003 from another sip client :frowning:

          - type: custom:sipjs-client-card
            server: wss://192.168.0.174:8090/ws
            ringtone: /local/ringtone.mp3
            clients:
              1: 
                aor: sip:[email protected]
                username: 2003
                password: 2003

image

i also dont see any logs at all when i call from or too , so missing something

the word “idle” , does it means it actually have a connecton to freepbx?

edit ahh, i maybe see whats wrong, i have the clientid, i have it configured the same as the server IP (freepbx) , i need to enter there the IP of the HA client , right?

Could you send the logs in your browser?

ok, config is like below
pbx ip = 174
ha client (chrome) = 216

          - type: custom:sipjs-client-card
            server: wss://192.168.0.174:8090/ws
            ringtone: /local/ringtone.mp3
            clients:
              1: 
                aor: sip:[email protected]
                username: 2003
                password: 2003

image

Fri Oct 15 2021 15:21:31 GMT+0200 (Central European Summer Time) | sip.Transport | Sending WebSocket message: REGISTER sip:192.168.0.216 SIP/2.0 Via: SIP/2.0/WSS mmrqqoan7c87.invalid;branch=z9hG4bK1470080 To: <sip:[email protected]> From: <sip:[email protected]>;tag=kpa8pviqcs CSeq: 2 REGISTER Call-ID: 57blot35k050uplae0qc Max-Forwards: 70 Contact: <sip:[email protected];transport=ws>;expires=600 Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER Supported: outbound, path, gruu User-Agent: SIP.js/0.20.0 Content-Length: 0

logger-factory.ts:101 Fri Oct 15 2021 15:21:31 GMT+0200 (Central European Summer Time) | sip.user-agent-client | Not connected.

logger-factory.ts:101 Fri Oct 15 2021 15:21:31 GMT+0200 (Central European Summer Time) | sip.user-agent-client | User agent client request transport error. Generating internal 503 Service Unavailable.

logger-factory.ts:105 Fri Oct 15 2021 15:21:31 GMT+0200 (Central European Summer Time) | sip.Registerer | Failed to register, status code 503

logger-factory.ts:109 Fri Oct 15 2021 15:21:31 GMT+0200 (Central European Summer Time) | sip.Registerer | Registration transitioned to state Unregistered

logger-factory.ts:109 Fri Oct 15 2021 15:21:31 GMT+0200 (Central European Summer Time) | sip.Registerer | Waiting toggled to false

logger-factory.ts:101 Fri Oct 15 2021 15:21:31 GMT+0200 (Central European Summer Time) | sip.transaction.nict | Not connected.

logger-factory.ts:101 Fri Oct 15 2021 15:21:31 GMT+0200 (Central European Summer Time) | sip.transaction.nict | Transport error occurred in non-INVITE client transaction with id z9hG4bK1470080.

logger-factory.ts:101 Fri Oct 15 2021 15:21:31 GMT+0200 (Central European Summer Time) | sip.transaction.nict | Failed to send initial outgoing request.

/local/ringtone.mp3:1 GET https://88kho08si7pklltharvgh6lvx22m38ov.ui.nabu.casa/local/ringtone.mp3 net::ERR_ABORTED 404 (Not Found)

logger-factory.ts:105 Fri Oct 15 2021 15:21:36 GMT+0200 (Central European Summer Time) | sip.Transport | Connect timed out. Exceeded time set in configuration.connectionTimeout: 5s.

transport.ts:284 WebSocket connection to 'wss://192.168.0.174:8090/ws' failed: WebSocket is closed before the connection is established.

logger-factory.ts:101 Fri Oct 15 2021 15:21:36 GMT+0200 (Central European Summer Time) | sip.Transport | WebSocket error occurred.

logger-factory.ts:105 Fri Oct 15 2021 15:21:36 GMT+0200 (Central European Summer Time) | sip.Transport | WebSocket closed unexpectedly

logger-factory.ts:109 Fri Oct 15 2021 15:21:36 GMT+0200 (Central European Summer Time) | sip.Transport | WebSocket closed wss://192.168.0.174:8090/ws (code: 1006)

logger-factory.ts:109 Fri Oct 15 2021 15:21:36 GMT+0200 (Central European Summer Time) | sip.Transport | Transitioned from Connecting to Disconnected

transport.ts:407 Uncaught (in promise) Error: WebSocket closed wss://192.168.0.174:8090/ws (code: 1006) at Transport.onWebSocketClose (transport.ts:407) at WebSocket.<anonymous> (transport.ts:256) at transport.ts:284

OWW! i saw i mystyped, i added 8090 in wss port config, it needs to be 8089
ok, getting somewhere, now i see logs in freepbx

almost there!!

[2021-10-15 13:28:29] VERBOSE[14593] res_http_websocket.c: WebSocket connection from '192.168.0.216:3682' closed	
2	[2021-10-15 13:28:29] VERBOSE[14595] res_http_websocket.c: WebSocket connection from '192.168.0.216:8925' closed	
3	[2021-10-15 13:28:30] ERROR[14901] iostream.c: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
4	[2021-10-15 13:28:30] ERROR[14901] tcptls.c: Unable to set up ssl connection with peer '192.168.0.216:1042'	
5	[2021-10-15 13:28:30] ERROR[14901] iostream.c: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
7	[2021-10-15 13:28:31] VERBOSE[14909] res_http_websocket.c: WebSocket connection from '192.168.0.216:1056' for protocol 'sip' accepted using version '13'	
8	[2021-10-15 13:28:31] ERROR[14910] iostream.c: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
9	[2021-10-15 13:28:31] ERROR[14910] tcptls.c: Unable to set up ssl connection with peer '192.168.0.216:1067'	
10	[2021-10-15 13:28:31] ERROR[14910] iostream.c: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
11	[2021-10-15 13:28:31] ERROR[14909] chan_sip.c: 'WS' is not a valid transport for '2003'. we only use 'UDP,TLS'! ending call.	
12	[2021-10-15 13:28:31] NOTICE[14909] chan_sip.c: Registration from '<sip:[email protected]>' failed for '192.168.0.216:1056' - Device not configured to use this transport type	
13	[2021-10-15 13:28:31] VERBOSE[14911] res_http_websocket.c: WebSocket connection from '192.168.0.216:1077' for protocol 'sip' accepted using version '13'	
14	[2021-10-15 13:28:31] ERROR[14911] chan_sip.c: 'WS' is not a valid transport for '2003'. we only use 'UDP,TLS'! ending call.	
15	[2021-10-15 13:28:31] NOTICE[14911] chan_sip.c: Registration from '<sip:[email protected]>' failed for '192.168.0.216:1077' - Device not configured to use this transport type

edit, maybe its because i’m initiating from a nabucasa url? and it doesnt recognize 192.168.0.216 as my source ip ?

ok, it i open HA on local url on port http://xxx:8123 , instead of nabucasa, i get wrong password, allthough password is correct :frowning:

	[2021-10-15 13:41:48] VERBOSE[3195] res_http_websocket.c: WebSocket connection from '192.168.0.216:1059' closed	
3	[2021-10-15 13:41:48] VERBOSE[3204] res_http_websocket.c: WebSocket connection from '192.168.0.216:22906' closed	
4	[2021-10-15 13:41:49] ERROR[3501] iostream.c: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
5	[2021-10-15 13:41:49] ERROR[3501] tcptls.c: Unable to set up ssl connection with peer '192.168.0.216:30080'	
6	[2021-10-15 13:41:49] ERROR[3501] iostream.c: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
7	[2021-10-15 13:41:49] VERBOSE[3502] res_http_websocket.c: WebSocket connection from '192.168.0.216:22242' for protocol 'sip' accepted using version '13'	
8	[2021-10-15 13:41:49] ERROR[3503] iostream.c: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
9	[2021-10-15 13:41:49] ERROR[3503] tcptls.c: Unable to set up ssl connection with peer '192.168.0.216:25909'	
10	[2021-10-15 13:41:49] ERROR[3503] iostream.c: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
11	[2021-10-15 13:41:49] VERBOSE[3504] res_http_websocket.c: WebSocket connection from '192.168.0.216:1059' for protocol 'sip' accepted using version '13'	
12	[2021-10-15 13:41:49] NOTICE[3502] chan_sip.c: Registration from '<sip:[email protected]>' failed for '192.168.0.216:22242' - Wrong password	
13	[2021-10-15 13:41:49] NOTICE[3504] chan_sip.c: Registration from '<sip:[email protected]>' failed for '192.168.0.216:1059' - Wrong password

your aor ip should be the same as the pbx server. So in your case sip:[email protected]

ok, changed aor back to 174 , now i get :frowning:
almost there i think :

2	[2021-10-15 13:48:15] ERROR[4784] iostream.c: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
3	[2021-10-15 13:48:15] ERROR[4784] tcptls.c: Unable to set up ssl connection with peer '192.168.0.216:31627'	
4	[2021-10-15 13:48:15] ERROR[4784] iostream.c: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
5	[2021-10-15 13:48:15] VERBOSE[4785] res_http_websocket.c: WebSocket connection from '192.168.0.216:15960' for protocol 'sip' accepted using version '13'	
6	[2021-10-15 13:48:15] ERROR[4785] chan_sip.c: 'WS' is not a valid transport for '2003'. we only use 'UDP,TLS'! ending call.	
7	[2021-10-15 13:48:15] NOTICE[4785] chan_sip.c: Registration from '<sip:[email protected]>' failed for '192.168.0.216:15960' - Device not configured to use this transport type	
8	[2021-10-15 13:48:20] VERBOSE[2686] res_http_websocket.c: WebSocket connection from '192.168.0.216:23057' closed	
9	[2021-10-15 13:48:24] VERBOSE[2686] res_http_websocket.c: WebSocket connection from '192.168.0.216:32512' closed	
10	[2021-10-15 13:48:26] VERBOSE[2686] res_http_websocket.c: WebSocket connection from '192.168.0.216:1059' closed	
11	[2021-10-15 13:48:35] ERROR[4880] iostream.c: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
12	[2021-10-15 13:48:35] ERROR[4880] tcptls.c: Unable to set up ssl connection with peer '192.168.0.216:1029'	
13	[2021-10-15 13:48:35] ERROR[4880] iostream.c: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error	
14	[2021-10-15 13:48:35] VERBOSE[4881] res_http_websocket.c: WebSocket connection from '192.168.0.216:1033' for protocol 'sip' accepted using version '13'	
15	[2021-10-15 13:48:35] ERROR[4881] chan_sip.c: 'WS' is not a valid transport for '2003'. we only use 'UDP,TLS'! ending call.	
16	[2021-10-15 13:48:35] NOTICE[4881] chan_sip.c: Registration from '<sip:[email protected]>' failed for '192.168.0.216:1033' - Device not configured to use this transport type

Hmm… Try opening HA with your normal URL with https.

nabucasa? its the same error :frowning: