Understanding the dialplan

Hi

i am experiencing a problem with agents in a queue not receiving calls because of the following dialplan:

exten => s,n(report2),Set(__TTL=${IF($[“foo${TTL}” = “foo”]?6:$[ ${TTL} - 1 ])})
exten => s,n,GotoIf($[ ${TTL} > 0 ]?continue)
exten => s,n,Wait(${RINGTIMER})

The TTL doesn’t return with a value grater then 0 and this hands at wait.

What exactly is foo${TTL} looking at, where is TTL programmed?

Regards

Hi,
You are asking this question in FreePBX community. However, you are referring to pure Asterisk functionality.
That is, you should raise it here.

its already raised on the Asterisk Community. However the problem only started after moving to FreePBX 13.

Regards

Asterisk Community replied and said to ask the dialplan developer. Please can any one assist with this issue, non of the agents in the queues are able to receive calls.

Regards

TTL is time to live. The first time a call references the macro user-callerid, it sets TTL to 6. Each time thereafter, when that macro is referenced, it decrements the TTL value by one, when it hits 0 the call is dropped. It is meant to prevent calls from going into an infinite loop.

In order for a call to be dropped when going to a queue, it would have to bounce around the system a few times, enter and exit different queues before being answered.

Thank you, I was able to figure it out as well.

How will one go about increasing the TTL limit of 6. Can you change it in the FreePBX gui?

Regards

No. Asterisk will forcefully hangup on you after 7 ‘depths’ in the same macro context. This can not be changed. Thus in FreePBX we set the value to 6 so that we do the hangup and you know why instead of Asterisk doing the hangup.

A recent update to core will probably fix this for you:
https://issues.freepbx.org/browse/FREEPBX-15840

It’s in edge, to upgrade core from edge:

fwconsole ma --edge upgrade core
fwconsole r

No. Asterisk will forcefully hangup on you after 7 ‘depths’ in the same macro context. This can not be changed. Thus in FreePBX we set the value to 6 so that we do the hangup and you know why instead of Asterisk doing the hangup.

I can’t replicated the 7 disconnects in the same macro context on Asterisk 13:

-- Executing [123@api-test:1] Macro("SIP/2000-00000006", "myloop") in new stack
-- Executing [s@macro-myloop:1] Playback("SIP/2000-00000006", "demo-echodone") in new stack
-- <SIP/2000-00000006> Playing 'demo-echodone.ulaw' (language 'en')
-- Executing [s@macro-myloop:2] Wait("SIP/2000-00000006", "2") in new stack
-- Executing [s@macro-myloop:3] Goto("SIP/2000-00000006", "1") in new stack
-- Goto (macro-myloop,s,1)
-- Executing [s@macro-myloop:1] Playback("SIP/2000-00000006", "demo-echodone") in new stack
-- <SIP/2000-00000006> Playing 'demo-echodone.ulaw' (language 'en')
-- Executing [s@macro-myloop:2] Wait("SIP/2000-00000006", "2") in new stack
-- Executing [s@macro-myloop:3] Goto("SIP/2000-00000006", "1") in new stack
-- Goto (macro-myloop,s,1)
-- Executing [s@macro-myloop:1] Playback("SIP/2000-00000006", "demo-echodone") in new stack
-- <SIP/2000-00000006> Playing 'demo-echodone.ulaw' (language 'en')
-- Executing [s@macro-myloop:2] Wait("SIP/2000-00000006", "2") in new stack
-- Executing [s@macro-myloop:3] Goto("SIP/2000-00000006", "1") in new stack
-- Goto (macro-myloop,s,1)
-- Executing [s@macro-myloop:1] Playback("SIP/2000-00000006", "demo-echodone") in new stack
-- <SIP/2000-00000006> Playing 'demo-echodone.ulaw' (language 'en')
-- Executing [s@macro-myloop:2] Wait("SIP/2000-00000006", "2") in new stack
-- Executing [s@macro-myloop:3] Goto("SIP/2000-00000006", "1") in new stack
-- Goto (macro-myloop,s,1)
-- Executing [s@macro-myloop:1] Playback("SIP/2000-00000006", "demo-echodone") in new stack
-- <SIP/2000-00000006> Playing 'demo-echodone.ulaw' (language 'en')
-- Executing [s@macro-myloop:2] Wait("SIP/2000-00000006", "2") in new stack
-- Executing [s@macro-myloop:3] Goto("SIP/2000-00000006", "1") in new stack
-- Goto (macro-myloop,s,1)
-- Executing [s@macro-myloop:1] Playback("SIP/2000-00000006", "demo-echodone") in new stack
-- <SIP/2000-00000006> Playing 'demo-echodone.ulaw' (language 'en')
-- Executing [s@macro-myloop:2] Wait("SIP/2000-00000006", "2") in new stack
-- Executing [s@macro-myloop:3] Goto("SIP/2000-00000006", "1") in new stack
-- Goto (macro-myloop,s,1)
-- Executing [s@macro-myloop:1] Playback("SIP/2000-00000006", "demo-echodone") in new stack
-- <SIP/2000-00000006> Playing 'demo-echodone.ulaw' (language 'en')
-- Executing [s@macro-myloop:2] Wait("SIP/2000-00000006", "2") in new stack
-- Executing [s@macro-myloop:3] Goto("SIP/2000-00000006", "1") in new stack
-- Goto (macro-myloop,s,1)
-- Executing [s@macro-myloop:1] Playback("SIP/2000-00000006", "demo-echodone") in new stack
-- <SIP/2000-00000006> Playing 'demo-echodone.ulaw' (language 'en')
-- Executing [s@macro-myloop:2] Wait("SIP/2000-00000006", "2") in new stack
-- Executing [s@macro-myloop:3] Goto("SIP/2000-00000006", "1") in new stack
-- Goto (macro-myloop,s,1)
-- Executing [s@macro-myloop:1] Playback("SIP/2000-00000006", "demo-echodone") in new stack
-- <SIP/2000-00000006> Playing 'demo-echodone.ulaw' (language 'en')
-- Executing [s@macro-myloop:2] Wait("SIP/2000-00000006", "2") in new stack
-- Executing [s@macro-myloop:3] Goto("SIP/2000-00000006", "1") in new stack
-- Goto (macro-myloop,s,1)
-- Executing [s@macro-myloop:1] Playback("SIP/2000-00000006", "demo-echodone") in new stack
-- <SIP/2000-00000006> Playing 'demo-echodone.ulaw' (language 'en')
-- Executing [s@macro-myloop:2] Wait("SIP/2000-00000006", "2") in new stack
-- Executing [s@macro-myloop:3] Goto("SIP/2000-00000006", "1") in new stack
-- Goto (macro-myloop,s,1)
-- Executing [s@macro-myloop:1] Playback("SIP/2000-00000006", "demo-echodone") in new stack
-- <SIP/2000-00000006> Playing 'demo-echodone.ulaw' (language 'en')

No call disconnect on Asterisk 13 after 11 loops in the same macro.

Am I understanding it correctly?

Regards

No. Thats a goto. Not a macro. This is a moot point anyways.