Re: Realime extension patterns
zzuz: core set debug 99
читаем и получаем ответы.
В том то и дело, что ответ не получаем...
Коллеги, кто работает с Realtime extensions, сделайте пожалуйста тест и вышлите результат?
Повторюсь, у меня простая табличка для теста:
SQL> select CONTEXT, EXTEN, PRIORITY, APP, APPDATA
2 from asterisk.extensions
3 where EXTEN like '%X%' or EXTEN='100' or EXTEN='h'
4 order by EXTEN, PRIORITY
5 /
CONTEXT EXTEN PRIORITY APP APPDATA
------- ----- ---------- ---------- ----------
talknet 100 1 Answer
talknet 100 2 SayNumber 100
talknet 100 3 Hangup
talknet _2XX 1 Answer
talknet _2XX 2 SayNumber 200
talknet _2XX 3 Hangup
talknet h 1 Hangup
7 rows selected.
Набирая exten 100 с sip телефона, * выполняет SayNumber(100) и тут все OK,
вопросов нет...
а вот exten 200 или любой другой типа 2XX, возвращает ошибку
... rejected because extension not found.
лог звонка "100":
[...]
[Mar 24 17:54:16] DEBUG[16223]: chan_sip.c:20030 handle_request_invite: Checking SIP call limits for device 1022
[Mar 24 17:54:16] DEBUG[16223]: chan_sip.c:5641 update_call_counter: Updating call counter for incoming call
[Mar 24 17:54:16] DEBUG[16223]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:16] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = '100'
[Mar 24 17:54:16] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:16] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '1'
[Mar 24 17:54:16] DEBUG[16223]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
[Mar 24 17:54:16] DEBUG[16223]: chan_sip.c:6657 sip_new: *** Our native formats are 0x4 (ulaw)
[Mar 24 17:54:16] DEBUG[16223]: chan_sip.c:6658 sip_new: *** Joint capabilities are 0xe (gsm|ulaw|alaw)
[Mar 24 17:54:16] DEBUG[16223]: chan_sip.c:6659 sip_new: *** Our capabilities are 0x10e (gsm|ulaw|alaw|g729)
[Mar 24 17:54:16] DEBUG[16223]: chan_sip.c:6660 sip_new: *** AST_CODEC_CHOOSE formats are 0x4 (ulaw)
[Mar 24 17:54:16] DEBUG[16223]: chan_sip.c:6690 sip_new: This channel will not be able to handle video.
[Mar 24 17:54:16] DEBUG[16223]: chan_sip.c:12518 build_route: build_route: Contact hop: <sip:1022@192.168.200.186:18999>
[Mar 24 17:54:16] DEBUG[16223]: chan_sip.c:20289 handle_request_invite: SIP/1022-00000001: New call is still down.... Trying...
[Mar 24 17:54:16] DEBUG[16223]: chan_sip.c:3557 __sip_xmit: Trying to put 'SIP/2.0 100' onto UDP socket destined for 192.168.200.186:18999
[Mar 24 17:54:16] DEBUG[16213]: devicestate.c:342 _ast_device_state: No provider found, checking channel drivers for SIP - 1022
[Mar 24 17:54:16] DEBUG[16213]: chan_sip.c:23000 sip_devicestate: Checking device state for peer 1022
[Mar 24 17:54:16] DEBUG[16213]: devicestate.c:460 do_state_change: Changing state for SIP/1022 - state 1 (Not in use)
[Mar 24 17:54:16] DEBUG[16213]: devicestate.c:440 devstate_event: device 'SIP/1022' state '1'
[Mar 24 17:54:16] DEBUG[16222]: app_queue.c:1084 handle_statechange: Device 'SIP/1022' changed to state '1' (Not in use) but we don't care because they're not a member of any queue.
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = '100'
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '1'
[Mar 24 17:54:16] DEBUG[16252]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = '100'
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '1'
[Mar 24 17:54:16] DEBUG[16252]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = '100'
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:16] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '1'
[Mar 24 17:54:16] DEBUG[16252]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
-- Executing Answer("SIP/1022-00000001", "")
[Mar 24 17:54:16] DEBUG[16252]: chan_sip.c:6197 sip_answer: SIP answering channel: SIP/1022-00000001
[Mar 24 17:54:16] DEBUG[16213]: devicestate.c:342 _ast_device_state: No provider found, checking channel drivers for SIP - 1022
[Mar 24 17:54:16] DEBUG[16213]: chan_sip.c:23000 sip_devicestate: Checking device state for peer 1022
[Mar 24 17:54:16] DEBUG[16213]: devicestate.c:460 do_state_change: Changing state for SIP/1022 - state 1 (Not in use)
[Mar 24 17:54:16] DEBUG[16213]: devicestate.c:440 devstate_event: device 'SIP/1022' state '1'
[Mar 24 17:54:16] DEBUG[16252]: chan_sip.c:10426 transmit_response_with_sdp: Setting framing from config on incoming call
[Mar 24 17:54:16] DEBUG[16222]: app_queue.c:1084 handle_statechange: Device 'SIP/1022' changed to state '1' (Not in use) but we don't care because they're not a member of any queue.
[Mar 24 17:54:16] DEBUG[16252]: chan_sip.c:10115 add_sdp: ** Our capability: 0xe (gsm|ulaw|alaw) Video flag: True Text flag: True
[Mar 24 17:54:16] DEBUG[16252]: chan_sip.c:10116 add_sdp: ** Our prefcodec: 0x0 (nothing)
[Mar 24 17:54:16] DEBUG[16252]: chan_sip.c:10227 add_sdp: -- Done with adding codecs to SDP
[Mar 24 17:54:16] DEBUG[16252]: channel.c:3096 ast_internal_timing_enabled: Internal timing is disabled (option_internal_timing=0 chan->timingfd=30)
[Mar 24 17:54:16] DEBUG[16252]: chan_sip.c:10363 add_sdp: Done building SDP. Settling with this capability: 0xe (gsm|ulaw|alaw)
[Mar 24 17:54:16] DEBUG[16252]: chan_sip.c:3557 __sip_xmit: Trying to put 'SIP/2.0 200' onto UDP socket destined for 192.168.200.186:18999
[Mar 24 17:54:17] DEBUG[16223]: chan_sip.c:21639 handle_incoming: **** Received ACK (6) - Command in SIP ACK
[Mar 24 17:54:17] DEBUG[16223]: chan_sip.c:4093 __sip_ack: Stopping retransmission on 'ZWE4N2E3MWQyNDZjZjQxOWUwNzgzMDE0ODEwZWI0ODg.' of Response 2: Match Found
[Mar 24 17:54:17] DEBUG[16252]: channel.c:1882 __ast_answer: Didn't receive a media frame from SIP/1022-00000001 within 500 ms of answering. Continuing anyway
[Mar 24 17:54:17] DEBUG[16252]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:17] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = '100'
[Mar 24 17:54:17] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:17] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '2'
[Mar 24 17:54:17] DEBUG[16252]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
[Mar 24 17:54:17] DEBUG[16252]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:17] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = '100'
[Mar 24 17:54:17] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:17] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '2'
[Mar 24 17:54:17] DEBUG[16252]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
-- Executing SayNumber("SIP/1022-00000001", "100")
[Mar 24 17:54:17] DEBUG[16252]: channel.c:3727 set_format: Set channel SIP/1022-00000001 to write format gsm
[Mar 24 17:54:17] DEBUG[16252]: rtp.c:3832 ast_rtp_write: Ooh, format changed from unknown to ulaw
[Mar 24 17:54:17] DEBUG[16252]: rtp.c:3858 ast_rtp_write: Created smoother: format: 4 ms: 20 len: 160
[Mar 24 17:54:17] DEBUG[16252]: channel.c:2426 ast_settimeout: Scheduling timer at (50 requested / 50 actual) timer ticks per second
-- <SIP/1022-00000001> Playing 'digits/1.gsm' (language 'en')
[Mar 24 17:54:18] DEBUG[16252]: channel.c:2426 ast_settimeout: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[Mar 24 17:54:18] DEBUG[16252]: channel.c:2426 ast_settimeout: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[Mar 24 17:54:18] DEBUG[16252]: channel.c:2426 ast_settimeout: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[Mar 24 17:54:18] DEBUG[16252]: channel.c:3727 set_format: Set channel SIP/1022-00000001 to write format ulaw
[Mar 24 17:54:18] DEBUG[16252]: channel.c:3727 set_format: Set channel SIP/1022-00000001 to write format gsm
[Mar 24 17:54:18] DEBUG[16252]: channel.c:2426 ast_settimeout: Scheduling timer at (50 requested / 50 actual) timer ticks per second
-- <SIP/1022-00000001> Playing 'digits/hundred.gsm' (language 'en')
[Mar 24 17:54:19] DEBUG[16252]: channel.c:2426 ast_settimeout: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[Mar 24 17:54:19] DEBUG[16252]: channel.c:2426 ast_settimeout: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[Mar 24 17:54:19] DEBUG[16252]: channel.c:2426 ast_settimeout: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[Mar 24 17:54:19] DEBUG[16252]: channel.c:3727 set_format: Set channel SIP/1022-00000001 to write format ulaw
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = '100'
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '3'
[Mar 24 17:54:19] DEBUG[16252]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = '100'
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '3'
[Mar 24 17:54:19] DEBUG[16252]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
-- Executing Hangup("SIP/1022-00000001", "")
[Mar 24 17:54:19] DEBUG[16252]: pbx.c:4306 __ast_pbx_run: Spawn extension (talknet,100,3) exited non-zero on 'SIP/1022-00000001'
== Spawn extension (talknet, 100, 3) exited non-zero on 'SIP/1022-00000001'
[Mar 24 17:54:19] DEBUG[16252]: channel.c:1655 ast_softhangup_nolock: Soft-Hanging up channel 'SIP/1022-00000001'
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = 'h'
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '1'
[Mar 24 17:54:19] DEBUG[16252]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = 'h'
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '1'
[Mar 24 17:54:19] DEBUG[16252]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = 'h'
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:19] DEBUG[16252]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '1'
[Mar 24 17:54:19] DEBUG[16252]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
-- Executing Hangup("SIP/1022-00000001", "")
[Mar 24 17:54:19] DEBUG[16252]: pbx.c:4449 __ast_pbx_run: Spawn extension (talknet,h,1) exited non-zero on 'SIP/1022-00000001'
== Spawn extension (talknet, h, 1) exited non-zero on 'SIP/1022-00000001'
[Mar 24 17:54:19] DEBUG[16252]: channel.c:1760 ast_hangup: Hanging up channel 'SIP/1022-00000001'
[Mar 24 17:54:19] DEBUG[16252]: chan_sip.c:6005 sip_hangup: Hangup call SIP/1022-00000001, SIP callid ZWE4N2E3MWQyNDZjZjQxOWUwNzgzMDE0ODEwZWI0ODg.
лог звонка "200":
[...]
[Mar 24 17:54:31] DEBUG[16223]: chan_sip.c:20030 handle_request_invite: Checking SIP call limits for device 1022
[Mar 24 17:54:31] DEBUG[16223]: chan_sip.c:5641 update_call_counter: Updating call counter for incoming call
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = '200'
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '1'
[Mar 24 17:54:31] DEBUG[16223]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten LIKE ? ESCAPE '\' AND context = ? AND priority = ? ORDER BY exten
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten LIKE') = '\_%'
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '1'
[Mar 24 17:54:31] DEBUG[16223]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten = ? AND context = ? AND priority = ?
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten') = '200'
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '1'
[Mar 24 17:54:31] DEBUG[16223]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:73 custom_prepare: Skip: 0; SQL: SELECT * FROM extensions WHERE exten LIKE ? ESCAPE '\' AND context = ? AND priority = ? ORDER BY exten
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 1 ('exten LIKE') = '\_%'
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 2 ('context') = 'talknet'
[Mar 24 17:54:31] DEBUG[16223]: res_config_odbc.c:88 custom_prepare: Parameter 3 ('priority') = '1'
[Mar 24 17:54:31] DEBUG[16223]: res_odbc.c:988 odbc_release_obj2: odbc_release_obj2(0xb7c03410) called (obj->txf = (nil))
[Mar 24 17:54:31] DEBUG[16223]: chan_sip.c:3557 __sip_xmit: Trying to put 'SIP/2.0 404' onto UDP socket destined for 192.168.200.186:18999
[Mar 24 17:54:31] NOTICE[16223]: chan_sip.c:20059 handle_request_invite: Call from '1022' to extension '200' rejected because extension not found.
[Mar 24 17:54:31] DEBUG[16223]: chan_sip.c:5641 update_call_counter: Updating call counter for incoming call
[Mar 24 17:54:31] DEBUG[16223]: chan_sip.c:21639 handle_incoming: **** Received ACK (6) - Command in SIP ACK
[Mar 24 17:54:31] DEBUG[16223]: chan_sip.c:4093 __sip_ack: Stopping retransmission on 'ODFhNzkxYmM3MTBlMDg2NGI2OTA1NWVkMjdmODBkYTQ.' of Response 2: Match Found
Eugene
|