sponsored links

asterisk feature applicationmap 的caller和callee 的区别

经过测试,在applicationmap 中定义应用程序的类型为caller或callee,其实为传送那个通道的变量到application:

以下是相关的测试过程,通过对比,大家应该清楚是定义为caller或者是callee:(asterisk 1.2 版本)

dialplan 的定义如下:

【test】

exten => _4780,1,Noop
exten => _4780,n,set(mid=${UNIQUEID})
exten => _4780,n,set(LANGID=1)
exten => _4780,n,set(DYNAMIC_FEATURES=test)
exten => _4780,n,dial(SIP/3003,60,Tt)
exten => _4780,n,hangup

[macro-IVRS]
exten => s,1,Noop()

exten => s,n,Noop(${UNIQUEID})
exten => s,n,Noop(${BRIDGEPEER})
exten => s,n,NOOP(set(ouid=${mid}))

feature.conf

test => *0,callee,Macro,IVRS

以下分别进行测试:

场景一:3002 call 3003 and at 3003 press *0  --callee

-- Remote UNIX connection disconnected
    -- Executing NoOp("SIP/3002-0936cab8", "") in new stack
    -- Executing Set("SIP/3002-0936cab8", "mid=1262097623.24") in new stack
    -- Executing Set("SIP/3002-0936cab8", "DYNAMIC_FEATURES=test") in new stack
    -- Executing Dial("SIP/3002-0936cab8", "SIP/3003|60|Tt") in new stack

-- Executing NoOp("SIP/3002-0936cab8", "1262097623.24") in new stack ${UNIQUEID}
    -- Executing NoOp("SIP/3002-0936cab8", "SIP/3003-094b2b50") in new stack ${BRIDGEPEERS}
    -- Executing NoOp("SIP/3002-0936cab8", "set(ouid=1262097623.24)") in new stack

Event: Link
Privilege: call,all
Channel1: SIP/3002-0936cab8
Channel2: SIP/3003-094b2b50
Uniqueid1: 1262097623.24
Uniqueid2: 1262097623.25
CallerID1: 3002
CallerID2: 4780

场景2:3002 call 3003 and at 3003 press *0--caller

-- Executing NoOp("SIP/3002-0936cab8", "") in new stack
    -- Executing Set("SIP/3002-0936cab8", "mid=1262097952.26") in new stack

-- Executing Set("SIP/3002-0936cab8", "DYNAMIC_FEATURES=test") in new stack
    -- Executing Dial("SIP/3002-0936cab8", "SIP/3003|60|Tt") in new stack
    -- Called 3003

-- Executing NoOp("SIP/3003-094b2b50", "1262097952.27") in new stack
    -- Executing NoOp("SIP/3003-094b2b50", "SIP/3002-0936cab8") in new stack
    -- Executing NoOp("SIP/3003-094b2b50", "set(ouid=)") in new stack--变量没有传过来

Event: Link
Privilege: call,all
Channel1: SIP/3002-0936cab8
Channel2: SIP/3003-094b2b50
Uniqueid1: 1262097952.26
Uniqueid2: 1262097952.27
CallerID1: 3002
CallerID2: 4780

场景3:3002 call 3003 and at 3003 press *0--caller
   -- Executing NoOp("SIP/3002-b7800470", "") in new stack
    -- Executing Set("SIP/3002-b7800470", "mid=1262098282.28") in new stack

-- Executing Set("SIP/3002-b7800470", "DYNAMIC_FEATURES=test") in new stack
    -- Executing Dial("SIP/3002-b7800470", "SIP/3003|60|Tt") in new stack
    -- Called 3003

-- Executing NoOp("SIP/3003-0936cab8", "1262098282.29") in new stack
    -- Executing NoOp("SIP/3003-0936cab8", "SIP/3002-b7800470") in new stack
    -- Executing NoOp("SIP/3003-0936cab8", "set(ouid=)") in new stack--在此变量没有传送过来

Event: Link
Privilege: call,all
Channel1: SIP/3002-b7800470
Channel2: SIP/3003-0936cab8
Uniqueid1: 1262098282.28
Uniqueid2: 1262098282.29
CallerID1: 3002
CallerID2: 4780

场景4:3002 call 3003 and at 3002 press *0--caller

-- Executing NoOp("SIP/3002-b7800470", "") in new stack
    -- Executing Set("SIP/3002-b7800470", "mid=1262098482.30") in new stack

-- Executing Set("SIP/3002-b7800470", "DYNAMIC_FEATURES=test") in new stack
    -- Executing Dial("SIP/3002-b7800470", "SIP/3003|60|Tt") in new stack
    -- Called 3003  
    
     --  Feature Found: test exten: test

-- Executing NoOp("SIP/3002-b7800470", "1262098482.30") in new stack
    -- Executing NoOp("SIP/3002-b7800470", "SIP/3003-0936cab8") in new stack ${BRIDGEPEER}
    -- Executing NoOp("SIP/3002-b7800470", "set(ouid=1262098482.30)") in new stack
 
Event: Link
Privilege: call,all
Channel1: SIP/3002-b7800470
Channel2: SIP/3003-0936cab8
Uniqueid1: 1262098482.30
Uniqueid2: 1262098482.31
CallerID1: 3002
CallerID2: 4780

概况:

feature 定义为caller 时,即把输入feature 键方的通道变量传递到feature application 中,即把自己通道的变量传递到application 中,并且按feature 方将会被转入到feature 定义的应用中。

定义为callee是则把feature 键的对方通道的变量传递到feature 的application中,即传送对方通道的变量到application,并把对方引入到feature 定义的应用中。

例子:

假如定义了feature键** ,按了** 后将会听到beep 提示声音,分机8001 呼叫8002,并且在8002 分机上输入了**,那么

1.feature定义为caller 时,在8002上会听到beep 声音

2.feature定义为callee时,在8001上会听到beep声音

如果是在8001分机上按** 时,则效果为:

1.feature定义为caller 时,在8001上会听到beep 声音

2.feature定义为callee时,在8002上会听到beep声音

Tags: asterisk