Asterisk realtime IAX "No authority found" error

Hello everybody.
I have two asterisk v13.2 on CentOS7 x64 - pbxA and pbxB on IpA and IpB. And trying to connect them by IAX2.
Then I use IAX endpoints configuration from iax.conf all calls going well.

This is my working iax.conf file from pbxA

bindport=4569
delayreject=yes
bandwidth=medium
allow=all
jitterbuffer=no
authdebug = yes
autokill=yes
qualify=5000
rtcachefriends=yes
rtsavesysname=yes
rtupdate=yes
rtautoclear=yes

[pbxBin]
type=user
deny=0.0.0.0/0.0.0.0
permit=ip address of pbxB
login=pbxB
secret=12345
context=localuser

[pbxBout]
type=peer
host=ip address of pbxB
login=pbxA
secret=98765
trunc=yes
qualify=yes
context=localuser

And this is my working iax.conf file from pbxB

bindport=4569
delayreject=yes
bandwidth=medium
allow=all
jitterbuffer=no
authdebug = yes
autokill=yes
qualify=5000
rtcachefriends=yes
rtsavesysname=yes
rtupdate=yes
rtautoclear=yes

[pbxAin]
type=user
deny=0.0.0.0/0.0.0.0
permit=ip address of pbxA
login=pbxA
secret=98765
context=localuser

[pbxAout]
type=peer
host=ip address of pbxA
login=pbxA
secret=98765
context=localuser

In this configuration all calls (from pbxA to pbB and from pbxB to pbxA) going well.
But I want to place IAX endpoints configuration to realtime database, because in future there will be network of such endpoints, and I want to add connection between then by simple inserting additional rows in database table.
So, for test on pbxA I create postgres v9.4 database with table iaxfriends

CREATE TABLE iaxfriends
(
  id serial NOT NULL,
  name character varying(40) NOT NULL,
  type type_values,
  host character varying(40),
  mask character varying(20),
  login character varying(40),
  secret character varying(40),
  auth character varying(20),
  trunk yesno_values,
  qualify character varying(10),
  context character varying(40),
  dbsecret character varying(40),
  regcontext character varying(40),
  ipaddr character varying(40),
  port character varying(7),
  deny character varying(95),
  permit character varying(95),
  defaultip character varying(20),
  sourceaddress character varying(20),
  regexten character varying(40),
  regseconds character varying(20),
  accountcode character varying(20),
  mohinterpret character varying(20),
  mohsuggest character varying(20),
  inkeys character varying(40),
  outkeys character varying(40),
  language character varying(10),
  callerid character varying(100),
  cid_number character varying(40),
  sendani yesno_values,
  fullname character varying(40),
  maxauthreq integer,
  requirecalltoken iax_requirecalltoken_values,
  encryption iax_encryption_values,
  transfer iax_transfer_values,
  jitterbuffer yesno_values,
  forcejitterbuffer yesno_values,
  disallow character varying(200),
  allow character varying(200),
  codecpriority character varying(40),
  qualifysmoothing yesno_values,
  qualifyfreqok character varying(10),
  qualifyfreqnotok character varying(10),
  timezone character varying(20),
  adsi yesno_values,
  amaflags character varying(20),
  setvar character varying(200),
  CONSTRAINT iaxfriends_pkey PRIMARY KEY (id),
  CONSTRAINT iaxfriends_name_key UNIQUE (name)
)

After that I connect this database to Astersik through ODBC

extconfig.conf file:
[settings]
iaxusers => odbc,pgsql,iaxfriends
iaxpeers => odbc,pgsql,iaxfriends

res_odbc.conf file:

[pgsql]
enabled => yes
dsn => odbcPgSql
username => asterisk
password => 12345
pre-connect => yes
sanitysql => select 1
share_connections => yes

Then insert in database table row with values exactly like in section [pbxBin] of iax.conf file on pbxA

INSERT INTO iaxfriends(name, type, deny, permit, login, secret, context)
VALUES ('pbxBin', 'user', '0.0.0.0/0.0.0.0', ip address of pbxB, 'pbxB', '12345', 'localuser');

And comment section [pbxBin] of iax.conf file on pbxA with all settings in this section.

But now, then I try to make a call from pbxB to pbxA I get message “Rejected connect attempt from IpPbxB:4569, who was trying to reach ‘57200@’” on pbxA

[Apr  1 19:46:17] DEBUG[16059][C-00000004]: chan_iax2.c:2634 peercnt_add: ip callno count incremented to 1 for IpPbxA
[Apr  1 19:46:17] DEBUG[16059][C-00000004]: chan_iax2.c:3171 __find_callno: Creating new call structure 6924
[Apr  1 19:46:17] DEBUG[16059][C-00000004]: rtp_engine.c:1154 ast_rtp_instance_early_bridge_make_compatible: Can't find native functions for channel 'IAX2/pbxAout-6924'
[Apr  1 19:46:17] DEBUG[16059][C-00000004]: chan_iax2.c:5228 iax2_call: OSP token is undefined
    -- Called IAX2/pbxAout/57200
Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
   Timestamp: 00013ms  SCall: 06924  DCall: 00000 IpPbxA:4569
   VERSION         : 2
   CALLED NUMBER   : 57200
   CODEC_PREFS     : (g729|g726|g726aal2|adpcm|gsm|ilbc|speex|lpc10|g723|ulaw|alaw|slin|slin16|speex16|g722|siren7|siren14|testlaw|g719|opus|jpeg|png|h261|h263|h263p|h264|mpeg4|vp8|t140|red)
   CALLING NUMBER  : 57201
   CALLING PRESNTN : 0
   CALLING TYPEOFN : 0
   CALLING TRANSIT : 0
   CALLING NAME    : 57201
   LANGUAGE        : en
   FORMAT          : 256
   FORMAT2         : g729
   CAPABILITY      : 218103807
   CAPABILITY2     : Unknown
   ADSICPE         : 2
   DATE TIME       : 2015-04-01  19:46:16

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: CTOKEN
   Timestamp: 00013ms  SCall: 00001  DCall: 06924 172.17.0.5:4569
   CALLTOKEN       : 51 bytes

[Apr  1 19:46:17] DEBUG[15516][C-00000004]: chan_iax2.c:10329 socket_process_helper: Received packet 0, (6, 40)
[Apr  1 19:46:17] DEBUG[15516][C-00000004]: chan_iax2.c:10426 socket_process_helper: Cancelling transmission of packet 0
[Apr  1 19:46:17] DEBUG[15516][C-00000004]: chan_iax2.c:10600 socket_process_helper: IAX subclass 40 received
[Apr  1 19:46:17] DEBUG[15516][C-00000004]: chan_iax2.c:10609 socket_process_helper: For call=6924, set last=13
Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
   Timestamp: 00015ms  SCall: 06924  DCall: 00000 IpPbxA:4569
   VERSION         : 2
   CALLED NUMBER   : 57200
   CODEC_PREFS     : (g729|g726|g726aal2|adpcm|gsm|ilbc|speex|lpc10|g723|ulaw|alaw|slin|slin16|speex16|g722|siren7|siren14|testlaw|g719|opus|jpeg|png|h261|h263|h263p|h264|mpeg4|vp8|t140|red)
   CALLING NUMBER  : 57201
   CALLING PRESNTN : 0
   CALLING TYPEOFN : 0
   CALLING TRANSIT : 0
   CALLING NAME    : 57201
   LANGUAGE        : en
   FORMAT          : 256
   FORMAT2         : g729
   CAPABILITY      : 218103807
   CAPABILITY2     : Unknown
   ADSICPE         : 2
   DATE TIME       : 2015-04-01  19:46:16
   CALLTOKEN       : 51 bytes

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: ACK
   Timestamp: 00015ms  SCall: 01842  DCall: 06924 IpPbxA:4569
[Apr  1 19:46:17] DEBUG[15517][C-00000004]: chan_iax2.c:10329 socket_process_helper: Received packet 0, (6, 4)
[Apr  1 19:46:17] DEBUG[15517][C-00000004]: chan_iax2.c:10426 socket_process_helper: Cancelling transmission of packet 0
[Apr  1 19:46:17] DEBUG[15517][C-00000004]: chan_iax2.c:10600 socket_process_helper: IAX subclass 4 received
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: REJECT
   Timestamp: 01002ms  SCall: 01842  DCall: 06924 IpPbxA:4569
   CAUSE           : No authority found
   CAUSE CODE      : 50

[Apr  1 19:46:18] DEBUG[15518][C-00000004]: chan_iax2.c:10329 socket_process_helper: Received packet 0, (6, 6)
[Apr  1 19:46:18] DEBUG[15518][C-00000004]: chan_iax2.c:10600 socket_process_helper: IAX subclass 6 received
[Apr  1 19:46:18] DEBUG[15518][C-00000004]: chan_iax2.c:10609 socket_process_helper: For call=6924, set last=1002
[Apr  1 19:46:18] WARNING[15518][C-00000004]: chan_iax2.c:10945 socket_process_helper: Call rejected by IpPbxA:4569: No authority found
[Apr  1 19:46:18] DEBUG[15518][C-00000004]: chan_iax2.c:10949 socket_process_helper: Immediately destroying 6924, having received reject
Tx-Frame Retry[-01] -- OSeqno: 001 ISeqno: 001 Type: IAX     Subclass: ACK
   Timestamp: 01002ms  SCall: 06924  DCall: 01842 IpPbxA:4569
[Apr  1 19:46:18] DEBUG[16059][C-00000004]: channel.c:2699 ast_hangup: Hanging up channel 'IAX2/pbxAout-6924'
[Apr  1 19:46:18] DEBUG[16059][C-00000004]: chan_iax2.c:5269 iax2_hangup: We're hanging up IAX2/pbxAout-6924 now...
    -- Hungup 'IAX2/pbxAout-6924'
  == Everyone is busy/congested at this time (1:0/0/1)

and error “Call rejected by IpPbxA:4569: No authority found” on pbxB

[Apr  1 19:46:17] DEBUG[16059][C-00000004]: chan_iax2.c:2634 peercnt_add: ip callno count incremented to 1 for IpPbxA
[Apr  1 19:46:17] DEBUG[16059][C-00000004]: chan_iax2.c:3171 __find_callno: Creating new call structure 6924
[Apr  1 19:46:17] DEBUG[16059][C-00000004]: rtp_engine.c:1154 ast_rtp_instance_early_bridge_make_compatible: Can't find native functions for channel 'IAX2/pbxAout-6924'
[Apr  1 19:46:17] DEBUG[16059][C-00000004]: chan_iax2.c:5228 iax2_call: OSP token is undefined
    -- Called IAX2/pbxAout/57200
Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
   Timestamp: 00013ms  SCall: 06924  DCall: 00000 IpPbxA:4569
   VERSION         : 2
   CALLED NUMBER   : 57200
   CODEC_PREFS     : (g729|g726|g726aal2|adpcm|gsm|ilbc|speex|lpc10|g723|ulaw|alaw|slin|slin16|speex16|g722|siren7|siren14|testlaw|g719|opus|jpeg|png|h261|h263|h263p|h264|mpeg4|vp8|t140|red)
   CALLING NUMBER  : 57201
   CALLING PRESNTN : 0
   CALLING TYPEOFN : 0
   CALLING TRANSIT : 0
   CALLING NAME    : 57201
   LANGUAGE        : en
   FORMAT          : 256
   FORMAT2         : g729
   CAPABILITY      : 218103807
   CAPABILITY2     : Unknown
   ADSICPE         : 2
   DATE TIME       : 2015-04-01  19:46:16

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: CTOKEN
   Timestamp: 00013ms  SCall: 00001  DCall: 06924 172.17.0.5:4569
   CALLTOKEN       : 51 bytes

[Apr  1 19:46:17] DEBUG[15516][C-00000004]: chan_iax2.c:10329 socket_process_helper: Received packet 0, (6, 40)
[Apr  1 19:46:17] DEBUG[15516][C-00000004]: chan_iax2.c:10426 socket_process_helper: Cancelling transmission of packet 0
[Apr  1 19:46:17] DEBUG[15516][C-00000004]: chan_iax2.c:10600 socket_process_helper: IAX subclass 40 received
[Apr  1 19:46:17] DEBUG[15516][C-00000004]: chan_iax2.c:10609 socket_process_helper: For call=6924, set last=13
Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
   Timestamp: 00015ms  SCall: 06924  DCall: 00000 IpPbxA:4569
   VERSION         : 2
   CALLED NUMBER   : 57200
   CODEC_PREFS     : (g729|g726|g726aal2|adpcm|gsm|ilbc|speex|lpc10|g723|ulaw|alaw|slin|slin16|speex16|g722|siren7|siren14|testlaw|g719|opus|jpeg|png|h261|h263|h263p|h264|mpeg4|vp8|t140|red)
   CALLING NUMBER  : 57201
   CALLING PRESNTN : 0
   CALLING TYPEOFN : 0
   CALLING TRANSIT : 0
   CALLING NAME    : 57201
   LANGUAGE        : en
   FORMAT          : 256
   FORMAT2         : g729
   CAPABILITY      : 218103807
   CAPABILITY2     : Unknown
   ADSICPE         : 2
   DATE TIME       : 2015-04-01  19:46:16
   CALLTOKEN       : 51 bytes

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: ACK
   Timestamp: 00015ms  SCall: 01842  DCall: 06924 IpPbxA:4569
[Apr  1 19:46:17] DEBUG[15517][C-00000004]: chan_iax2.c:10329 socket_process_helper: Received packet 0, (6, 4)
[Apr  1 19:46:17] DEBUG[15517][C-00000004]: chan_iax2.c:10426 socket_process_helper: Cancelling transmission of packet 0
[Apr  1 19:46:17] DEBUG[15517][C-00000004]: chan_iax2.c:10600 socket_process_helper: IAX subclass 4 received
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: REJECT
   Timestamp: 01002ms  SCall: 01842  DCall: 06924 IpPbxA:4569
   CAUSE           : No authority found
   CAUSE CODE      : 50

[Apr  1 19:46:18] DEBUG[15518][C-00000004]: chan_iax2.c:10329 socket_process_helper: Received packet 0, (6, 6)
[Apr  1 19:46:18] DEBUG[15518][C-00000004]: chan_iax2.c:10600 socket_process_helper: IAX subclass 6 received
[Apr  1 19:46:18] DEBUG[15518][C-00000004]: chan_iax2.c:10609 socket_process_helper: For call=6924, set last=1002
[Apr  1 19:46:18] WARNING[15518][C-00000004]: chan_iax2.c:10945 socket_process_helper: Call rejected by IpPbxA:4569: No authority found
[Apr  1 19:46:18] DEBUG[15518][C-00000004]: chan_iax2.c:10949 socket_process_helper: Immediately destroying 6924, having received reject
Tx-Frame Retry[-01] -- OSeqno: 001 ISeqno: 001 Type: IAX     Subclass: ACK
   Timestamp: 01002ms  SCall: 06924  DCall: 01842 IpPbxA:4569
[Apr  1 19:46:18] DEBUG[16059][C-00000004]: channel.c:2699 ast_hangup: Hanging up channel 'IAX2/pbxAout-6924'
[Apr  1 19:46:18] DEBUG[16059][C-00000004]: chan_iax2.c:5269 iax2_hangup: We're hanging up IAX2/pbxAout-6924 now...
    -- Hungup 'IAX2/pbxAout-6924'
  == Everyone is busy/congested at this time (1:0/0/1)

Can anyone give me a clue why iax connection works with configuration of endpoints from iax.conf file, but don’t work with same configuration from database.

P.S. I’am sure that asterisk have odbc connection to database, because IP phones are connected to asterisk through real-time pjsip auth on the same database.