There doesn't seem to be a way to create a "Call logged" feed item on the Case, if you are not creating it from UI (or logged through CTI calls, details below).
Based on some quick tests below are my observations.
Whenever a call is logged from UI, a Task with SubType "Call" and Status "Completed" gets created. Additionally a FeedItem is created with Type as CallLogPost and thus is visible in the Case Feed. And that based on this knowledge article, it seems that Feed Item records are created only from UI or a workflow:
Call Logs are closed tasks and you can only create the feed item that way via the "Create Call Log" button in the UI or via workflow updating the original call log task. If you go and edit the task via standard UI edit, the feed sees the resulting record as a generic task, not a call log -- and you get the feed item formatted the way you experienced.
However, if you create a Task with same values, say from Developer Console, the FeedItem record that gets created is of type CreateRecordEvent (if you have feed tracking enabled), and that this Type is not applicable for Case Feed (refer to the documentation on Type in the FeedItem's documentation where a list of values are mentioned those are applicable for Case Feed).
The documentation though mentions that a FeedItem with Type as CallLogPost does get created from CTI calls. So you should be able to see the feed item while logging CTI calls based on this.
CallLogPost—generated event when a user logs a call for a case through the user interface. CTI calls also generate this event.
Unfortunately, you cannot create the FeedItem with Type field set to CallLogPost and that this field is not update-able.
So, in summary, any calls logged from UI or through CTI calls should be able to generate a "Call Logged" feed item on Case.
before insert
trigger onTask
to changeTaskSubtype
, the published feed item will reflect the original subtype - i.e. it's not a normal sort of process run off the inserted sObject.