Record automatic originated calls

Hello there.
We have a bunch of analog telephones and a few softphones and IP-phones in our office. Analog telephones run by a telephone exchange Samsung OfficeServ 7200 connected to a FreePBX. FreePBX has extensions for each analog telephone for call recording. When I try to call manually from analog telephone call is being recorded, all is fine. But when I use “channel originate” command from Asterisk CLI FreePBX does not record this call. What can I do to record originated calls as well?

Unfortunately I’m not a telephone or Asterisk specialist and I’m not a native English speaker. So if you have an answer try to explain it simple. Thank you for your patience. : )

What exactly are you using for channels in the originate command? Using the channel:
Local/[email protected]

Should work

Originally I used command:
channel originate DAHDI/i2/134 extension [email protected]
Where 134 is local analog telephone and 8903XXXXXXX is my mobile phone. If I use:
channel originate local/[email protected] extension 8903XXXXXXX
Analog phone is ringing but when i pick it up IVR says something about “goodbye”, so I can’t call to my mobile phone. If command is:
channel originate local/[email protected] extension [email protected]
this looks weird, but works, analog phone is calling to mobile. However, call recording still doesn’t work.

I added CallerrID option to AMI request like this:

Action: Originate
Channel: DAHDI/i2/$hostnumber
Callerid: $hostnumber
Exten: $targetnumber
Context: from-internal

That worked, thank you very much. : )