Archive for October, 2013

Asterisk DTMF 3-way

Before I go ahead and write out a full defect against Asterisk 11.5.0, I’m going to write up my issue here and see if I can get any help from IRC or forums. I’ll dump this all into Jira later if I can’t find a resolution.

Here’s what I’m trying to do:
I have a custom channel driver, and I need to support 3-way conferencing via DTMF signals. After reading quite a few articles and how-to descriptions, I decided to implement some dynamic feature codes that put parties into a ConfBridge session. I made a quick prototype and it worked – but only half-way. After a bit more searching I uncovered Asterisk Jira 11896 – which apparently describes my exact experience. Unfortunately, there was no real resolution, or direction of how to implement the behavior I need. I tried a few more “unique” dialplan and feature manipulation, but they all consistently crash Asterisk 11.5.0 (I’m talking core dump – I should probably reproduce those and write up bugs).

Here’s what I implemented:



;####################################################################
;# /etc/asterisk/extensions.conf
;#
;# This file belongs to the Asterisk 11.5.0 PBX.
;####################################################################

[general]
clearglobalvars=yes

[globals]
TRANSFER_CONTEXT=transfer

[transfer]
include => sip_extensions; (_2XX)

[sip_context]
;context for authenticated sip devices
include => sip_extensions; (_2XX)

[sip_extensions]
; all of the sip_extensions dial patterns are internal to the system.

; 2XX extensions are for local extensions
exten => _2XX,1,Verbose(1, Placing call to local SIP phone at ${EXTEN})
same => n,Set(__DYNAMIC_FEATURES=callerstartthreeway#calleestartthreeway)
same => n,Dial(SIP/${EXTEN},90)
same => n,Hangup(${HANGUPCAUSE})

[macro-fc-tw-start]
exten => s,1,Verbose(1,Starting Three Way Calling Routine for ${CHANNEL}, Peer is ${BRIDGEPEER})
same => n,Set(ChanName=${CHANNEL})
same => n,Set(Tech=${SHIFT(ChanName,/)})
same => n,Set(Chan=${SHIFT(ChanName,/)})

same => n,Set(ConfNo=$[${Chan}+50]);
same => n,Verbose(1,Creating Conference number ${ConfNo})
same => n,ChannelRedirect(${BRIDGEPEER},conference-user,${ConfNo},1)

same => n,Verbose(1,Now prompting for new extension to connect to)
same => n,Read(DEST,dial,24,i,3,5);Assuming Max Digits = 24
same => n,GotoIf($["${DEST}" = "*" ]?cancel)
same => n,GotoIf($["${DEST}" = "" ]?cancel)

same => n,Set(__DYNAMIC_FEATURES=callerjointhreeway);Only enable join 3 way from this point... Revisit?
same => n,Dial(Local/${DEST}@sip_extensions/n,90)

;Todo - Check to make sure the dial happens with a valid number?
same => n,Hangup()

same => n(cancel),Verbose(1, Cancel 3 Way)

[macro-fc-tw-join]
exten => s,1,Verbose(1,Joining Three Way Call for ${CHANNEL}, Peer is ${BRIDGEPEER})
same => n,Set(ChanName=${CHANNEL})
same => n,Set(Tech=${SHIFT(ChanName,/)})
same => n,Set(Chan=${SHIFT(ChanName,/)})

same => n,Set(ConfNo=$[${Chan}+50]);
same => n,ChannelRedirect(${BRIDGEPEER},conference-user,${ConfNo},1)
same => n,ConfBridge(${ConfNo},three-way,initiator-profile)

[conference-user]
;same => _X.,ChannelRedirect(${BRIDGEPEER},sip_context,${DEST},1)
exten => _X.,1,Verbose(1,Dropping ${CHANNEL} into Conference ${EXTEN})
same => n,ConfBridge(${EXTEN},three-way,user-profile)
same => n,Hangup()

 


;##############################
;## features.conf (snippet)
;##############################
[applicationmap]
; Note that the DYNAMIC_FEATURES channel variable must be set to use the features
; defined here.  The value of DYNAMIC_FEATURES should be the names of the features
; to allow the channel to use separated by '#'.  For example:
;
;    Set(__DYNAMIC_FEATURES=myfeature1#myfeature2#myfeature3)
;
; (Note: The two leading underscores allow these feature settings to be set on
;  on the outbound channels, as well.  Otherwise, only the original channel
;  will have access to these features.)
;
; The syntax for declaring a dynamic feature is any of the following:
;
; => <DTMF_sequence>,[/],[,[,MOH_Class]]
; => <DTMF_sequence>,[/],[,""[,MOH_Class]]
; => <DTMF_sequence>,[/],([])[,MOH_Class]

; Three Way
callerstartthreeway => #0,self/caller,Macro,fc-tw-start,default
calleestartthreeway => #0,self/callee,Macro,fc-tw-start,default
callerjointhreeway => **,self/caller,Macro,fc-tw-join,default
calleejointhreeway => **,self/callee,Macro,fc-tw-join,default

;
;  FeatureName   -> This is the name of the feature used when setting the
;                   DYNAMIC_FEATURES variable to enable usage of this feature.
;  DTMF_sequence -> This is the key sequence used to activate this feature.
;  ActivateOn    -> This is the channel of the call that the application will be executed
;                   on. Valid values are "self" and "peer". "self" means run the
;                   application on the same channel that activated the feature. "peer"
;                   means run the application on the opposite channel from the one that
;                   has activated the feature.
;  ActivatedBy   -> This is which channel is allowed to activate this feature. Valid
;                   values are "caller", "callee", and "both". "both" is the default.
;                   The "caller" is the channel that executed the Dial application, while
;                   the "callee" is the channel called by the Dial application.
;  Application   -> This is the application to execute.
;  AppArguments  -> These are the arguments to be passed into the application.  If you need
;                   commas in your arguments, you should use either the second or third
;                   syntax, above.
;  MOH_Class     -> This is the music on hold class to play while the idle
;                   channel waits for the feature to complete. If left blank,
;                   no music will be played.
;

 



;####################################################################
;# /etc/asterisk/sip.conf
;#
;# This file belongs to the Asterisk 11.5.0 PBX.
;####################################################################

[general]
context=default
allowguest=yes
transport=udp
bindaddr=0.0.0.0:5060
tlsenable=yes

srvlookup=yes
pedantic=yes

tos_sip=cs3
tos_audio=ef
tos_video=af41

maxexpiry=3600
minexpiry=60
defaultexpiry=120
t1min=100

; Codecs
disallow=all
allow=ulaw:20

language=en

videosupport=no

t38pt_udptl=no

nat=force_rport,comedia

jbenable=yes
jbmaxsize = 120
jbimpl = adaptive

promiscredir=no

[sip-template](!)
context=sip_context
host=dynamic
defaultip=127.0.0.1
nat=force_rport,comedia
dtmfmode=rfc2833
type=friend
canreinvite=no
reinvite=no
insecure=port,invite
; set limit so asterisk keeps track of calls.
call-limit=10
;qualify the connection so that we can check status
qualify=yes

; EXTENSIONS

[200](sip-template)
defaultuser=200
secret=1234
callerid=200

[201](sip-template)
defaultuser=201
secret=1234
callerid=201

[202](sip-template)
defaultuser=202
secret=1234
callerid=202

[203](sip-template)
defaultuser=203
secret=1234
callerid=203

[204](sip-template)
defaultuser=204
secret=1234
callerid=204

[205](sip-template)
defaultuser=205
secret=1234
callerid=205

Here’s what happens:
When I make a call from 200 to 201, and then 200 (the caller – the person who initiated the call) starts the 3-way (via DTMF #0), everything works well



mkocsis-ubuntu-01*CLI> core show channels
Channel              Location             State   Application(Data)
0 active channels
0 active calls
6 calls processed
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Executing [201@sip_context:1] Verbose("SIP/200-00000005", "1, Placing call to local SIP phone at 201") in new stack
    -- Executing [201@sip_context:2] Set("SIP/200-00000005", "__DYNAMIC_FEATURES=callerstartthreeway#calleestartthreeway") in new stack
    -- Executing [201@sip_context:3] Dial("SIP/200-00000005", "SIP/201,90") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Called SIP/201
    -- SIP/201-00000006 answered SIP/200-00000005
       > 0xb6b873b0 -- Probation passed - setting RTP source address to 192.168.164.128:4006
       > 0xb6b13550 -- Probation passed - setting RTP source address to 192.168.164.128:4004
mkocsis-ubuntu-01*CLI> core show channels
Channel              Location             State   Application(Data)
SIP/201-00000006     (None)               Up      AppDial((Outgoing Line))
SIP/200-00000005     201@sip_context:3    Up      Dial(SIP/201,90)
2 active channels
1 active call
7 calls processed
    --  Feature Found: callerstartthreeway exten: callerstartthreeway
    -- Started music on hold, class 'default', on SIP/201-00000006
    -- Executing [s@macro-fc-tw-start:1] Verbose("SIP/200-00000005", "1,Starting Three Way Calling Routine for SIP/200-00000005, Peer is SIP/201-00000006") in new stack
    -- Executing [s@macro-fc-tw-start:2] Set("SIP/200-00000005", "ChanName=SIP/200-00000005") in new stack
    -- Executing [s@macro-fc-tw-start:3] Set("SIP/200-00000005", "Tech=SIP") in new stack
    -- Executing [s@macro-fc-tw-start:4] Set("SIP/200-00000005", "Chan=200-00000005") in new stack
    -- Executing [s@macro-fc-tw-start:5] Set("SIP/200-00000005", "ConfNo=245") in new stack
    -- Executing [s@macro-fc-tw-start:6] Verbose("SIP/200-00000005", "1,Creating Conference number 245") in new stack
    -- Executing [s@macro-fc-tw-start:7] ChannelRedirect("SIP/200-00000005", "SIP/201-00000006,conference-user,245,1") in new stack
    -- Stopped music on hold on AsyncGoto/SIP/201-00000006
    -- Executing [s@macro-fc-tw-start:8] Verbose("SIP/200-00000005", "1,Now prompting for new extension to connect to") in new stack
    -- Executing [245@conference-user:1] Verbose("SIP/201-00000006", "1,Dropping SIP/201-00000006 into Conference 245") in new stack
    -- Executing [s@macro-fc-tw-start:9] Read("SIP/200-00000005", "DEST,dial,24,i,3,5") in new stack
    -- Executing [245@conference-user:2] ConfBridge("SIP/201-00000006", "245,three-way,user-profile") in new stack
    -- Accepting a maximum of 24 digits.
    -- <SIP/201-00000006> Playing 'conf-onlyperson.ulaw' (language 'en')
    -- <SIP/201-00000006> Playing 'confbridge-join.ulaw' (language 'en')
    -- <Bridge/0xb6b6af5c-input> Playing 'confbridge-join.gsm' (language 'en')
    -- Started music on hold, class 'default', on SIP/201-00000006
    -- User entered nothing, 2 chances left
    -- User entered '202'
    -- Executing [s@macro-fc-tw-start:10] GotoIf("SIP/200-00000005", "0?cancel") in new stack
    -- Executing [s@macro-fc-tw-start:11] GotoIf("SIP/200-00000005", "0?cancel") in new stack
    -- Executing [s@macro-fc-tw-start:12] Set("SIP/200-00000005", "__DYNAMIC_FEATURES=callerjointhreeway") in new stack
    -- Executing [s@macro-fc-tw-start:13] Dial("SIP/200-00000005", "Local/202@sip_extensions/n,90") in new stack
    -- Executing [202@sip_extensions:1] Verbose("Local/202@sip_extensions-00000001;2", "1, Placing call to local SIP phone at 202") in new stack
    -- Called Local/202@sip_extensions/n
    -- Executing [202@sip_extensions:2] Set("Local/202@sip_extensions-00000001;2", "__DYNAMIC_FEATURES=callerstartthreeway#calleestartthreeway") in new stack
    -- Executing [202@sip_extensions:3] Dial("Local/202@sip_extensions-00000001;2", "SIP/202,90") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Called SIP/202
mkocsis-ubuntu-01*CLI> core show channels
Channel              Location             State   Application(Data)
SIP/202-00000007     202@sip_context:1    Down    AppDial((Outgoing Line))
Bridge/0xb6b6af5c-ou s@default:1          Up      (None)
SIP/201-00000006     245@conference-user: Up      ConfBridge(245,three-way,user-
Local/202@sip_extens 202@sip_extensions:3 Ring    Dial(SIP/202,90)
Local/202@sip_extens 201@sip_extensions:1 Down    AppDial((Outgoing Line))
AsyncGoto/SIP/201-00 (None)               Up      AppDial((Outgoing Line))
SIP/200-00000005     s@macro-fc-tw-start: Up      Dial(Local/202@sip_extensions/
Bridge/0xb6b6af5c-in s@default:1          Up      (None)
8 active channels
3 active calls
9 calls processed
    -- SIP/202-00000007 answered Local/202@sip_extensions-00000001;2
    -- Local/202@sip_extensions-00000001;1 answered SIP/200-00000005
       > 0xb6ba0b20 -- Probation passed - setting RTP source address to 192.168.164.128:4002
mkocsis-ubuntu-01*CLI> core show channels
Channel              Location             State   Application(Data)
SIP/202-00000007     (None)               Up      AppDial((Outgoing Line))
Bridge/0xb6b6af5c-ou s@default:1          Up      (None)
SIP/201-00000006     245@conference-user: Up      ConfBridge(245,three-way,user-
Local/202@sip_extens 202@sip_extensions:3 Up      Dial(SIP/202,90)
Local/202@sip_extens (None)               Up      AppDial((Outgoing Line))
AsyncGoto/SIP/201-00 (None)               Up      AppDial((Outgoing Line))
SIP/200-00000005     s@macro-fc-tw-start: Up      Dial(Local/202@sip_extensions/
Bridge/0xb6b6af5c-in s@default:1          Up      (None)
8 active channels
3 active calls
9 calls processed
    --  Feature Found: callerjointhreeway exten: callerjointhreeway
    -- Started music on hold, class 'default', on Local/202@sip_extensions-00000001;1
    -- Executing [s@macro-fc-tw-join:1] Verbose("SIP/200-00000005", "1,Joining Three Way Call for SIP/200-00000005, Peer is Local/202@sip_extensions-00000001;1") in new stack
    -- Executing [s@macro-fc-tw-join:2] Set("SIP/200-00000005", "ChanName=SIP/200-00000005") in new stack
    -- Executing [s@macro-fc-tw-join:3] Set("SIP/200-00000005", "Tech=SIP") in new stack
    -- Executing [s@macro-fc-tw-join:4] Set("SIP/200-00000005", "Chan=200-00000005") in new stack
    -- Executing [s@macro-fc-tw-join:5] Set("SIP/200-00000005", "ConfNo=245") in new stack
    -- Executing [s@macro-fc-tw-join:6] ChannelRedirect("SIP/200-00000005", "Local/202@sip_extensions-00000001;1,conference-user,245,1") in new stack
    -- Stopped music on hold on AsyncGoto/Local/202@sip_extensions-00000001;1
    -- Executing [s@macro-fc-tw-join:7] ConfBridge("SIP/200-00000005", "245,three-way,initiator-profile") in new stack
    -- Stopped music on hold on SIP/201-00000006
    -- Executing [245@conference-user:1] Verbose("Local/202@sip_extensions-00000001;1", "1,Dropping Local/202@sip_extensions-00000001;1 into Conference 245") in new stack
    -- Executing [245@conference-user:2] ConfBridge("Local/202@sip_extensions-00000001;1", "245,three-way,user-profile") in new stack
    -- <SIP/200-00000005> Playing 'conf-placeintoconf.ulaw' (language 'en')
    -- <Local/202@sip_extensions-00000001;1> Playing 'confbridge-join.ulaw' (language 'en')
    -- <SIP/200-00000005> Playing 'confbridge-join.ulaw' (language 'en')
    -- <Bridge/0xb6b6af5c-input> Playing 'confbridge-join.gsm' (language 'en')
    -- <Bridge/0xb6b6af5c-input> Playing 'confbridge-join.gsm' (language 'en')
mkocsis-ubuntu-01*CLI> core show channels
Channel              Location             State   Application(Data)
SIP/202-00000007     (None)               Up      AppDial((Outgoing Line))
Bridge/0xb6b6af5c-ou s@default:1          Up      (None)
AsyncGoto/Local/202@ (None)               Up      AppDial((Outgoing Line))
SIP/201-00000006     245@conference-user: Up      ConfBridge(245,three-way,user-
Local/202@sip_extens 202@sip_extensions:3 Up      Dial(SIP/202,90)
Local/202@sip_extens 245@conference-user: Up      ConfBridge(245,three-way,user-
AsyncGoto/SIP/201-00 (None)               Up      AppDial((Outgoing Line))
SIP/200-00000005     s@macro-fc-tw-join:7 Up      ConfBridge(245,three-way,initi
Bridge/0xb6b6af5c-in s@default:1          Up      (None)
9 active channels
4 active calls
10 calls processed
    -- <Bridge/0xb6b6af5c-input> Playing 'confbridge-leave.gsm' (language 'en')
    -- <Bridge/0xb6b6af5c-input> Playing 'conf-leaderhasleft.gsm' (language 'en')
    -- <Bridge/0xb6b6af5c-input> Playing 'confbridge-leave.gsm' (language 'en')
  == Spawn extension (macro-fc-tw-start, s, 13) exited non-zero on 'SIP/200-00000005' in macro 'fc-tw-start'
    -- <Bridge/0xb6b6af5c-input> Playing 'confbridge-leave.gsm' (language 'en')
    -- Started music on hold, class 'default', on Local/202@sip_extensions-00000001;1
    -- <SIP/201-00000006> Playing 'conf-kicked.ulaw' (language 'en')
    -- Stopped music on hold on Local/202@sip_extensions-00000001;1
    -- <Local/202@sip_extensions-00000001;1> Playing 'conf-kicked.ulaw' (language 'en')
    -- Executing [245@conference-user:3] Hangup("SIP/201-00000006", "") in new stack
  == Spawn extension (conference-user, 245, 3) exited non-zero on 'SIP/201-00000006'
    -- Executing [245@conference-user:3] Hangup("Local/202@sip_extensions-00000001;1", "") in new stack
  == Spawn extension (conference-user, 245, 3) exited non-zero on 'Local/202@sip_extensions-00000001;1'
  == Spawn extension (sip_extensions, 202, 3) exited non-zero on 'Local/202@sip_extensions-00000001;2'
mkocsis-ubuntu-01*CLI> core show channels
Channel              Location             State   Application(Data)
0 active channels
0 active calls
10 calls processed
mkocsis-ubuntu-01*CLI>

However, when I make a call from 201 to 200, and then 200 (the callee – the person who received the call) starts the 3-way (via DTMF #0), The caller doesn’t get dropped into the conference until the callee (the 3-way initiator) hangs up.



mkocsis-ubuntu-01*CLI> core show channels
Channel              Location             State   Application(Data)
0 active channels
0 active calls
10 calls processed
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Executing [200@sip_context:1] Verbose("SIP/201-00000008", "1, Placing call to local SIP phone at 200") in new stack
    -- Executing [200@sip_context:2] Set("SIP/201-00000008", "__DYNAMIC_FEATURES=callerstartthreeway#calleestartthreeway") in new stack
    -- Executing [200@sip_context:3] Dial("SIP/201-00000008", "SIP/200,90") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Called SIP/200
    -- SIP/200-00000009 answered SIP/201-00000008
       > 0xb6b0d168 -- Probation passed - setting RTP source address to 192.168.164.128:4006
       > 0xb6b13550 -- Probation passed - setting RTP source address to 192.168.164.128:4008
mkocsis-ubuntu-01*CLI> core show channels
Channel              Location             State   Application(Data)
SIP/201-00000008     200@sip_context:3    Up      Dial(SIP/200,90)
SIP/200-00000009     (None)               Up      AppDial((Outgoing Line))
2 active channels
1 active call
11 calls processed
    --  Feature Found: callerstartthreeway exten: callerstartthreeway
    --  Feature Found: calleestartthreeway exten: calleestartthreeway
    -- Started music on hold, class 'default', on SIP/201-00000008
    -- Executing [s@macro-fc-tw-start:1] Verbose("SIP/200-00000009", "1,Starting Three Way Calling Routine for SIP/200-00000009, Peer is SIP/201-00000008") in new stack
    -- Executing [s@macro-fc-tw-start:2] Set("SIP/200-00000009", "ChanName=SIP/200-00000009") in new stack
    -- Executing [s@macro-fc-tw-start:3] Set("SIP/200-00000009", "Tech=SIP") in new stack
    -- Executing [s@macro-fc-tw-start:4] Set("SIP/200-00000009", "Chan=200-00000009") in new stack
    -- Executing [s@macro-fc-tw-start:5] Set("SIP/200-00000009", "ConfNo=241") in new stack
    -- Executing [s@macro-fc-tw-start:6] Verbose("SIP/200-00000009", "1,Creating Conference number 241") in new stack
    -- Executing [s@macro-fc-tw-start:7] ChannelRedirect("SIP/200-00000009", "SIP/201-00000008,conference-user,241,1") in new stack
    -- Stopped music on hold on SIP/201-00000008
    -- Executing [s@macro-fc-tw-start:8] Verbose("SIP/200-00000009", "1,Now prompting for new extension to connect to") in new stack
    -- Executing [s@macro-fc-tw-start:9] Read("SIP/200-00000009", "DEST,dial,24,i,3,5") in new stack
    -- Accepting a maximum of 24 digits.
    -- User entered nothing, 2 chances left
    -- User entered '202'
    -- Executing [s@macro-fc-tw-start:10] GotoIf("SIP/200-00000009", "0?cancel") in new stack
    -- Executing [s@macro-fc-tw-start:11] GotoIf("SIP/200-00000009", "0?cancel") in new stack
    -- Executing [s@macro-fc-tw-start:12] Set("SIP/200-00000009", "__DYNAMIC_FEATURES=callerjointhreeway") in new stack
    -- Executing [s@macro-fc-tw-start:13] Dial("SIP/200-00000009", "Local/202@sip_extensions/n,90") in new stack
    -- Called Local/202@sip_extensions/n
    -- Executing [202@sip_extensions:1] Verbose("Local/202@sip_extensions-00000002;2", "1, Placing call to local SIP phone at 202") in new stack
    -- Executing [202@sip_extensions:2] Set("Local/202@sip_extensions-00000002;2", "__DYNAMIC_FEATURES=callerstartthreeway#calleestartthreeway") in new stack
    -- Executing [202@sip_extensions:3] Dial("Local/202@sip_extensions-00000002;2", "SIP/202,90") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Called SIP/202
    -- SIP/202-0000000a answered Local/202@sip_extensions-00000002;2
    -- Local/202@sip_extensions-00000002;1 answered SIP/200-00000009
       > 0xb6b75240 -- Probation passed - setting RTP source address to 192.168.164.128:4004
mkocsis-ubuntu-01*CLI> core show channels
Channel              Location             State   Application(Data)
SIP/202-0000000a     (None)               Up      AppDial((Outgoing Line))
SIP/201-00000008     241@conference-user: Up      Dial(SIP/200,90)
SIP/200-00000009     s@macro-fc-tw-start: Up      Dial(Local/202@sip_extensions/
Local/202@sip_extens (None)               Up      AppDial((Outgoing Line))
Local/202@sip_extens 202@sip_extensions:3 Up      Dial(SIP/202,90)
5 active channels
2 active calls
12 calls processed
    --  Feature Found: callerjointhreeway exten: callerjointhreeway
    -- Started music on hold, class 'default', on Local/202@sip_extensions-00000002;1
    -- Executing [s@macro-fc-tw-join:1] Verbose("SIP/200-00000009", "1,Joining Three Way Call for SIP/200-00000009, Peer is Local/202@sip_extensions-00000002;1") in new stack
    -- Executing [s@macro-fc-tw-join:2] Set("SIP/200-00000009", "ChanName=SIP/200-00000009") in new stack
    -- Executing [s@macro-fc-tw-join:3] Set("SIP/200-00000009", "Tech=SIP") in new stack
    -- Executing [s@macro-fc-tw-join:4] Set("SIP/200-00000009", "Chan=200-00000009") in new stack
    -- Executing [s@macro-fc-tw-join:5] Set("SIP/200-00000009", "ConfNo=241") in new stack
    -- Executing [s@macro-fc-tw-join:6] ChannelRedirect("SIP/200-00000009", "Local/202@sip_extensions-00000002;1,conference-user,241,1") in new stack
    -- Stopped music on hold on AsyncGoto/Local/202@sip_extensions-00000002;1
    -- Executing [241@conference-user:1] Verbose("Local/202@sip_extensions-00000002;1", "1,Dropping Local/202@sip_extensions-00000002;1 into Conference 241") in new stack
    -- Executing [s@macro-fc-tw-join:7] ConfBridge("SIP/200-00000009", "241,three-way,initiator-profile") in new stack
    -- Executing [241@conference-user:2] ConfBridge("Local/202@sip_extensions-00000002;1", "241,three-way,user-profile") in new stack
    -- <Local/202@sip_extensions-00000002;1> Playing 'confbridge-join.ulaw' (language 'en')
    -- <SIP/200-00000009> Playing 'conf-placeintoconf.ulaw' (language 'en')
    -- <Bridge/0xb6b936ac-input> Playing 'confbridge-join.gsm' (language 'en')
    -- <SIP/200-00000009> Playing 'confbridge-join.ulaw' (language 'en')
    -- <Bridge/0xb6b936ac-input> Playing 'confbridge-join.gsm' (language 'en')
mkocsis-ubuntu-01*CLI> core show channels
Channel              Location             State   Application(Data)
SIP/202-0000000a     (None)               Up      AppDial((Outgoing Line))
SIP/201-00000008     241@conference-user: Up      Dial(SIP/200,90)
Bridge/0xb6b936ac-in s@default:1          Up      (None)
Bridge/0xb6b936ac-ou s@default:1          Up      (None)
SIP/200-00000009     s@macro-fc-tw-join:7 Up      ConfBridge(241,three-way,initi
Local/202@sip_extens 241@conference-user: Up      ConfBridge(241,three-way,user-
Local/202@sip_extens 202@sip_extensions:3 Up      Dial(SIP/202,90)
AsyncGoto/Local/202@ (None)               Up      AppDial((Outgoing Line))
8 active channels
3 active calls
13 calls processed
    -- <Bridge/0xb6b936ac-input> Playing 'confbridge-leave.gsm' (language 'en')
    -- <Bridge/0xb6b936ac-input> Playing 'conf-leaderhasleft.gsm' (language 'en')
    -- Started music on hold, class 'default', on Local/202@sip_extensions-00000002;1
    -- <Bridge/0xb6b936ac-input> Playing 'confbridge-leave.gsm' (language 'en')
  == Spawn extension (macro-fc-tw-start, s, 13) exited non-zero on 'SIP/200-00000009' in macro 'fc-tw-start'
    -- Executing [241@conference-user:1] Verbose("SIP/201-00000008", "1,Dropping SIP/201-00000008 into Conference 241") in new stack
    -- Executing [241@conference-user:2] ConfBridge("SIP/201-00000008", "241,three-way,user-profile") in new stack
    -- Stopped music on hold on Local/202@sip_extensions-00000002;1
    -- <SIP/201-00000008> Playing 'confbridge-join.ulaw' (language 'en')
    -- <Local/202@sip_extensions-00000002;1> Playing 'conf-kicked.ulaw' (language 'en')
    -- <Bridge/0xb6b936ac-input> Playing 'confbridge-join.gsm' (language 'en')
    -- Started music on hold, class 'default', on SIP/201-00000008
    -- Executing [241@conference-user:3] Hangup("Local/202@sip_extensions-00000002;1", "") in new stack
  == Spawn extension (conference-user, 241, 3) exited non-zero on 'Local/202@sip_extensions-00000002;1'
  == Spawn extension (sip_extensions, 202, 3) exited non-zero on 'Local/202@sip_extensions-00000002;2'
mkocsis-ubuntu-01*CLI> core show channels
Channel              Location             State   Application(Data)
SIP/201-00000008     241@conference-user: Up      ConfBridge(241,three-way,user-
Bridge/0xb6b936ac-in s@default:1          Up      (None)
Bridge/0xb6b936ac-ou s@default:1          Up      (None)
3 active channels
1 active call
13 calls processed
mkocsis-ubuntu-01*CLI>

The Result:
It looks like the ChannelRedirect cannot be called on a channel that is currently in the middle of a Dial. Even though the ChannelRedirect application calls ast_async_parseable_goto, which does do a soft hangup, it does not appear to unblock the dial. One of the more interesting displays of channels from the above log is this:

SIP/201-00000008 241@conference-user: Up Dial(SIP/200,90)

Which appears to show that the SIP/201 channel has been correctly redirected to the conference-user context, but it is still executing the Dial command after the Channel Redirect.

Also, please ignore the two errors (Calculating the conference number), and the fact that hangups at other times will leave people in the conference.

 

So, I have looked into modifying the ast_parseable_goto code (but that’s not something I want to modify), or possibly implementing this entire thing in features.c by copying attended transfer and then modifying the final state to dump everyone into a conference instead.

Thoughts?

 

Comments

Copyright © Matthew Kocsis, All Rights Reserved.