I was fiddling with the command line and hoping to initiate (or originate) a call from the command line from an internal extension to an external phone number. The following works:
While this does work, CEL does not show the extension in its logs and the phone shows the IP address of the server as CID. I was wondering if the following were possible:
show the internal extension in the CEL log
show the external number as CID when the internal extension rings
ring internal extension first, then the external number
This is possible; just switch the two local channels.
The CLI version of originate doesn’t support caller ID or the setting of variables. If using it you need to use local channels that do these for you. An alternative would, for example, be to use AMI, which has more powerful originate support, or call files.
If you are doing click to call, note that many people do this, so I expect there to be many worked examples.
The keyword “extension” is in the wrong place. (Further hint: both internal extension and external number are extensions in Asterisk terminology.)
You are currently using local channels which run standard FreePBX dialplan. You would need to replace them with ones that ran customised dialplan, although it is conceivable that you could assemble that from FreePBX modules.