Раньше я его серьезно никогда не использовал.
Настроил тестовую систему:
Assterisk 11.2-cert1
mysql+odbc
создал таблицу для пиров, добавил 2 записи.
Настройки реалтайма в Asterisk:
rtcachefriends=yes
rtsavesysname=yes
В общем случае все работает нормально. При подключении SIP-клиента идет запрос в базу и получением информации о пире. Она кэшируется и отображается в sip show peers:
Код: Выделить всё
> sip show peers
Name/username Host Dyn Forcerport ACL Port Status Description Realtime
101/101 172.16.1.12 D a 5060 OK (12 ms) Cached RT
102/102 172.16.1.10 D a 5060 OK (13 ms) Cached RT
2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline]
Код: Выделить всё
[Jul 8 08:15:43] == Using SIP RTP CoS mark 5
[Jul 8 08:15:43] -- Executing [102@contoso_int:1] Dial("SIP/101-00000031", "SIP/102") in new stack
[Jul 8 08:15:43] WARNING[23433][C-0000001d]: chan_sip.c:6154 create_addr: Purely numeric hostname (102), and not a peer--rejecting!
[Jul 8 08:15:43] WARNING[23433][C-0000001d]: app_dial.c:2437 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
[Jul 8 08:15:43] == Everyone is busy/congested at this time (1:0/0/1)
[Jul 8 08:15:43] -- Auto fallthrough, channel 'SIP/101-00000031' status is 'CHANUNAVAIL'
Вот лог запросов:
Код: Выделить всё
130708 8:37:13 50 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
50 Query SELECT * FROM rt_sip_peers WHERE name = '101' AND host = 'dynamic'
50 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
50 Query SELECT * FROM rt_sip_peers WHERE host = '172.16.1.12' AND port = '5060' AND callbackextension = '102'
50 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
50 Query SELECT * FROM rt_sip_peers WHERE host = '172.16.1.12' AND port = '5060'
50 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
50 Query SELECT * FROM rt_sip_peers WHERE ipaddr = '172.16.1.12' AND port = '5060'
50 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
50 Query SELECT * FROM rt_sip_peers WHERE name = '102' AND host = 'dynamic'
50 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
50 Query SELECT * FROM rt_sip_peers WHERE name = '101' AND host = 'dynamic'
50 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
50 Query SELECT * FROM rt_sip_peers WHERE host = '172.16.1.12' AND port = '5060' AND callbackextension = '102'
50 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
50 Query SELECT * FROM rt_sip_peers WHERE host = '172.16.1.12' AND port = '5060'
50 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
50 Query SELECT * FROM rt_sip_peers WHERE ipaddr = '172.16.1.12' AND port = '5060'
50 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
50 Query SELECT * FROM rt_sip_peers WHERE name = '102' AND host = 'dynamic'
50 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
50 Query SELECT * FROM rt_sip_peers WHERE name = '102' AND host = 'dynamic'
А вот если принудительно стереть кэш для 102 командой sip prune, то он снова нормально подгружается из базы при необходимости.
Что делать, кто виноват?