1. 程式人生 > >freeswitch中Context的理解

freeswitch中Context的理解

1 現象

註冊了兩個使用者1000和1001。

1 1001撥1000能撥通

2 1001撥9999撥不通,9999在default.xml中有相應的extension對應處理。

疑惑....

分析過程

1 啟用log:[email protected]> console loglevel debug

2 呼叫9999

2018-11-15 03:08:21.979059 [INFO] mod_dialplan_xml.c:637 Processing 1001 <1001>->9999 in context default
Dialplan: sofia/internal/[email protected]

parsing [default->unloop] continue=false
Dialplan: sofia/internal/[email protected] Regex (PASS) [unloop] ${unroll_loops}(true) =~ /^true$/ break=on-false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [unloop] ${sip_looped_call}() =~ /^true$/ break=on-false
Dialplan: sofia/internal/[email protected]
parsing [default->route_ana] continue=true
Dialplan: sofia/internal/[email protected] Regex (PASS) [route_ana] () =~ // break=on-false
Dialplan: sofia/internal/[email protected] Action lua(route_ana.lua)
Dialplan: sofia/internal/[email protected] parsing [default->tod_example] continue=true
Dialplan: sofia/internal/
[email protected]
Date/TimeMatch (FAIL) [tod_example] break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->holiday_example] continue=true
Dialplan: sofia/internal/[email protected] Date/TimeMatch (FAIL) [holiday_example] break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->global-intercept] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [global-intercept] destination_number(9999) =~ /^886$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->group-intercept] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [group-intercept] destination_number(9999) =~ /^\*8$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->intercept-ext] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [intercept-ext] destination_number(9999) =~ /^\*\*(\d+)$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->redial] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [redial] destination_number(9999) =~ /^(redial|870)$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->global] continue=true
Dialplan: sofia/internal/[email protected] Regex (FAIL) [global] ${call_debug}(false) =~ /^true$/ break=never
Dialplan: sofia/internal/[email protected] Regex (FAIL) [global] ${rtp_has_crypto}() =~ /^(AEAD_AES_256_GCM_8|AEAD_AES_128_GCM_8|AES_CM_256_HMAC_SHA1_80|AES_CM_192_HMAC_SHA1_80|AES_CM_128_HMAC_SHA1_80|AES_CM_256_HMAC_SHA1_32|AES_CM_192_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_32|AES_CM_128_NULL_AUTH)$/ break=never
Dialplan: sofia/internal/[email protected] Regex (PASS) [global] ${endpoint_disposition}(DELAYED NEGOTIATION) =~ /^(DELAYED NEGOTIATION)/ break=on-false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [global] ${switch_r_sdp}(v=0
o=ebang 1038288670 1038288670 IN IP4 192.168.4.208
s=-
c=IN IP4 192.168.4.208
t=0 0
m=audio 10000 RTP/AVP 8 0 18
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=ptime:20
) =~ /(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)/ break=never
Dialplan: sofia/internal/[email protected] Absolute Condition [global]
Dialplan: sofia/internal/[email protected] Action hash(insert/${domain_name}-spymap/${caller_id_number}/${uuid})
Dialplan: sofia/internal/[email protected] Action hash(insert/${domain_name}-last_dial/${caller_id_number}/${destination_number})
Dialplan: sofia/internal/[email protected] Action hash(insert/${domain_name}-last_dial/global/${uuid})
Dialplan: sofia/internal/[email protected] Action export(RFC2822_DATE=${strftime(%a, %d %b %Y %T %z)})
Dialplan: sofia/internal/[email protected] parsing [default->snom-demo-2] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [snom-demo-2] destination_number(9999) =~ /^9001$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->snom-demo-1] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [snom-demo-1] destination_number(9999) =~ /^9000$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->eavesdrop] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [eavesdrop] destination_number(9999) =~ /^88(\d{4})$|^\*0(.*)$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->eavesdrop] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [eavesdrop] destination_number(9999) =~ /^779$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->call_return] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [call_return] destination_number(9999) =~ /^\*69$|^869$|^lcr$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->del-group] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [del-group] destination_number(9999) =~ /^80(\d{2})$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->add-group] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [add-group] destination_number(9999) =~ /^81(\d{2})$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->call-group-simo] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [call-group-simo] destination_number(9999) =~ /^82(\d{2})$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->call-group-order] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [call-group-order] destination_number(9999) =~ /^83(\d{2})$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->extension-intercom] continue=false
Dialplan: sofia/internal/[email protected] Regex (FAIL) [extension-intercom] destination_number(9999) =~ /^8(10[01][0-9])$/ break=on-false
Dialplan: sofia/internal/[email protected] parsing [default->show_info_1] continue=true
Dialplan: sofia/internal/[email protected] Regex (FAIL) [show_info_1] destination_number(9999) =~ /^(10[01][0-9])$/ break=never
Dialplan: sofia/internal/[email protected] parsing [default->lua_test1] continue=false
Dialplan: sofia/internal/[email protected] Regex (PASS) [lua_test1] destination_number(9999) =~ /^(9999)$/ break=on-false
Dialplan: sofia/internal/[email protected] Action lua(test.lua)

檢查配置

1001的註冊資訊中user_context是default。

internal.xml中context是public。