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
Administrator
2020-Mar-28 12:30 UTC
[asterisk-users] E-Mail notification for each received call
Le 27/03/2020 à 20:19, Kai Herlemann a écrit :> 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"?Yes. h exetnsion is executed when call is hanged up https://www.voip-info.org/asterisk-h-extension/> 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.)Don't knowFreePBX and I don't have your diaplan. You can't put the exten = h stanza in a macro as a called macro always start with s,1,blabla You have another solution which is to add the call to System before the dial if it's easier for you.> Probably you mean h,1,DumpChan() instead of h,1,1,DumpChan()?Yes, sorry, typo.> last line: same → same code like in the upper line up to "h", so it's > "exten = h,…"?No, same is an asterisk dialplan cmd. As you don't seems to know it forget about and use exten = h,n,... -- Daniel
Kai Herlemann
2020-Apr-10 21:06 UTC
[asterisk-users] E-Mail notification for each received call
Hi Daniel & others, thank you Daniel, I solved my problem now (already 1-2 weeks ago). I'd like to share it with this list to help other people with a related problem: Am 28.03.20 um 13:30 schrieb Administrator:>> 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.) > > Don't knowFreePBX and I don't have your diaplan. You can't put the > exten = h stanza in a macro as a called macro always start with > s,1,blabla > > You have another solution which is to add the call to System before > the dial if it's easier for you.This advice was right. I tried it already before writing to this list, but I had problems with that. At first, I created the file extension_custom.conf as attached. Very related to the file in my first mail. Then, I created in FreePBX a dummy extension "1111". After that, I entered in the "advanced" section in the "Dial:" field the following string: "local/s at send-email". By that way, the custom code will be executed. Let's say my actual number is 1234 (it's not the real one, but I use an example for privacy reasons). I activated, of course, the "Find me/Follow me" section of the extension 1234 in FreePBX (Enabled = yes). Then, I entered in the Follow-Me List 1111 _AND_ 1234. Additionally, I set as destination in case of no answer a Time Condition. (All calls are forwarded, the destination of is depend to the time condition - using the calender setting in that module itself is not possible in this case.) Also the 1111 dummy extension has a time condition as destination, like the 1234 one – I think, in one case it's not necessary (I thought so at first in one of this cases), but it works. I used for the inbound route as destination the 1234 extension. If you have a related problem, maybe it's not enough information to solve it – if you need, you can send me a mail (or better answer to the list). Cheers, Kai -------------- next part -------------- [send-email] exten => s,1,NoOp(Entering user defined context [send-email] in extensions_custom.conf) exten => s,n,System(/usr/local/bin/e-mail-notification '${CALLERID(name)}' '${CALLERID(number)}') exten => s,n,hangup()