SIP client card, as intercom

Hi, first of all , don’t open 5060, lots of hacks coming in, not needed! Open port range 10000-11000 instead for RTP (needed for audio/video)
Port 8089 needs to be open indeed for the card, since you have duckdns, don’t use for testing anywhere the IP, always your duckdns, so your SSL is valid, then open the card and check asterisk logs…

Feel free to join discord

Hey @jojeda654 tks for your post regarding cloudflare and asterisk. I have the same configuration as you. I tried to set all as per your instruction but I have these error on Asterisk log (debug) when I try to register with my softphone (Zoiper).
Do you have any idea how to resolve?
The only difference is that I have changed the Asterisk UDP port 5060 with 5080 in the sip.conf file

[Mar 14 18:17:16] ERROR[488]: iostream.c:647 ast_iostream_start_tls: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[Mar 14 18:17:16] ERROR[488]: tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection with peer '172.30.33.6:53142'
[Mar 14 18:17:16] ERROR[488]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error

I am despairing. I installed the Hikvision add-on with the Asterisk add-on exactly according to the instructions and i use the sipjs-card. How do I recognize with the DS-KV8213 whether a call is parked. For me, the bell works completely normally during the test for some time and then a few hours later there is only a busy character when ringing. I don’t quite understand how to set this up with parked calls and use it with home assistant?

thank you for all your hard work @TECHFox
i still cannot get it to work because the instructions are unclear. i wish someone has a video on how to set up my android tablets in the house to work as intercoms to one another. so tablet1 with user Mom in room 1 can call another tablet2 with user Tung in room2.

something so basic like that should not be so hard. i got the Add-On working.

in my Config, i have this. all local, nothing goes out. no services like duckdns…

i got your card installed. but it’s not working properly when i add to my HA GUI
image

for Integration, this is what i filled in

but i get errors
image

log:
Error setting up entry 192.168.1.229 for asterisk

Traceback (most recent call last):
File “/config/custom_components/asterisk/init.py”, line 132, in async_setup_entry
manager.login(username, password)
File “/usr/local/lib/python3.10/site-packages/asterisk/manager.py”, line 527, in login
raise ManagerAuthException(response.get_header(‘Message’))
asterisk.manager.ManagerAuthException: Authentication failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 383, in async_setup
result = await component.async_setup_entry(hass, self)
File “/config/custom_components/asterisk/init.py”, line 149, in async_setup_entry
raise ConfigEntryNotReady(f"Connection error while connecting to {host}:{port}: {exception.args[1]}")
IndexError: tuple index out of range

meanwhile, error of Add-On shows failed authentication

not sure if it’s because i installed HA OS on a thin client. i dont think it should matter. but i really appreciate your time in helping

Good morning, same problem, what solution did you do? The card rings but I can’t pick up the calls

THanks for your work on this, I am running a Grandstream UCM6202, and I would like to have the client you provided register with it. I have the card loaded, but I could not see anyplace to enter the extension’s password, could you point me in the right direction?

It was some time ago i tried to run this card.

I tried again. I came a long way but i have an error.


[Mar 23 23:39:28] WARNING[4914][C-0000001a]: chan_sip.c:10915 process_sdp: Can't provide secure audio requested in SDP offer

I would like SO MUCH to have this working, but I am COMPLETELY lost when it comes with the Asterix stuff setup…

Let me first say that I am running HA in a virtual machine in my Synology NAS therefore its (HA) IP is different from the NAS one and I dunno then how to have Asterix server and HA with the same IPs now…?

Also when I try to add the Asterix integration it now comes up with a popup forcing me to follow external how-to setup doc links so it looks different from what @TECHFox wrote 2 years ago.

HELP! :tired_face:

1 Like

The setting for the extension password is called secret. Here is a example: Settings | SIP-HASS (tech7fox.github.io)

Guessing you need HTTPS. And I see you use chan_sip, do you use the add-on? If not, how did you configure your wss endpoints?

You needs a valid SSL certificate for the WSS connection. Modern browsers require it for this.

Easiest is indeed to use something like duckdns, but you can also set it up completly locally. It is a bit harder to do but people in the discord server got it working. Here is a invite: HA-SIP

I have exactly the same problem.
I will say more: I’m not using Asterisk but FusionPBX and the error message in dev console is the same. Server itself working perfectly because other SIP clients are communicating each other. The problem is only with the card.
SIP server is showing that card has been registered – I see it in registered devices. The dev console log says the same.
What is wrong here? Does anyone know?

The status is a bit different comparing to Linphone/MicroSip clients. Looks strange but hard to say if this is an issue.

Edit:
I tried with Asterix server as it is described in https://tech7fox.github.io/sip-hass-docs/docs/tutorial/introduction and it works. I think most of the people have problem with extensions because they didn’t read carefully that extensions are created automatically but the numbers are started from 100… and the easiest is to create users in HA as 101,102 etc. (if your doorbell works only with numbers) then restart HA and extensions will appear based on user names.

i have a standalone asterisk server.

yeah i noticed it wanted to connect to sip and did not want to connect to pjsip.

Communication from/to SIP card is working. I have the issue with calls between other SIP clients. For example I cannot call from Linphone to MicroSip and opposite. Did anyone have similar problem? What needs to be changed in Asterisk config?

Error 488 means something with incorrect codec. I’m not sure if this is good direction, I changed codecs in Sip Clients without success. Any idea?

[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:4706 session_inv_on_state_changed: PJSIP/103-00000008: Source of transaction state change is RX_MSG
[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:4648 handle_incoming_before_media: PJSIP/103-00000008: Received response
[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:4515 handle_incoming_response: PJSIP/103-00000008: Response is 488 Not Acceptable Here
[Apr 2 10:57:17] DEBUG[398]: chan_pjsip.c:3105 chan_pjsip_incoming_response_update_cause: PJSIP/103-00000008: Status: 488
[Apr 2 10:57:17] DEBUG[398]: chan_pjsip.c:3126 chan_pjsip_incoming_response_update_cause: PJSIP/103-00000008
[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:4527 handle_incoming_response: PJSIP/103-00000008
[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:4754 session_inv_on_state_changed:
[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:4798 session_inv_on_tsx_state_changed: PJSIP/103-00000008 TSX State: Completed Inv State: DISCONNCTD
[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:4820 session_inv_on_tsx_state_changed: Disconnected
[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:4218 session_on_tsx_state: (null session) TSX State: Completed Inv State: DISCONNCTD
[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:4227 session_on_tsx_state:
[Apr 2 10:57:17] DEBUG[398]: chan_pjsip.c:2908 chan_pjsip_session_end: PJSIP/103-00000008
[Apr 2 10:57:17] DEBUG[398]: chan_pjsip.c:2935 chan_pjsip_session_end:
[Apr 2 10:57:17] DEBUG[493][C-00000004]: chan_pjsip.c:1627 chan_pjsip_indicate: PJSIP/102-00000007: Indicated Private Cause Code
[Apr 2 10:57:17] DEBUG[493][C-00000004]: chan_pjsip.c:1858 chan_pjsip_indicate: PJSIP/102-00000007
[Apr 2 10:57:17] DEBUG[388]: cdr.c:1499 cdr_object_finalize: Finalized CDR for PJSIP/102-00000007 - start 1680425837.881365 answer 0.000000 end 1680425837.922564 dur 0.041 bill 1680425837.922 dispo NO ANSWER
[Apr 2 10:57:17] DEBUG[493][C-00000004]: channel.c:2549 ast_hangup: Channel 0x7f16d00ada60 ‘PJSIP/103-00000008’ hanging up. Refs: 2
[Apr 2 10:57:17] DEBUG[493][C-00000004]: chan_pjsip.c:2546 chan_pjsip_hangup: PJSIP/103-00000008
[Apr 2 10:57:17] DEBUG[493][C-00000004]: chan_pjsip.c:2564 chan_pjsip_hangup: Cause: 488
[Apr 2 10:57:17] == Everyone is busy/congested at this time (1:0/0/1)
[Apr 2 10:57:17] DEBUG[493][C-00000004]: app_dial.c:1328 wait_for_answer: PJSIP/102-00000007: No outgoing channels available
[Apr 2 10:57:17] DEBUG[398]: chan_pjsip.c:2504 hangup: PJSIP/103-00000008
[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:3456 ast_sip_session_terminate: PJSIP/103-00000008 Response 488
[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:3528 ast_sip_session_terminate:
[Apr 2 10:57:17] DEBUG[398]: res_pjsip_session.c:2912 session_destructor: 103: Destroying SIP session
[Apr 2 10:57:17] DEBUG[398]: res_rtp_asterisk.c:2915 dtls_srtp_stop_timeout_timer: (0x7f16d00b3300) DTLS srtp - stopped timeout timer’

you can always search on asterisk community , you can find a lot of info there

https://community.asterisk.org/search?q=488

Hi,
I’m trying to set up the SIP card as described here: Card | SIP-HASS
However the card seems to be empty in the GUI after adding and configuring. It’s not even visible there, only during configuration.
image


Can someone give me some pointers to what to look for?
I tried to refresh, clear cahce, none helped…

My other issue is that when trying to configure the doorbell as described here: Doorbell | SIP-HASS
I created this file /asterisk/custom/pjsip_custom.conf
with content:

; Place your custom extensions here
[8001]
type = endpoint
context = default
disallow = all
allow = alaw,ulaw      	; Audio codecs
allow=h264             	; Video codecs
direct_media_method=invite
dtmf_mode=info
callerid="Doorbell" <8001>
force_rport=no
aors= 8001
auth = auth8001

[8001]
type = aor
max_contacts = 1

[auth8001]
type=auth
auth_type=userpass
password=xxxxxxxxx
username=8001


and also configured the VTO doorbell as described, but I see no sign that the config is parsed, nor the doorbell is registered.
Where shall it be visible?
Asterisk add-on + integration is installed.

[Apr 14 14:06:17]   == app_speech_utils.so => (Dialplan Speech Applications)
[Apr 14 14:06:17]  Loading res_pjsip_endpoint_identifier_anonymous.so.
[Apr 14 14:06:17]   == res_pjsip_endpoint_identifier_anonymous.so => (PJSIP Anonymous endpoint identifier)
[Apr 14 14:06:17]  Loading func_pjsip_contact.so.
[Apr 14 14:06:17]   == Registered custom function 'PJSIP_CONTACT'
[Apr 14 14:06:17]   == func_pjsip_contact.so => (Get information about a PJSIP contact)
[Apr 14 14:06:17]  Loading app_stasis.so.
[Apr 14 14:06:17]   == Registered application 'Stasis'
[Apr 14 14:06:17]   == app_stasis.so => (Stasis dialplan application)
[Apr 14 14:06:17]  Loading res_prometheus.so.
[Apr 14 14:06:17]   == res_prometheus.so => (Asterisk Prometheus Module)
[Apr 14 14:06:17]  Loading res_stasis_device_state.so.
[Apr 14 14:06:17]   == res_stasis_device_state.so => (Stasis application device state support)
[Apr 14 14:06:17]  Loading func_pjsip_endpoint.so.
[Apr 14 14:06:17]   == Registered custom function 'PJSIP_ENDPOINT'
[Apr 14 14:06:17]   == func_pjsip_endpoint.so => (Get information about a PJSIP endpoint)
[Apr 14 14:06:17]  Loading res_ari_asterisk.so.
[Apr 14 14:06:17]   == res_ari_asterisk.so => (RESTful API module - Asterisk resources)
[Apr 14 14:06:17]  Loading res_ari_sounds.so.
[Apr 14 14:06:17]   == res_ari_sounds.so => (RESTful API module - Sound resources)
[Apr 14 14:06:17]  Loading res_stasis_playback.so.
[Apr 14 14:06:17]   == res_stasis_playback.so => (Stasis application playback support)
[Apr 14 14:06:17]  Loading res_ari_events.so.
[Apr 14 14:06:17]   == WebSocket registered sub-protocol 'ari'
[Apr 14 14:06:17]   == res_ari_events.so => (RESTful API module - WebSocket resource)
[Apr 14 14:06:17]  Loading res_ari_recordings.so.
[Apr 14 14:06:17]   == res_ari_recordings.so => (RESTful API module - Recording resources)
[Apr 14 14:06:17]  Loading res_ari_endpoints.so.
[Apr 14 14:06:17]   == res_ari_endpoints.so => (RESTful API module - Endpoint resources)
[Apr 14 14:06:17]  Loading res_ari_applications.so.
[Apr 14 14:06:17]   == res_ari_applications.so => (RESTful API module - Stasis application resources)
[Apr 14 14:06:17]  Loading res_ari_channels.so.
[Apr 14 14:06:17]   == res_ari_channels.so => (RESTful API module - Channel resources)
[Apr 14 14:06:17]  Loading res_ari_device_states.so.
[Apr 14 14:06:17]   == res_ari_device_states.so => (RESTful API module - Device state resources)
[Apr 14 14:06:17]  Loading res_ari_bridges.so.
[Apr 14 14:06:17]   == res_ari_bridges.so => (RESTful API module - Bridge resources)
[Apr 14 14:06:17]  Loading res_ari_playbacks.so.
[Apr 14 14:06:17]   == res_ari_playbacks.so => (RESTful API module - Playback control resources)
[Apr 14 14:06:17]  Loading app_queue.so.
[Apr 14 14:06:17]   == Registered application 'Queue'
[Apr 14 14:06:17]   == Registered application 'AddQueueMember'
[Apr 14 14:06:17]   == Registered application 'RemoveQueueMember'
[Apr 14 14:06:17]   == Registered application 'PauseQueueMember'
[Apr 14 14:06:17]   == Registered application 'UnpauseQueueMember'
[Apr 14 14:06:17]   == Registered application 'QueueLog'
[Apr 14 14:06:17]   == Registered application 'QueueUpdate'
[Apr 14 14:06:17]   == Manager registered action QueueStatus
[Apr 14 14:06:17]   == Manager registered action QueueSummary
[Apr 14 14:06:17]   == Manager registered action QueueAdd
[Apr 14 14:06:17]   == Manager registered action QueueRemove
[Apr 14 14:06:17]   == Manager registered action QueuePause
[Apr 14 14:06:17]   == Manager registered action QueueLog
[Apr 14 14:06:17]   == Manager registered action QueuePenalty
[Apr 14 14:06:17]   == Manager registered action QueueMemberRingInUse
[Apr 14 14:06:17]   == Manager registered action QueueRule
[Apr 14 14:06:17]   == Manager registered action QueueReload
[Apr 14 14:06:17]   == Manager registered action QueueReset
[Apr 14 14:06:17]   == Manager registered action QueueChangePriorityCaller
[Apr 14 14:06:17]   == Manager registered action QueueWithdrawCaller
[Apr 14 14:06:17]   == Registered custom function 'QUEUE_VARIABLES'
[Apr 14 14:06:17]   == Registered custom function 'QUEUE_EXISTS'
[Apr 14 14:06:17]   == Registered custom function 'QUEUE_MEMBER'
[Apr 14 14:06:17]   == Registered custom function 'QUEUE_MEMBER_COUNT'
[Apr 14 14:06:17]   == Registered custom function 'QUEUE_MEMBER_LIST'
[Apr 14 14:06:17]   == Registered custom function 'QUEUE_GET_CHANNEL'
[Apr 14 14:06:17]   == Registered custom function 'QUEUE_WAITING_COUNT'
[Apr 14 14:06:17]   == Registered custom function 'QUEUE_MEMBER_PENALTY'
[Apr 14 14:06:17]   == app_queue.so => (True Call Queueing)
[Apr 14 14:06:17]  Loading res_manager_presencestate.so.
[Apr 14 14:06:17]   == Manager registered action PresenceStateList
[Apr 14 14:06:17]   == res_manager_presencestate.so => (Manager Presence State Topic Forwarder)
[Apr 14 14:06:17]  Loading res_manager_devicestate.so.
[Apr 14 14:06:17]   == Manager registered action DeviceStateList
[Apr 14 14:06:17]   == res_manager_devicestate.so => (Manager Device State Topic Forwarder)
[Apr 14 14:06:18] Asterisk Ready.

Actually item 2 above is not an issue, it was a dummy misconfiguration with an incorrect IP in the VTO doorbell.
So I successfully did a local call between a local linphone client and the VTO doorbell. Audio was working fine.

So now I just need to have it integrated to HA through the SIP card. I’d appreciate any help on that in my previous post.
And of course I need to make it work not just on the local LAN. that is still todo…

[Apr 14 14:33:08]   == Endpoint 100 is now Reachable
[Apr 14 14:39:23]     -- Added contact 'sip:[email protected]:5060' to AOR '8001' with expiration of 60 seconds
[Apr 14 14:39:23]   == Endpoint 8001 is now Reachable
[Apr 14 14:40:09]     -- Executing [9901@default:1] Dial("PJSIP/8001-00000003", "PJSIP/9901/sip:[email protected]:49722;transport=tcp") in new stack
[Apr 14 14:40:09]     -- Called PJSIP/9901/sip:[email protected]:49722;transport=tcp
[Apr 14 14:40:10]     -- PJSIP/9901-00000004 is ringing
[Apr 14 14:40:14]     -- PJSIP/9901-00000004 answered PJSIP/8001-00000003
[Apr 14 14:40:14]     -- Channel PJSIP/9901-00000004 joined 'simple_bridge' basic-bridge <05d96adf-ee1c-447f-b026-47c2371d24f0>
[Apr 14 14:40:14]     -- Channel PJSIP/8001-00000003 joined 'simple_bridge' basic-bridge <05d96adf-ee1c-447f-b026-47c2371d24f0>
[Apr 14 14:40:17]     -- Channel PJSIP/9901-00000004 left 'simple_bridge' basic-bridge <05d96adf-ee1c-447f-b026-47c2371d24f0>
[Apr 14 14:40:17]     -- Channel PJSIP/8001-00000003 left 'simple_bridge' basic-bridge <05d96adf-ee1c-447f-b026-47c2371d24f0>
[Apr 14 14:40:17]   == Spawn extension (default, 9901, 1) exited non-zero on 'PJSIP/8001-00000003'

Hey, a good starting point is this wiki , all explained, afterwards you should be good to go

Yes, that was followed. Still the SIP card doesn’t work, and can’t figure out why.
Can someone give me some pointers to what to look for?

Check the browser console when using the SIP card. And I suggest asking on the discord server (link at the bottom of the docs). I rarely check here.