Limiting maximum call duration: have the call end 4 minutes after the agent accepts the call. Set(TIMEOUT(absolute)=240)

I am running an Asterisk/FreePBX with time conditions

  • timecondition-1 (durin working hours)
  • timecondition-2 (offhours)

timecondition-2 just runs ivr-3 that plays a message (no dial opportunities there)

timecondition-1 runs ivr-2 that plays a message for 20 seconds and transfers the call to a Ring Group (where the agents are)

(ivr-1 just plays a bussy message and returns the call to ivr-2)

I am not using Queues.

Anyway: I need to LIMIT the CALL DURATION to 4 minutes

I know this is done with:
exten => _1XX,1,NoOp(Limiting maximum call duration)
exten => _1XX,n,Set(TIMEOUT(absolute)=240)

BUT I DO NOT KNOW the proper CONTEXT to put it in ‘extensions_custom.conf’, for what I need.
I need to have the call end 4 minutes after the agents accepts the call.

The only way I can limit the call (from the moment it is answered by and agent from within the Ring Group) is when I put a contect [from-did-direct]
but this works only if and when the caller DIALS the extension number of the agent, and I can’t have this.
It needs to work ‘on it’s own’: with the call timeout trigered from the moment the call is answed by an agent from within the Ring Group.


Some excerpts from the verbocity

– Executing [XXXXXXXXXXXX@from-trunk:4] Goto(“SIP/telekomout-000000df”, “ext-did,s,1”) in new stack
; this is where the call comes in

– Executing [s@ext-did:21] Goto(“SIP/telekomout-000000df”, “timeconditions,1,1”) in new stack
; this is where it gets in the timecondition

– Executing [1@timeconditions:10] GotoIf(“SIP/telekomout-000000df”, “1?ivr-2,s,1”) in new stack
– Executing [s@ivr-2:1] Set(“SIP/telekomout-000000df”, “_IVR_CONTEXT_ivr-2=”) in new stack
; this is where it gets into the ivr-2

– Executing [t@ivr-2:1] Goto(“SIP/telekomout-000000df”, “ext-group,200,1”) in new stack
– Goto (ext-group,200,1)
; this is where it gets into the Ring Group

– Executing [s@macro-auto-blkvm:5] Set(“PJSIP/112-000000f0”, “FORWARD_CONTEXT=from-internal”) in new stack
– Executing [s@macro-auto-blkvm:6] Set(“PJSIP/112-000000f0”, “MASTER_CHANNEL(FORWARD_CONTEXT)=from-internal”) in new stack
; where it rings (the only avaialble extension in the Ring Group)

This is the only CONTEXT I have got it to work with
from-did-direct

[from-did-direct]
exten => _1XX,1,NoOp(Limiting maximum call duration)
exten => _1XX,2,Set(TIMEOUT(absolute)=10)

(placing it in: extensions_custom.conf, and dialing a working agent's extension, i.e. 112 while the IVR is playing the message)

Agents extension numbers are: 101, 102, 103 - 112
The Ring Group Number is: 200

Is there anything I need to enter in ‘Custom Destinations’?
Again, the point is to have the calls getting in from the Ring Group 200 ending (terminating, or rather timeouting) after 4 minutes (240 seconds)

Thanks!

I would do it with this in extensions_custom.conf:

[set-timeout]
exten => _x.,1,NoOp(Limiting maximum call duration to ${EXTEN} seconds)
exten => _x.,n,Set(TIMEOUT(absolute)=${EXTEN})
exten => _x.,n,Return

Then create a Custom Destination (with return enabled) with a dial string of:

set-timeout,240,1

In the GUI send callers to the Custom Destination before the Ring Group.

1 Like