Kai Herlemann
2020-Mar-26 20:50 UTC
[asterisk-users] E-Mail notification for each received call
Hi everybody, we use Asterisk to route all calls to a inbound phone number to a specific outbund mobile phone number, depending on time and date. I'd like to send a notification email to a specific email address, each time we receive a call. For this I used the tip of "dicko" here [1]. I'm a Asterisk newbie. Unfortunately it doesn't work. The System() command is not executed. I've tried to execute the a simple bash script for testing purposes (write a test string with > into a file, it's attached) - even that doesn't work. Even if I try it with System(/bin/bash <testfile>), it makes no difference. My test bash script and extension_custom.conf file is attached. This advice, which is is related to the first one, didn't help, too. [2] Our system is the most current FreePBX Distro release, Asterisk 16.9.0 and DAHDI. (We can't use VoIP, the communications department uses a proprietary protocol.) Also "core set debug"/"core set verbose" didn't help. Any help is appreciated. Kind regards, Kai [1] https://community.freepbx.org/t/send-email-or-sms-notification-for-every-inbound-hangup-call/45169 [2] https://community.freepbx.org/t/email-notification-of-incoming-missed-call/29913 -------------- next part -------------- #!/bin/bash cd ~asterisk echo test > /home/asterisk/test -------------- next part -------------- [macro-hangupcall-custom] exten => s,1,DumpChan() exten => s,n,System(/home/asterisk/bash_test) exten => s,n,MacroExit()
Administrator
2020-Mar-27 08:24 UTC
[asterisk-users] E-Mail notification for each received call
Le 26/03/2020 à 21:50, Kai Herlemann a écrit :> Hi everybody,Hi Kai> > we use Asterisk to route all calls to a inbound phone number to a > specific outbund mobile phone number, depending on time and date. I'd > like to send a notification email to a specific email address, each time > we receive a call. For this I used the tip of "dicko" here > [1]. I'm a Asterisk newbie. > Unfortunately it doesn't work. The System() command is not executed. > I've tried to execute the a simple bash script for testing purposes > (write a test string with > into a file, it's attached) - even that > doesn't work. Even if I try it with System(/bin/bash <testfile>), it > makes no difference. > My test bash script and extension_custom.conf file is attached. > This advice, which is is related to the first one, didn't help, too. [2] > > Our system is the most current FreePBX Distro release, Asterisk 16.9.0 > and DAHDI. (We can't use VoIP, the communications department uses a > proprietary protocol.) > Also "core set debug"/"core set verbose" didn't help. > > Any help is appreciated. > > Kind regards, > Kai > > [1] > https://community.freepbx.org/t/send-email-or-sms-notification-for-every-inbound-hangup-call/45169 > [2] > https://community.freepbx.org/t/email-notification-of-incoming-missed-call/29913Hangup is h extension. your macro will never be executed. Solution: same = n,Dial(whatever) same = n,[...]) same = n,Hangup exten = h,1,1,DumpChan() same = n,System(/home/asterisk/bash_test) -- Daniel
Kai Herlemann
2020-Mar-27 19:19 UTC
[asterisk-users] E-Mail notification for each received call
Hi Daniel, Am 27.03.20 um 09:24 schrieb Administrator:> Hangup is h extension. your macro will never be executed. Solution: > > same = n,Dial(whatever) > same = n,[...]) > same = n,Hangup > > exten = h,1,1,DumpChan() > same = n,System(/home/asterisk/bash_test)I don't really understand your code… I think I don't have to edit the first part of the conf file (" same n,Dial(whatever) "), you just mean the second part of the code is executed by "n,Hangup"? Then I have to add the second part to extensions_custom.conf, context [macro-hangupcall-custom]? (I cannot edit extensions_additional.conf where're the other settings/it doesn't make sense, because FreePBX overwrites it.) Probably you mean h,1,DumpChan() instead of h,1,1,DumpChan()? last line: same → same code like in the upper line up to "h", so it's "exten = h,…"? Kai