IAX Realtime + Registration

Hi

I am trying to setup IAX realtime table but IAX isn’t loading the values I enter to the database:

extconfig.conf
iaxusers => odbc,asterisk,iax
iaxpeers => odbc,asterisk,iax

MySQL database structure:
CREATE TABLE IF NOT EXISTS iax (
name varchar(40) NOT NULL DEFAULT ‘’,
type varchar(10) NOT NULL DEFAULT ‘friend’,
username varchar(40) DEFAULT NULL,
mailbox varchar(40) DEFAULT NULL,
secret varchar(40) DEFAULT NULL,
dbsecret varchar(40) DEFAULT NULL,
context varchar(40) DEFAULT NULL,
regcontext varchar(40) DEFAULT NULL,
host varchar(40) DEFAULT ‘dynamic’,
ipaddr varchar(20) DEFAULT NULL,
port int(5) DEFAULT NULL,
defaultip varchar(20) DEFAULT NULL,
sourceaddress varchar(20) DEFAULT NULL,
mask varchar(20) DEFAULT NULL,
regexten varchar(40) DEFAULT NULL,
regseconds int(11) DEFAULT NULL,
accountcode varchar(20) DEFAULT NULL,
mohinterpret varchar(20) DEFAULT NULL,
mohsuggest varchar(20) DEFAULT NULL,
inkeys varchar(40) DEFAULT NULL,
outkey varchar(40) DEFAULT NULL,
language varchar(10) DEFAULT NULL,
callerid varchar(100) DEFAULT NULL,
cid_number varchar(40) DEFAULT NULL,
sendani varchar(10) DEFAULT NULL,
fullname varchar(40) DEFAULT NULL,
trunk varchar(3) DEFAULT NULL,
auth varchar(20) DEFAULT NULL,
maxauthreq varchar(5) DEFAULT NULL,
requirecalltoken varchar(4) DEFAULT NULL,
encryption varchar(20) DEFAULT NULL,
transfer varchar(10) DEFAULT NULL,
jitterbuffer varchar(3) DEFAULT NULL,
forcejitterbuffer varchar(3) DEFAULT NULL,
disallow varchar(40) DEFAULT NULL,
allow varchar(40) DEFAULT NULL,
codecpriority varchar(40) DEFAULT NULL,
qualify varchar(10) DEFAULT NULL,
qualifysmoothing varchar(10) DEFAULT NULL,
qualifyfreqok varchar(10) DEFAULT NULL,
qualifyfreqnotok varchar(10) DEFAULT NULL,
timezone varchar(20) DEFAULT NULL,
adsi varchar(10) DEFAULT NULL,
amaflags varchar(20) DEFAULT NULL,
setvar varchar(200) DEFAULT NULL,
PRIMARY KEY (name),
KEY name (name,host),
KEY name2 (name,ipaddr,port),
KEY ipaddr (ipaddr,port),
KEY host (host,port)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

MySQL Database entry:
INSERT INTO iax VALUES (‘dbstest’,‘friend’,‘dbstest’,NULL,‘fqlaskjjdgf827382’,NULL,‘external’,NULL,‘169.255.228.100’,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,‘yes’,NULL,NULL,NULL,NULL,NULL,NULL,NULL,‘all’,‘g729:20’,NULL,‘yes’,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

I then do a “core reload”

Reloading IAX only gives me the following error:
iax2 reload
[2018-02-22 11:05:51] NOTICE[25033]: iax2/provision.c:562 iax_provision_reload: No IAX provisioning configuration found, IAX provisioning disabled.

Secondly, any suggestions on how to register the trunk to my provider: exp
register => username:password@10.10.10.100

Regards

From what I remember the database entries don’t appear in any of the CLI commands for inspecting and a reload doesn’t pull them. They get queried when used. As for outbound registration I believe you still have to do it from iax.conf

Makes sense, I did some testing and it does seam to pull the information from the Database once a call is made via the trunk.

I have also added my registration string to iax.conf
register => username:password@10.10.10.100
but still nothing in CLI.

Iax2 show peers
Name/Username Host Mask Port Status Description
0 iax2 peers [0 online, 0 offline, 0 unmonitored]

Iax2 show registry
Host dnsmgr Username Perceived Refresh State
0 IAX2 registrations.

I am then going on the assumption that using realtime IAX for trunks and monitoring of trunks aren’t ideal?

Regards

Did you place the register under the general section?

If you enable caching using the “rtcachefriends” option then qualify would work, but you’d have to reload if changes were made to any cached things.

Yes I did, I have also added rtcachefriends=yes to it.

cat /etc/asterisk/iax.conf
[general]
bindport = 4569
bindaddr = 0.0.0.0
disallow = all
allow = alaw,ulaw,gsm,g729
tos = 0xb8
videosupport = no
transfer = no
delayreject = yes
trunktimestamps = yes
calltokenoptional = 0.0.0.0/0.0.0.0
rtcachefriends=yes

register => username:password@10.10.10.100

After a “core reload” still nothing displays in “iax2 show peers”

They won’t show up in iax2 show peers until used. They get pulled from the database and then cached at that time.

I haven’t used IAX2 in years so I don’t really have anything else to add on why the register line wouldn’t be working and show up.

Thanks for the help. I will keep working on it.

If all else fail, I will just create a script to generate the iax.conf file and not use realtime IAX.

I have successfully made an outgoing call from my realtime IAX trunk, so realtime is working. However the IAX trunk isn’t registering to my provider and they can’t send calls to me.