I'm implementing a lua script that is invoked for ESL (when there's no active call), dials to an external number, and when answered transfers the call to a local extension.
Done like that:
The call is made successfully, but there's a huge drawback: the first channel (to the external number) doesn't go through the dialplan.
We have rich outbound routes in the dialplan, skipping them is a problem.
So my question is: is there a way to make a call from lua (or ESL) to an external number in a way that the first leg will go through the domain's dialplan.
Thanks.
Done like that:
local session = freeswitch.Session("sofia/gateway/...")
session:transfer(extension, "XML", domain)
The call is made successfully, but there's a huge drawback: the first channel (to the external number) doesn't go through the dialplan.
We have rich outbound routes in the dialplan, skipping them is a problem.
So my question is: is there a way to make a call from lua (or ESL) to an external number in a way that the first leg will go through the domain's dialplan.
Thanks.