TECH7Fox / sip-hass-card

A SIP client inside home assistant!
MIT License
186 stars 40 forks source link

Person and backup not configured! #123

Closed Whytey closed 4 months ago

Whytey commented 4 months ago

I am logged in as user david. I have added a SIP card for myself which registers against my persons endpoint. I have megan listed as a secondary person, so I can call her endpoint. Works fine.

image image

I was trying to create a new view with a SIP card for megan. She would be the first person in the endpoints list. I logged into HA in an incognito tab as her to attempt this but I keep getting an error from the card that 'Person and backup not configured!'

image image

We can see that the endpoints are created by the add-on:

[100](sipjs-phone-aor)
[100](sipjs-phone-auth)
username=100
[100](sipjs-phone-endpoint)
aors=100
auth=100
callerid="David" <100>

[101](sipjs-phone-aor)
[101](sipjs-phone-auth)
username=101
[101](sipjs-phone-endpoint)
aors=101
auth=101
callerid="Megan" <101>

We can see the person entity does exist: image

The relevant code:

    async connect() {
        this.timerElement = "00:00";
        if (this.user == undefined) {
            if (this.config.backup_extension !== undefined) {
                this.user = {
                    name: this.config.backup_name,
                    extension: this.config.backup_extension,
                    secret: this.config.backup_secret
                };
            } else {
                this.error = {
                    title: "Person and backup not configured!",
                    message: "There is no extension configured for this person, and no backup extension configured. Please configure one of them."
                }
                this.requestUpdate();
                throw new Error("Person and backup not configured!");
            }
        }
Whytey commented 4 months ago

Also, I don't understand why we would put multiple persons in the config. Wouldn't we indicate which person we want the card to register as and then just have a list of the endpoints we want to be able to call?

Whytey commented 4 months ago

Cancel all that. I just realised somehow the megan user and the megan person had become disconnected within Home Assistant such that the person was not flagged as being able to login. I resolved that and now I actually see the purpose of having multiple extensions listed.