Forward after 30 seconds

Hello community, I’m new to using Asterisk and for the company I work for, I have the task of forwarding to extension 0, and if the call is not answered within 30 seconds, it should redirect to extension 2000. I’ve tried several things and researched with AI, but nothing has worked for me. Could someone please be so kind as to help me? My Asterisk version is Asterisk Certified/16.8-cert12.

You could use the timeout option of the dial() application before dialiing 0.

1 Like

On Monday 13 January 2025 at 23:40:48, Freddy via Asterisk Community wrote:

Hello community, I’m new to using Asterisk

Welcome to the community.

The way these places work is that you show us the specifics of what you’re
trying to do and how you’re trying to do it, and if we can, we help out with
the details you haven’t quite got right. We don’t do the whole job for you.

I’ve tried several things and researched with AI

Very rarely an effective way of getting reliable and accurate information.

nothing has worked for me.

Well, show us what you’ve tried and we might be able to suggest what’s not
quite right with it.

Asterisk Certified/16.8-cert12.

In that case you should have an official support agreement with Sangoma; you
don’t need to ask on a volunteer support forum like this one. I’m not quite
sure what the support arrangements for such an old version of Asterisk are,
though. I’m also not sure whether “support” from Sangoma extends to writing
your dialplan for you.

https://docs.asterisk.org/About-the-Project/Asterisk-Versions/

Antony.


My life is going completely according to plan.

I do sometimes wish it had been my plan, though.

1 Like

Expanding on a previous comment about your version…

Asterisk 16 is no longer supported.

Certified versions are only for people with paid support contracts. They are only certified for certain features, and may not include some of the non-supported features at all,

For peer support, you should use the latest full release of Asterisk 20, 21, or 22.

If you were legitimately on this version, you probably had a support contract that lapsed. Otherwise you have misread “certified” as implying better.

1 Like

Hello everyone, here is the current configuration of these extensions:

For extension 0:

exten => 0,1,Answer()  
         same => n,GoSub(set-llamadas,s,1(${EXTEN}))  
         same => n,Set(Hora=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)})  
         same => n,NoOp(${Hora})  
         same => n,Set(QUEUE_MIN_PENALTY=0)  
         same => n,Set(QUEUE_RAISE_PENALTY=0)  
         same => n,Set(QUEUE_MAX_PENALTY=16)  
         same => n,ExecIf($[${ODBC_func_horas(1,${Hora})}=1]?Goto(HUNTER,2000,1):Queue(2261717,b(set-llamadas^ccabecera^1)))  
         same => n,Hangup()  

For extension 2000:

exten => 2000,1,Answer()  
        ;same => n,GoSub(set-llamadas,s,1(${EXTEN}))  
        same => n,Set(QUEUE_MIN_PENALTY=0)  
        same => n,Set(QUEUE_RAISE_PENALTY=0)  
        same => n,Set(QUEUE_MAX_PENALTY=16)  
        same => n,Set(Hora=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)})  
        same => n,ExecIf($[${ODBC_func_horas(1,${Hora})}=1]?Goto(HUNTER,3000,1):Queue(601-425-97ff,b(set-llamadas^ccabecera^5)))  
        same => n,Hangup()  

I have tried making changes to this line:

same => n,ExecIf($[${ODBC_func_horas(1,${Hora})}=1]?Goto(HUNTER,2000,1):Queue(2261717,b(set-llamadas^ccabecera^1)))  

by adding “,30” or “,t,30” after the final 1.

I have also tried adding a Wait(30) followed by a Goto(2000) but this only makes it wait before the call enters.

I also want to point out that currently, there is a direct forward in place so that outside of business hours, calls are transferred from extension 0 to extension 2000. However, my goal is to have calls during business hours ring for 30 seconds on extension 0, and if no one answers, the call should also be redirected to extension 2000.

On Tuesday 14 January 2025 at 22:01:17, Freddy via Asterisk Community wrote:

Hello everyone, here is the current configuration of these extensions:

exten => 0,1,Answer()

exten => 2000,1,Answer()

  1. you should get rid of those Answer() commands, because you do not want the
    call to be answered (as far as the caller is conncered) until a human has
    picked up a phone and answered (as far as Asterisk is concerned) the call.

  2. you have not shown anything which takes calls which went to extension 0, to
    extension 2000 after 30 seconds (which is what you said you wanted, in a
    different posting with a different subject).

  3. you also said “there is a direct forward in place so that outside of
    business hours, calls are transferred from extension 0 to extension 2000”.
    Show us where this is in the dial plan.

  4. Please do not open multiple threads about the same topic.

Antony.


The Internet Engineering Task Force (IETF) was formed on this day in 1986

1 Like

Thank you for your help. I’ll show you some changes I’ve tried, but none of them have worked. The configuration I shared earlier is the one these extensions had before I made any modifications. Here are some configurations I’ve attempted, but nothing has worked so far:

exten => 0,1,Answer() 
    ;same => n,GoSub(set-llamadas,s,1(${EXTEN}))
    same => n,Set(QUEUE_MIN_PENALTY=0)
    same => n,Set(QUEUE_RAISE_PENALTY=0)
    same => n,Set(QUEUE_MAX_PENALTY=16)
    same => n,Queue(2261717,b(set-llamadas^ccabecera^1),,30)  ; Waits 30 seconds before redirecting 
    same => n,GotoIf($["${QUEUESTATUS}" = "TIMEOUT"]?2000,1)  ; Redirects to extension 2000 if unanswered 
    same => n,Hangup()

This was another attempt. The issue is that the 30-second ringing on extension 0 doesn’t work:

exten => 0,1,Answer()
     same => n,Set(QUEUE_MIN_PENALTY=0)
     same => n,Set(QUEUE_RAISE_PENALTY=0)
     same => n,Set(QUEUE_MAX_PENALTY=16)
     same => n,Wait(30)  ; Waits 30 seconds
     same => n,Goto(2000,1)  ; Redirects to extension 2000

Please remember that I am entirely new to Asterisk. Don’t judge my inexperience with the configurations — I’m just a beginner.