# Bridging an existing conference to a new call

**URL:** <https://community.asterisk.org/t/bridging-an-existing-conference-to-a-new-call/76806>\
**Category:** Asterisk Support\
**Created:** [October 24, 2018, 2:12pm UTC](https://community.asterisk.org/t/bridging-an-existing-conference-to-a-new-call/76806 "2018-10-24T14:12:40Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![lardconcepts](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@lardconcepts](https://community.asterisk.org/u/lardconcepts)\
**Post date:** [October 25, 2018, 11:43am UTC](https://community.asterisk.org/t/bridging-an-existing-conference-to-a-new-call/76806/7 "2018-10-25T11:43:02Z")

</div>

Day 4 - nothing seems to work as documented.

I have updated my dialplan as follows. It makes the outgoing call, the remote end of the new call hears what they should, but 5 seconds after `same => n,ConfBridge(1234)` the new call is cleared down.

Let’s break this down and look at some dialplan and logs:

```auto
[bcab-local-conference]    
exten => s,1,Answer()
    same => n,Set(CONFBRIDGE(user,announce_join_leave)=no)
    same => n,Verbose(1,***NUMBER IN CONFERENCE IS ${CONFBRIDGE_INFO(parties,1234)})
    same => n,GotoIf($["${CONFBRIDGE_INFO(parties,1234)}" = "0"]?bcab-dial-zoom,s,1)
    same => n,ConfBridge(1234)  

[bcab-dial-zoom]
exten => s,1,Answer()
same => n,Dial(PJSIP/0123456789@voipfone-201,,U(bcab-send-dtmf)L(10000))
; the time limit (L) above does not seem to work

[bcab-send-dtmf]
    exten => s,1,Wait(1)
    same => n,SendDTMF(WW12345#WWWWW#WWWWW)
    same => n,Playback(technical-support)
    same => n,SendDTMF(#)
    same => n,SET(GOSUB_RESULT=GOTO:bcab-bridge-conference^s^1)
    same => n,Return()   

[bcab-bridge-conference]
exten => s,1,Verbose(1,*** Entered bcab-bridge-conference)
    same => n,Answer()
    same => n,Set(__BCAB_Outgoing_Conf_Channel=${DIALEDPEERNAME})
    same => n,Verbose(1,***Dialled channel after ANSWER in bcab-bridge-conference is ${BCAB_Outgoing_Conf_Channel})

    same => n,ConfBridge(1234) 
    ; nothing happens on the console after here, and the outgoing call is terminated
    same => n,Verbose(1,***DUMPING CHANNEL VARS after CONFBRIDGE in bcab-bridge-conference)
    same => n,Dumpchan() 
    same => n,Wait(55)
    same => n,Hangup()

```

Here’s what I see on the console:

```auto
-- Executing [13@6001:1] Answer("PJSIP/6001-0000003d", "") in new stack
       > 0x7efdf401df80 -- Strict RTP learning after remote address set to: 90.196.205.73:4010
    -- Executing [13@6001:2] Set("PJSIP/6001-0000003d", "CALLERID(name)=bcab") in new stack
    -- Executing [13@6001:3] Goto("PJSIP/6001-0000003d", "bcab-local-conference,s,1") in new stack
    -- Goto (bcab-local-conference,s,1)
    -- Executing [s@bcab-local-conference:1] Answer("PJSIP/6001-0000003d", "") in new stack
    -- Executing [s@bcab-local-conference:2] Set("PJSIP/6001-0000003d", "CONFBRIDGE(user,announce_join_leave)=no") in new stack
    -- Executing [s@bcab-local-conference:3] Verbose("PJSIP/6001-0000003d", "1,***NUMBER IN CONFERENCE IS 0") in new stack
 ***NUMBER IN CONFERENCE IS 0
    -- Executing [s@bcab-local-conference:4] GotoIf("PJSIP/6001-0000003d", "1?bcab-dial-zoom,s,1") in new stack
    -- Goto (bcab-dial-zoom,s,1)
    -- Executing [s@bcab-dial-zoom:1] Answer("PJSIP/6001-0000003d", "") in new stack
    -- Executing [s@bcab-dial-zoom:2] Dial("PJSIP/6001-0000003d", "PJSIP/0123456789@voipfone-201,,U(bcab-send-dtmf)L(10000)") in new stack
    -- Setting call duration limit to 10.000 seconds.
    -- Called PJSIP/0123456789@voipfone-201
    -- PJSIP/6001-0000003d requested media update control 26, passing it to PJSIP/voipfone-201-0000003e
       > 0x7efdf401df80 -- Strict RTP switching to RTP target address 90.196.205.73:4010 as source
       > 0x7efdf402db30 -- Strict RTP learning after remote address set to: 46.31.X.X:51912
    -- PJSIP/voipfone-201-0000003e is making progress passing it to PJSIP/6001-0000003d
    -- PJSIP/voipfone-201-0000003e is making progress passing it to PJSIP/6001-0000003d
       > 0x7efdf402db30 -- Strict RTP switching to RTP target address 46.31.X.X:51912 as source
       > 0x7efdf401df80 -- Strict RTP learning complete - Locking on source address 90.196.205.73:4010
    -- PJSIP/voipfone-201-0000003e answered PJSIP/6001-0000003d
    -- PJSIP/voipfone-201-0000003e Internal Gosub(bcab-send-dtmf,s,1) start
    -- Executing [s@bcab-send-dtmf:1] Wait("PJSIP/voipfone-201-0000003e", "1") in new stack
       > 0x7efdf402db30 -- Strict RTP learning complete - Locking on source address 46.31.X.X:51912
    -- Executing [s@bcab-send-dtmf:2] SendDTMF("PJSIP/voipfone-201-0000003e", "WW2222397064#WWWWW#WWWWW") in new stack
    -- Executing [s@bcab-send-dtmf:3] Playback("PJSIP/voipfone-201-0000003e", "technical-support") in new stack
    -- <PJSIP/voipfone-201-0000003e> Playing 'technical-support.alaw' (language 'en_GB')
    -- Executing [s@bcab-send-dtmf:4] SendDTMF("PJSIP/voipfone-201-0000003e", "#") in new stack
    -- Executing [s@bcab-send-dtmf:5] Set("PJSIP/voipfone-201-0000003e", "GOSUB_RESULT=GOTO:bcab-bridge-conference^s^1") in new stack
    -- Executing [s@bcab-send-dtmf:6] Return("PJSIP/voipfone-201-0000003e", "") in new stack
  == Spawn extension (fromvoipfone201, , 1) exited non-zero on 'PJSIP/voipfone-201-0000003e'
    -- PJSIP/voipfone-201-0000003e Internal Gosub(bcab-send-dtmf,s,1) complete GOSUB_RETVAL=
    -- Executing [s@bcab-bridge-conference:1] Verbose("PJSIP/6001-0000003d", "1,*** Entered bcab-bridge-conference") in new stack
 *** Entered bcab-bridge-conference
    -- Executing [s@bcab-bridge-conference:2] Answer("PJSIP/6001-0000003d", "") in new stack
    -- Executing [s@bcab-bridge-conference:3] Set("PJSIP/6001-0000003d", "__BCAB_Outgoing_Conf_Channel=PJSIP/voipfone-201-0000003e") in new stack
    -- Executing [s@bcab-bridge-conference:4] Verbose("PJSIP/6001-0000003d", "1,***Dialled channel after ANSWER in bcab-bridge-conference is PJSIP/voipfone-201-0000003e") in new stack
 ***Dialled channel after ANSWER in bcab-bridge-conference is PJSIP/voipfone-201-0000003e
    -- Executing [s@bcab-bridge-conference:5] ConfBridge("PJSIP/6001-0000003d", "1234") in new stack
    -- Channel CBAnn/1234-00000006;2 joined 'softmix' base-bridge <a8ffe6d4-1b3d-4fb4-aa3a-cd691a0d9063>
    -- <PJSIP/6001-0000003d> Playing 'conf-onlyperson.alaw' (language 'en_GB')
    -- <PJSIP/6001-0000003d> Playing 'confbridge-join.alaw' (language 'en_GB')
    -- <CBAnn/1234-00000006;1> Playing 'confbridge-join.gsm' (language 'en')
    -- Channel PJSIP/6001-0000003d joined 'softmix' base-bridge <a8ffe6d4-1b3d-4fb4-aa3a-cd691a0d9063>

```

At this point after a few seconds, the called channel (PJSIP/voipfone-201-0000003a) hears a “call ended” signal. Nothing is shown on the console.  
The call never lasts longer than 19 seconds.

When I turn psjip debugging on, this is what I see:

```auto
  == Spawn extension (fromvoipfone201, , 1) exited non-zero on 'PJSIP/voipfone-201-00000003'
    -- PJSIP/voipfone-201-00000003 Internal Gosub(bcab-send-dtmf,s,1) complete GOSUB_RETVAL=
<--- Transmitting SIP request (459 bytes) to UDP:46.31.X.X:5060 --->
BYE sip:0123456789@46.31.X.X SIP/2.0
Via: SIP/2.0/UDP 139.59.X.X:5060;rport;branch=z9hG4bKPja0f593d3-6a83-4fb6-800d-bbc2e54fbafe
From: <sip:30123456*201@sip.voipfone.net>;tag=e23b6c6b-da93-499b-9801-52955049a48c
To: <sip:0123456789@sip.voipfone.net>;tag=VF38b373b19e51e7a867614baf2245
Call-ID: 05bb5474-41e1-4164-9a9b-a1fac23ce847
CSeq: 14724 BYE
Reason: Q.850;cause=16
Max-Forwards: 70
User-Agent: Asterisk PBX 16.0.0
Content-Length: 0

    -- Executing [s@bcab-bridge-conference:1] Verbose("PJSIP/6001-00000002", "1,*** Entered bcab-bridge-conference") in new stack
 *** Entered bcab-bridge-conference
    -- Executing [s@bcab-bridge-conference:2] Answer("PJSIP/6001-00000002", "") in new stack
    -- Executing [s@bcab-bridge-conference:3] Set("PJSIP/6001-00000002", "__BCAB_Outgoing_Conf_Channel=PJSIP/voipfone-201-00000003") in new stack
    -- Executing [s@bcab-bridge-conference:4] Verbose("PJSIP/6001-00000002", "1,***Dialled channel after ANSWER in bcab-bridge-conference is PJSIP/voipfone-201-00000003") in new stack
 ***Dialled channel after ANSWER in bcab-bridge-conference is PJSIP/voipfone-201-00000003
    -- Executing [s@bcab-bridge-conference:5] ConfBridge("PJSIP/6001-00000002", "1234") in new stack
    -- Channel CBAnn/1234-00000001;2 joined 'softmix' base-bridge <82d26f3b-14c6-4c57-a688-5476724f5c57>
    -- <PJSIP/6001-00000002> Playing 'conf-onlyperson.alaw' (language 'en_GB')
<--- Received SIP response (509 bytes) from UDP:46.31.X.X:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 139.59.X.X:5060;branch=z9hG4bKPja0f593d3-6a83-4fb6-800d-bbc2e54fbafe;received=139.59.X.X;rport=5060
From: <sip:30123456*201@sip.voipfone.net>;tag=e23b6c6b-da93-499b-9801-52955049a48c
To: <sip:0123456789@sip.voipfone.net>;tag=VF38b373b19e51e7a867614baf2245
Call-ID: 05bb5474-41e1-4164-9a9b-a1fac23ce847
CSeq: 14724 BYE
User-Agent: Voipfone Sip Network
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:0123456789@46.31.X.X>
Content-Length: 0

    -- <PJSIP/6001-00000002> Playing 'confbridge-join.alaw' (language 'en_GB')
    -- <CBAnn/1234-00000001;1> Playing 'confbridge-join.gsm' (language 'en')
    -- Channel PJSIP/6001-00000002 joined 'softmix' base-bridge <82d26f3b-14c6-4c57-a688-5476724f5c57>

```

According to [https://support.sonus.net/display/uxapidoc/q.850+cause+codes+-+reference](https://support.sonus.net/display/uxapidoc/q.850+cause+codes+-+reference), Q850.16 is “normal call clearing”.

When I hang “my end” of the call (ie: the initiating call, not the outgoing call which was triggered), this is all that happens on the console.

```auto
    -- Channel PJSIP/6001-0000003d left 'softmix' base-bridge <a8ffe6d4-1b3d-4fb4-aa3a-cd691a0d9063>
    -- <CBAnn/1234-00000006;1> Playing 'confbridge-leave.gsm' (language 'en')
    -- Channel CBAnn/1234-00000006;2 left 'softmix' base-bridge <a8ffe6d4-1b3d-4fb4-aa3a-cd691a0d9063>

```

So a few questions here: what is causing the call to clear down as soon as the confbridge kicks in (whether L is set or not in DIAL)  
Why is it not obeying LIMIT? In the console doc for `core show application dial` (but missing from the online docs) it says, for option U:

> NOTE: You cannot use any additional action post answer options in  
> conjunction with this option. Also, pbx services are run on the peer  
> (called) channel, so you will not be able to set timeouts via the  
> ‘TIMEOUT()’ function in this routine.

If I understand this correctly, that makes U (and G) no use for this? In which case, what should I use to implement this?

I don’t understand what _“pbx services are run on the peer (called) channel”_ means, but while I understand “you will not be able to set timeouts via the ‘TIMEOUT()’ function”, that doesn’t explain why “LIMIT” isn’t working.

Really appreciate any help here.

---

_[View the full topic](https://community.asterisk.org/t/bridging-an-existing-conference-to-a-new-call/76806)._
