How to RSA Keys for IAX2 and DUNDi

After upgrading to Asterisk 22 on Debian ‘sid’ I am having troubles with RSA keys.

I created the keys with astgenkey -n copied them to /var/lib/asterisk/keys, made sure they have correct ownership and permissions.

Double checked the manpage and documentation, restarted asterisk

Sill ‘show keys’ does not show any keys.

Any hints what I could be doing wrong?

Found solution. Manpage (and many other documentation) is wrong about the key location.

On Saturday 03 January 2026 at 14:42:46, hb9eue via Asterisk Community wrote:

After upgrading to Asterisk 22 on Debian ‘sid’ I am having troubles with
RSA keys.

On Saturday 03 January 2026 at 15:30:14, hb9eue via Asterisk Community wrote:

Found solution. Manpage (and many other documentation) is wrong about the
key location.

I would say that this is connected to the word “Debian” above.

Debian often puts files (not only for Asterisk, but many other applications
too) where Debian wants them to be, which is not necessarily the same as
where the application developers thought they should be.

It all works, each system is self-consistent, but they’re not directly
compatible.

Antony.


Software development can be quick, high quality, or low cost.

The customer gets to pick any two out of three.

Hi there

Try to find a config statement which sets the location for your keys. That way you can out them wherever you want. I have mine in /etc/asterisk/.

Regards,
Rob

Thank you, I also submitted a debian bugreport about this and learned this is configurable, but strange is:

asterisk.conf => astkeydir points to /var/lib/asterisk/ - but still keys are loaded from /usr/share/asterisk/keys/ maybe this config value should point to /var/lib/asterisk/keys/ ?

-Benoît-

What is the actual complete contents of asterisk.conf? By default it’s a template, which means it is not actually loaded.

Indeed, it is a template:

[directories](!)
astcachedir => /var/cache/asterisk
astetcdir => /etc/asterisk
astmoddir => /usr/lib/x86_64-linux-gnu/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /usr/share/asterisk
astagidir => /usr/share/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astsbindir => /usr/sbin

And it is not applied to any other [section](directories)

This seems to be the debian specific patch to alter the directory: