SIP client card, as intercom

Okay, great thanks. The card is appearing now. I just need to get the connection etc. working so will work on that.

@TECHFox I really enjoy your plugins,
I have a problem I would love for you to help me,
I have the Asterisk-add-on plugin installed and also Asterisk-integration and HA-SIP
‘Asterisk’ works fine but I can not run the combinations,
I get SSL errors all the time What can I do?
I saw your guide https://github.com/TECH7Fox/HA-SIP/wiki/Setup-FreePBX but I do not know where to configure everything, because I have Asterisk from your plugin, and without the Asterisk interface (I configure it manually in files),
My need for extensions is not for a call from HA, but for controlling HA via the phone, by setting triggers when a call is received from a certain number,
This is the error message I’m getting,

error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 15 15:00:49] ERROR[729]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '192.168.2.101:52684'
[Feb 15 15:00:49] ERROR[729]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 15 19:35:49] ERROR[735]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 15 19:35:49] ERROR[735]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '192.168.2.71:53550'
[Feb 15 19:35:49] ERROR[735]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 15 19:45:19] ERROR[743]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 15 19:45:19] ERROR[743]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '192.168.2.71:54654'
[Feb 15 19:45:19] ERROR[743]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 15 19:50:22] WARNING[754]: res_http_websocket.c:831 __ast_websocket_uri_cb: WebSocket connection from '192.168.2.71:54907' could not be accepted - did not request WebSocket
[Feb 15 19:51:40] WARNING[756]: res_http_websocket.c:831 __ast_websocket_uri_cb: WebSocket connection from '192.168.2.71:55109' could not be accepted - did not request WebSocket
[Feb 15 20:00:07] WARNING[766]: res_http_websocket.c:831 __ast_websocket_uri_cb: WebSocket connection from '192.168.2.71:55686' could not be accepted - did not request WebSocket

Hi Meni,

Thank you for your interest in my project! :slight_smile:

You can test your certificate by going to https://yourHA-IP:8089/ws it should say update required. If that doesn’t work, are you using the autogenerated sip extensions?

There is also a wiki on the addon github that may contains helpful info, including a discord link.

@TECHFox
If I log in to https: // yourHA-IP: 8089 / ws I get the required update as you wrote to me,

I use autogenerated settings,
what can be done? Thank you

Can you share your card config?

Also, check the browser console for any errors.

@TECHFox
This is the card configuration,

type: custom:sipjs-card
server: 192.168.2.212
port: '8089'
ringtone: ''
ringbacktone: ''
video: true
state_color: true
auto_answer: true
extensions:
  - person: person.meni
    name: '101'
    extension: '102'
    secret: '1234'
    icon: ''
    entity: ''
dtmfs:
  - name: '1'
    signal: '1'
    icon: ''

Another problem I have and maybe it’s related to the security issue, the time in the asterisk’s log log two hours late from the correct time,
How can this be fixed?

Don’t know about the log time, that’s strange.

Check if your mic (and camera is working when video is enabled) is working in your browser. Otherwise you need to use https for HA. Duckdns is quite easy.

HI @TECHFox
I switched from Chrome browser to Firefox, and it works great for me :slight_smile:
Now I need to set triggers for activations by the plugin,
Your Asterisk-integration plugin installs extensions entities,
He currently gives 2 triggers of ‘idle’ and ‘inuse’ with which triggers can not be determined,
Are there other sensors that can be used to set triggers?
you are great!

Nice, hope you like the card! :slight_smile:
Let me know if you have any ideas to improve it.

Currently it only makes sensors for the server and every SIP extension. I will work on the integration and add more sensors and information (like the number called, connection type etc.)

There also is a known problem with reconnecting once the connection fails. That will also be fixed.

1 Like

@TECHFox You’re great,
I’m already waiting for this update :slight_smile:

@TECHFox Is there a solution to the problem of a security certificate on an inverted proxy server?
That’s the errors I get,

[Feb 21 12:09:40] ERROR[788]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 21 12:09:40] ERROR[788]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '192.168.2.101:63274'
[Feb 21 12:09:40] ERROR[788]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 21 12:10:05] ERROR[789]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 21 12:10:05] ERROR[789]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '192.168.2.101:63291'
[Feb 21 12:10:05] ERROR[789]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 21 12:10:05] ERROR[790]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 21 12:10:05] ERROR[790]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '192.168.2.101:63292'
[Feb 21 12:10:05] ERROR[790]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 21 12:10:05] ERROR[791]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Feb 21 12:10:05] ERROR[791]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '192.168.2.101:63293'
[Feb 21 12:10:05] ERROR[791]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error

You need a valid certificate and use the correct domain with it. Can’t really help you with that as I never used proxy server.

1 Like

Hi TECHFox, thanks a lot for the effort in making this HA integration!

I have tried installing the add-on, and configurating it per your instruction (my HA already has duckDNS and let’s encrypt). However, the log shows a lot of error messages, even though at the end it says “Asterisk Ready” in green. The integration seems to work as the states of the sensors show up in development tools. But after I set up the custom card, it does not connect

Could you please provide some advice how these may be resolved? Thanks! Below is the screenshot of the errors and the code of the customer card

type: custom:sipjs-card
server: localhost
port: '8089'
ringtone: ''
ringbacktone: ''
video: false
auto_answer: false
extensions:
  - person: person.user1
    name: '100'
    extension: '100'
    secret: '123456'
    entity: sensor.asterisk_extension_100
  - person: person.user2
    name: '102'
    extension: '102'
    secret: '123456'
    entity: sensor.asterisk_extension_102


[log of add-on]


[Integration entity states showing in development tools]


[Customer card connecting and offline]

Are you connected from external? You opened the 8089 port in your firewall? Also the RTP ports are needed for audio

@pergola.fabio My HA is configured to be used from external network (eg from my phone when i am not at home), using duckdns and let’s encrypt. On my router, do I need to set port forwarding for 8089 and udp 10000 - 20000 to my HA server IP (which is hosting this add-on)? Thanks

Yes , correct

i tried setting up asterix and it says its ready but then says there is an api error. what am i doing wrong?

Add-on: Asterisk
 PBX server for SIP devices like doorbells and phones
-----------------------------------------------------------
 Add-on version: 1.3.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 7.4  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2022.2.5
 Home Assistant Supervisor: 2022.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to NOTICE
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] asterisk.sh: executing... 
Generating a RSA private key
......................................................................................................................................................................................................................................................................................................................................................++++
.............................................................................................................++++
writing new private key to '/etc/asterisk/keys/privkey.pem'
-----
sending incremental file list
./
sent 2,507 bytes  received 20 bytes  5,054.00 bytes/sec
total size is 667,430  speedup is 264.12
[cont-init.d] asterisk.sh: exited 0.
[cont-init.d] asterisk_mbox.sh: executing... 
[cont-init.d] asterisk_mbox.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Unable to install capabilities.
PBX UUID: 8120d016-ed20-4aa7-bb00-3988ef618540
[Feb 24 17:19:15] NOTICE[478]: loader.c:2377 load_modules: 312 modules will be loaded.
[Feb 24 17:19:16] NOTICE[478]: cdr.c:4504 cdr_toggle_runtime_options: CDR simple logging enabled.
[Feb 24 17:19:16] ERROR[552]: res_pjsip/config_system.c:267 system_create_resolver_and_set_nameservers: There are no local system nameservers configured, resorting to system resolution
[Feb 24 17:19:16] ERROR[552]: res_pjsip/config_system.c:267 system_create_resolver_and_set_nameservers: There are no local system nameservers configured, resorting to system resolution
[Feb 24 17:19:16] WARNING[478]: res_phoneprov.c:1232 get_defaults: Unable to find a valid server address or name.
[Feb 24 17:19:16] NOTICE[478]: res_smdi.c:1424 load_module: No SMDI interfaces are available to listen on, not starting SMDI listener.
[Feb 24 17:19:16] NOTICE[478]: chan_skinny.c:8451 config_load: Configuring skinny from skinny.conf
[Feb 24 17:19:16] WARNING[478]: chan_dahdi.c:19251 process_dahdi: Ignoring any changes to 'userbase' (on reload) at line 23.
[Feb 24 17:19:16] WARNING[478]: chan_dahdi.c:19251 process_dahdi: Ignoring any changes to 'vmsecret' (on reload) at line 31.
[Feb 24 17:19:16] WARNING[478]: chan_dahdi.c:19251 process_dahdi: Ignoring any changes to 'hassip' (on reload) at line 35.
[Feb 24 17:19:16] WARNING[478]: chan_dahdi.c:19251 process_dahdi: Ignoring any changes to 'hasiax' (on reload) at line 39.
[Feb 24 17:19:16] WARNING[478]: chan_dahdi.c:19251 process_dahdi: Ignoring any changes to 'hasmanager' (on reload) at line 47.
[Feb 24 17:19:16] SIP channel loading...
[Feb 24 17:19:16] NOTICE[478]: chan_sip.c:31956 build_peer: The 'username' field for sip peers has been deprecated in favor of the term 'defaultuser'
[Feb 24 17:19:16] ERROR[478]: ari/config.c:312 process_config: No configured users for ARI
[Feb 24 17:19:16] NOTICE[478]: confbridge/conf_config_parser.c:2370 verify_default_profiles: Adding default_menu menu to app_confbridge
[Feb 24 17:19:16] NOTICE[478]: cel_custom.c:95 load_config: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs.
[Feb 24 17:19:16] ERROR[478]: codec_dahdi.c:813 find_transcoders: Failed to open /dev/dahdi/transcode: No such file or directory
[Feb 24 17:19:16] WARNING[478]: loader.c:2381 load_modules: Some non-required modules failed to load.
[Feb 24 17:19:16] ERROR[478]: loader.c:2396 load_modules: res_timing_dahdi declined to load.
[Feb 24 17:19:16] ERROR[478]: loader.c:2396 load_modules: Failed to resolve dependencies for res_stir_shaken
[Feb 24 17:19:16] ERROR[478]: loader.c:2396 load_modules: res_stir_shaken declined to load.
[Feb 24 17:19:16] ERROR[478]: loader.c:2396 load_modules: res_pjsip_transport_websocket declined to load.
[Feb 24 17:19:16] ERROR[478]: loader.c:2396 load_modules: cel_sqlite3_custom declined to load.
[Feb 24 17:19:16] ERROR[478]: loader.c:2396 load_modules: cdr_sqlite3_custom declined to load.
[Feb 24 17:19:16] ERROR[478]: loader.c:2396 load_modules: Failed to resolve dependencies for res_http_media_cache
[Feb 24 17:19:16] ERROR[478]: loader.c:2396 load_modules: res_http_media_cache declined to load.
[Feb 24 17:19:16] ERROR[478]: loader.c:2396 load_modules: Failed to resolve dependencies for res_pjsip_stir_shaken
[Feb 24 17:19:16] ERROR[478]: loader.c:2396 load_modules: res_pjsip_stir_shaken declined to load.
[Feb 24 17:19:16] WARNING[520]: chan_sip.c:35461 deprecation_notice: chan_sip has no official maintainer and is deprecated.  Migration to
[Feb 24 17:19:16] WARNING[520]: chan_sip.c:35462 deprecation_notice: chan_pjsip is recommended.  See guides at the Asterisk Wiki:
[Feb 24 17:19:16] WARNING[520]: chan_sip.c:35463 deprecation_notice: https://wiki.asterisk.org/wiki/display/AST/Migrating+from+chan_sip+to+res_pjsip
[Feb 24 17:19:16] WARNING[520]: chan_sip.c:35464 deprecation_notice: https://wiki.asterisk.org/wiki/display/AST/Configuring+res_pjsip
[Feb 24 17:19:16] Asterisk Ready.
[12:19:16] ERROR: Got unexpected response from the API: Service asterisk not found for dictionary value @ data['service']. Got 'asterisk'

That’s normal, I have I too


no i have the integration set up how do i know what each extension is?