How to invoke dialplan functions from ARI

I’m trying to figure out how to invoke the PJSIP_DIAL_CONTACTS() function from the ARI, in order to get a formatted dial string of all PJSIP endpoints registered to a single extension. Is it possible to invoke Asterisk FUNCTIONS from the dialplan - and if so how?

How have you tried doing it so far?

I have tried

  1. placing the variables : PJSIP_DIALPLAN_CONTACTS value 123 in the body of the /create POST
  2. placing the variables : PJSIP_DIALPLAN_CONTACTS value 123 in the body of the /dial POST
  3. post channel/{channelId}/variable with variable=PJSIP_DIALPLAN_CONTACTS and value=123
  4. post channel/{channelId}/variable with variable=PJSIP_DIALPLAN_CONTACTS(123) and value=“”
  5. get channel/{channelId}/variable with variable=PJSIP_DIALPLAN_CONTACTS(123)

And none of the above have worked. Do you know how to call a Dialplan function (in particular PJSIP_DIALPLAN_CONTACTS) from the ARI?

The dialplan function is not “PJSIP_DIALPLAN_CONTACTS”. It is PJSIP_DIAL_CONTACTS. It can be retrieved using the variable route on asterisk[1] as "PJSIP_DIAL_CONTACTS(123).

[1] Asterisk - Asterisk Documentation