Asterisk realtime: Wrong password

insert into sipfriends (permit, name, port, regseconds, defaultuser, host, type, context, secret, md5secret,transport, dtmfmode, directmedia, nat, allow, disallow, qualify, qualifyfreq, call-limit, dynamic,fromdomain)
VALUES(‘’, ‘106’, ‘5060’, 1800, ‘106’, ‘dynamic’,‘user’, ‘from-internal’, 1, MD5(‘1’) ,‘udp’, ‘rfc2833’, ‘yes’, ‘yes’, ‘alaw;ulaw’, ‘all’, ‘yes’, 60, 5, ‘yes’,‘test’);

from asterisk console:

Authorization: Digest username=“106”, realm=“asterisk”, nonce=“78afe95e”, uri=“sip:ip”, response=“a604053bf1782e43c1c85c4fb217495d”, algorithm=MD5

There is a lot of information missing here, but, assuming this is the response you got, and which was rejected, when using the configuration shown and a password, on the phone, of “1”:

  • it is impossible to verify it without knowing the real URI used, and sip:ip is not believable;
  • md5secret and secret are mutually exclusive (not having used ARA, I don’t know how you handle this, but I suspect one or the other is supposed to be null);
  • md5secret is the full HA1 hash from the digest algorithm, not just a hash of the password;
  • the only reason to include md5secret is so as not to include a simpler form of the password, so including the raw password in the database defeats its purpose.

i’m try add md5secret for testing only. Now i leave only one field (secret) and got

What does “sip show users” show?

Why aren’t you using pjsip?

grafana*CLI> sip show users
Username Secret Accountcode Def.Context ACL Forcerport

its strange, cause i have records in sipfriends table

I’d look for an error when trying to read the table.

looks like asterisk doesnt connect to database

i configure asterisk using script:

could you please advice about it? Maybe some misprint or idk

root of issue in absent libmysqlclient18 in newest debian.

now odbc connected:

ODBC DSN Settings

Name: asterisk
DSN: asterisk
Number of active connections: 1 (out of 1)

but i have number of warnings:
[Aug 17 13:24:59] WARNING[4154] config.c: Realtime mapping for ‘ps_contacts’ found to engine ‘odbc’, but the engine is not available


telephony*CLI> pjsip show endpoints
No objects found.


| id | transport | aors | auth | context | disallow | allow | direct_media |
| 101 | transport-udp | 101 | 101 | testing | all | g722 | no |
| 102 | transport-udp | 102 | 102 | testing | all | g722 | no |

could someone tell me what i should check next? Thank

connection to DB fixed, but i’ve still have error with wrong password. In mysql query log i see:

               227 Query    SELECT * FROM sip_buddies WHERE name = '103' AND host = 'dynamic'
               227 Init DB  asterisk
               227 Query    SELECT * FROM sip_buddies WHERE name = '103'

this request returs one record, so all good here. sip show users also doesnt return anything. When i can take a look more?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.