Gosub doesn't get called

I’ve developed a subroutine for a PBX, and everything works fine.
It’s a simple subroutine for call recording, via MixMonitor.


recondemand => *9,caller,Gosub(hash-custom-record,recondemand,1)


DYNAMIC_FEATURES => recondemand
; sub recondemand - Custom recording feature for the PBX:
exten => recondemand,1,Noop(Custom recording action - Running in ${CONTEXT} at ${EXTEN})
same  => 2,Read(digs,/etc/asterisk/custom/sounds/wave-entercode,0,1,,60)

same  => 3,GotoIf($["${digs}"="0"]?4:7)
same  => 4,StopMixMonitor
same  => 5,StopMonitor
same  => 6,Return()

same  => 7,MixMonitor(/home/asterisk/monitor/${digs}.wav49,b)
same  => 8,Return()

exten => t,1,playback(timeout-msg)
exten => t,n,Hangup()

On this PBX the configuration above works just fine, so I copied that conf on another PBX where I need the same feature.

But, on this other PBX, the Gosub doesn’t get called.

The DTMF are detected, I see the DTMF on the Asterisk CLI, but they are just ignored. Nothing happens after the DTMF signals.

If I try to call some other feature (even another Gosub) it works as expected.
But, my recondemand no, the “*9” DTMFs are detected but nothing happens after.

What can I check?
There is some option in Asterisk .conf files that can prevent my Gosub to get called?

Thank you for your help

Does ‘caller’ = 0 in features.conf?

No, there is nothing like that, I’m sorry

You might try using ‘self’ (without the quotes) in place of ‘caller’. The other option is ‘peer’ for the opposite trigger.

I tried with “peer” and “self”, but nothing changed.

The weird thing is that, in features.conf, I’ve also this:

hash-automon => *1,caller,Gosub(hash-special,hash-automon,1)

and works.

This doesn’t works instead:

recondemand => *9,caller,Gosub(hash-custom-record,recondemand,1)

If I replace the hash-automon called Gosub, it works:

hash-automon => *1,caller,Gosub(hash-custom-record,recondemand,1)

I tried to assign to DYNAMIC_FEATURES all the possible values:

  • “recondemand”
  • “hash-automon”
  • “hash-automon#recondemand”

Idk what else I can check, it seems that this is a weird bug, I executed a “core restart when convenient”, maybe restarting Asterisk will solve the problem (I can’t do a "core restart now " because this is a call center PBX system in production).

I’ll keep this topic updated. Thank you

At the end I found out that the problem was DYNAMIC_FEATURES.

The software that runs on top of Asterisk (via AGI) was doing weird things with the DYNAMIC_FEATURES variable.

Thank you @cable for the help

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.