Connecting external voice agent

Hi,

I have the following configuration:

An external SIP trunk is configured in freePBX. When I call the number xxxx89822 I see the incoming call in the asterisk debug console. Everything is fine so far.

Now I want to forward this incoming call to an external voice agent which is hosted in the cloud. To connect to the voice agent I have to make a http post call to their rest api to open a call queue for the voice agent. I get a call ID and with this call ID I can connect to the voice agent with callid@<sip.external.voiceagent.com>:5060

For every new call I get a new callid from the rest api of the voice agent. So I have to handle for every new incoming call in freebpx a new callid.

Is this possible in freebpx and which is the best way to configure this scenario in freepbx?

Thank you

This is an invalid SIP URI, did you mean:

[email protected]:5060

I would think that was possible with the custom destinations module, and possibly an AGI script, as well as the custom dialplan. The main difficulty will be extracting the callid (not to be confused with a SIP Call-ID) from the response, in a way that isn’t vulnerable to code injection attacks.