TECH7Fox / asterisk-hass-integration

Asterisk integration for Home Assistant
60 stars 14 forks source link

authentication failed #72

Closed tung256 closed 1 year ago

tung256 commented 1 year ago

hello. i am starting from scratch. there is no PBX server except the one i will install onto my HA machine. i was able to get the add-on up and running as seen here from the Add-On Store image in the Config tab, i put in my password: password123 image can it be any password or do i create another for user named "admin" in my HA machine? as of now, no user named "admin" for my HA machine. image

Asterrisk is ready but cant authenticate. please help. thanks!

image

TECH7Fox commented 1 year ago

Can you share your manager.conf in /config/asterisk/default/ Also make sure there is no manager.conf inside /config/asterisk/custom/

tung256 commented 1 year ago

Can you share your manager.conf in /config/asterisk/default/ Also make sure there is no manager.conf inside /config/asterisk/custom/

certainly. image

no files here image

TECH7Fox commented 1 year ago

Can you try password123 all lowercase? What did you set as IP in the integration? Use localhost or 127.0.0.1. The manager.conf only accepts that address by default. Since the add-on and integration normally runs on the same system.

tung256 commented 1 year ago

ok. im using password123 now image image integration now works with localhost. i was using the IP address of my HA machine before. image

this next part, i dont understand.... there are 2 users. tung on 2nd floor. linh on 1st floor. what secret should they be using? password123 OR the pw that they use to log into HA GUI? for now, i am using password123. image

the card does not appear once i added it: image

i did contrl+F5 on firefox do i really need DuckDNS for https? the tablets will be used to call each other in the house, i dont plan to call remotely from outside the house.

tung256 commented 1 year ago

Integration has no error now but these shows as offline?
image

image

image

TECH7Fox commented 1 year ago

what secret should they be using? password123 OR the pw that they use to log into HA GUI?

The auto_add_secret, so in your case password123.

do i really need DuckDNS for https?

Browsers requires SSL for a WSS connection. Easiest is to setup a duckdns, but you could also create a self-signed certificate and add a DNS rewrite to match the domain.

But you can temporary accept the certificate by going to https://ha_ip:8089/ws and clicking continue.

the card does not appear once i added it

Check the console (F12) for any errors on the card.

BigHomie90 commented 1 year ago

Same issue here...Everything was working fine till 1 or 2 previous addon updates... authentication failed for extensions and integration shows asterisk server offline.

BigHomie90 commented 1 year ago

omg...sorry..i double checked the changelog.

`3.0.0 Breaking Changes We changed the way we handle the Asterisk config files and this will require a manual action on your side. Now, Asterisk files you intend to modify should be placed under /config/asterisk/custom. For example, if you were previously editing extensions.conf, you should move it from /config/asterisk/extensions.conf to /config/asterisk/custom/extensions.conf.

After moving all the files you need to /config/asterisk/custom, you can also cleanup the /config/asterisk folder by deleting everything under it, except for the custom folder.`

Everything working fine again.

tung256 commented 1 year ago

i tried https://192.168.1.229:8089/ws and accepted the risk when the warning came up. next, i got this image

here is my card: image

and this is the console error you requested: console error.txt

TECH7Fox commented 1 year ago

Are your persons correct? Try using the config editor.

tung256 commented 1 year ago

ok. im happy to say i got HTTPS working locally now as seen here. self signed certificate instruction from this site image

these are the 2 persons for the 2 tablets: person.tablet_1st person.tablet_2nd_2 they are loaded in now after taking your advice: image

when i click on Call on the white tablet, nothing happens as seen here image

really appreciate your help. feeling so close to getting it done thanks to your time n patience too!

TECH7Fox commented 1 year ago

The card gives a "Person and backup not configured" error. Meaning that you don't have a extension with the currently logged in person configured. What is your card config? Did you set the correct persons?

tung256 commented 1 year ago

i am sorry, i do not understand. this is my code for the card image

it is the only place i assign the person entity to its extension. person.tung
extension: '101'

person.tablet_1st extension: '102'

person: person.tablet_2nd_2 extension: '103'

are you saying there are other places to assign person and extension? if so, where? this is what i see in my Integration. strange that extension for 103 does not exist here.

image

and when i click on the devices, this is what i see: image

image

TECH7Fox commented 1 year ago

You only have to set the persons in the card. But I think you aren't using those users or mistyped the users.

Make sure your current user is linked to that actual person, and that the person ID is correctly set in the card. You can use the editor to set the correct person ID.

TECH7Fox commented 1 year ago

I think someone else had a problem that the user wasn't actually linked to the person because of the way he made the person separately.

tung256 commented 1 year ago

ok. i removed the person and added back. person is working good now. no more person and backup error. :) i still cannot make any call though. when i place call, it auto terminate instantly. F12 reveals this: image

192.168.1.227 is my desktop IP that is initiating the call from Firefox browser. 192.168.1.106 is the tablet IP that is receiving the call but i dont see it in the F12 log. also, i dont recognize any of the other IP address.

TECH7Fox commented 1 year ago

It says the fail fails on the remote. Guessing your tablet is having a issue with the mic access. Do you use the HA companion app?

Maybe try desktop to desktop first and see if that works.

tung256 commented 1 year ago

yes, i use the HA companion app. also tried using desktop to desktop as you suggested.

im having doubts about how a person is assigned an extension. could you pls clarify?

if i define all the extensions here: image

then do i turn off Auto Extension here? image

im using local self sign certificate, not duckddns. do i still put a check mark for Asterisk or disable it as seen here? image

TECH7Fox commented 1 year ago

Keep "generate SSL certificate" disabled. And turn on the 'auto add extensions" options.

The card choses the extension based on the current logged in user. It chooses the extension with the person that is for the current user.

You can look at the config/asterisk/default/pjsip_default.conf file for the generated extensions.

TECH7Fox commented 1 year ago

Btw, I recommend asking on the Discord server. There are examples and more people there to help. Link is underneath the docs website.

TECH7Fox commented 1 year ago

Closing for now. Let me know if your still having a issue.