[Freeswitch-users] Break unaswered bridge

Alexey Melnichuk alexeymelnichuck at gmail.com
Thu Jul 23 07:59:18 MSD 2015


This is simple dialplan that I try to implement

<extension>
  <condition field="destination_number" expression="^\d+$" break="on-true">
    <action application="bind_digit_action" 
data="conf,*1,exec:execute_extension,xfer"/>
    <action application="digit_action_set_realm" data="conf"/>
    <action application="conference" data="100 at default"/>
  </condition>

  <condition field="destination_number" expression="^xfer$" break="on-true">
    <action application="bind_digit_action" data="xfer,*1,?????????"/>
    <action application="digit_action_set_realm" data="xfer"/>
    <action application="digit_action_set_realm" data="xfer"/>
    <action application="read" data="2 11 'tone_stream://%(10000,0,350,440)' 
num 30000 #"/>
    <action application="bridge" data="user/${num}@${domain_name}"/>
  </condition>

</extension>

I have two problem with this dialplan
1. in secon `bind_digit_action` I can not use `exec` only `api`.
e.g. <action application="bind_digit_action" data="xfer,*1,exec:info"/> does 
not work.
application executes only when I return from first `exec:execute_extension`

2. I can not cancel bridge before answer

I can not use transfer because I do not whant leave conference
(e.g. user has `end_conference=true` flag).
I try use uuid_kill from Lua like "xfer,*1,lua:kill_legs.lua ${uuid}"

  -- kill_legs.lua
  local uuid = argv[1]
  local sql = ("select uuid from channels where call_uuid='%s' and 
uuid<>'%s'"):format(uuid, uuid)
  dbh:query(sql, function(row)
    local res = api:executeString("uuid_kill " .. row.uuid)
  end)

But this is does not work because it kills only active channels, 
but for dial-string like `loopback/111/my.domain,
[leg_delay_start=20]loopback/222/my.domain`
second channels creates only after 20 sec.
And because I may have more then one channels I can not use `originate_uuid`
In documentation I found `break` application but as I say I can not use it.
`uuid_break` api break only play audio.




Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list