Dynamic Routes - Asterisk Command Question

I have a dynamic route I want to use before sending to a custom destination: app-queue-toggle,s,1

Source Type: Asterisk
Enable Substitutions: Yes
Asterisk Command:${SET(ARRAY(QUEUENO,QUEUEUSER)=${DYNROUTE_QNO},${DYNROUTE_EXTCID}))}

In app-queue-toggle,s,1 The variable QUEUEUSER is empty which I think is causing the treatment to try to log the agent to queue again, which it cannot since they are already logged in. I am trying to have this cause the agent to logout.

  • There are no errors in the dialplan that I can see.
  • I confirmed __DYNROUTE_QNO & __DYNROUTE_EXTCID are populated earlier in the call with the correct numbers.

I think the issue is the set|array command. I have not used it before, so I wonder if I have it wrong. I also haven’t used the Asterisk command part of dynamic routes, so it could be that too.
What am I missing?

I split the dynamic route in to two:

  • one sets queue number SET(QUEUENO=${DYNROUTE_QNO})
  • one sets queue user SET(QUEUEUSER=${DYNROUTE_EXTCID})

It works as expected. So maybe you cannot use ARRAY? Or maybe I am using it incorrectly? I am on FreePBX 15.0.37/Asterisk 16.13.0

If anyone has any ideas, they are appreciated.

Not sure if it’s the problem here, but the expression you shared in post 1 has an extra closing parentheses near the end.

1 Like

just noticed, oh boy :roll_eyes:. I’ll try and report back.

Embarrassing, but I should have looked at it outside of PuTTY and actually looked at it. Guess I am getting old after all. Thanks for the catch @lgaetz

1 Like

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