Thanks a ton, this really helped and it’s working well.
What if I want email to be sent after call hangup, not pre-dialling the call. If I try to send email when pre-calling, then I have two issues:
I am using sendEmail with an external SMTP relay, this causes dial plan to stop for few moments while trying to contact the relay server before call starts, so users are experiencing delay in calls now.
I would send emails based on call status. i.e.: send only if called party has missed the call.