same => n,System(echo -e 'Body Callback from:\\n ${CALLERID(num)} (${CALLERID(name)}) \\n on ${STRFTIME(${EPOCH},,%d.%m.%Y at %H:%M:%S)}' | mail -s "Subject Callback ${CALLERID(num)} - PBX" -r from@mail.com to@mail.com)
Most of the time the from@mail.com is important so you e-mail-server will not reject that email on the way out.
Use as you did in the Vitalpbx email Settings.
And do what PitzKey said to keep on going with the destination you put in at the Custom Context module.
my apolgies, here is my working context, when customer application invoked, this will send email with the callerID to zammad and also send a notification
you need to make few changes based on your zammad CTI URL and customer test you want to send
now, I am just trying to figure it how to use bash (awk) command in context
I want to add caller ID in the file /tmp/caller.txt file when context is invoked, here is my test, no errors, but doesn’t work, could some please guide me to the documentation to learn context scripting
If this is working on cli/shell then this might be a permissions problem. There you mostly are “root” but in dialplans you are usually “asterisk”. You can check with “whoami” command.
Executing [app-incoming@sub-set-call-vars:2] GotoIf(“PJSIP/1001_1-00000023”, “0?:return”) in new stack
– Goto (sub-set-call-vars,app-incoming,6)
– Executing [app-incoming@sub-set-call-vars:6] Return(“PJSIP/1001_1-00000023”, “”) in new stack
– Executing [60010@cos-all-post:2] NoOp(“PJSIP/1001_1-00000023”, “Custom Application: service-noti-email-60010”) in new stack
– Executing [60010@cos-all-post:3] Goto(“PJSIP/1001_1-00000023”, “custom-contexts,cc-19,1”) in new stack
– Goto (custom-contexts,cc-19,1)
– Executing [cc-19@custom-contexts:1] NoOp(“PJSIP/1001_1-00000023”, “service-noti-email-60010”) in new stack
– Executing [cc-19@custom-contexts:2] Gosub(“PJSIP/1001_1-00000023”, “service-noti-email-60010,s,1(app-termination,hangup,1)”) in new stack
- Executing [s@service-noti-email-60010:1] TrySystem(“PJSIP/1001_1-00000023”, “echo Test1001 > test.txt”) in new stack
no, please check whoami in dialplan and get the output with NOOP for example.
Set the right permissions (chown and chmod) to your text.txt
Use Full path to test.txt in dialplan.