Pass a parameter with dynamic routes

FreePBX 16.
Were are able to pass some variables to our API and we return 0 or 1 and this then routes to the relevant IVR.

I need to be able pass a parameter back from our api ( an ext number ) and call that extension .

Is there a way to do this ?

Yes. If you populate the field, “Saved result variable name”, then whatever is returned from the URL will be stored in that variable. Generally you want to the API to return a single plain text value that you can work with directly.

So if the “Saved result variable name” is set to api_result, then you can reference it using a Dynroute substitution as [api_result], or anywhere within the call flow as asterisk variable ${DYNROUTE_api_result}

There is nothing in the GUI that would allow you to route a call to an Asterisk variable containing an extension number. To do that, you would need a Custom Destination to your own dialplan that ensures the returned value is a valid extension with a proper failover if it’s not.

Dynamic Routes User Guide - PBX GUI - Documentation (freepbx.org)

Hi,

Thanks for the help so far.

we have managed to extract a extension number from our database and set as ‘xxxx’ we pass this to a custom destination using crm-hangup,${DYNROUTE_xxx_xxx},1.

In the log we the parameters are passed correctly but the extension is not called )’ sent to invalid extension but no invalid handler: context,exten,priority’)

What are we missing here please.

The help shows

This is the Custom Destination to be published. It should be formatted exactly as you would put it in a goto statement, with context, exten, priority all included. An example might look like:
mycustom-app,s,1

What is the syntax please

Or am I doing this the wrong way.

Providing Great Debug - Support Services - Documentation (freepbx.org)

:kissing_smiling_eyes:

I’ll go through that tomorrow