[Home]

Summary:ASTERISK-02479: [patch] Send email messages from within asterisk
Reporter:scaredycat (scaredycat)Labels:
Date Opened:2004-09-27 12:18:30Date Closed:2011-06-07 14:04:48
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) README
( 1) SendEmail-new.tar.gz
Description:Two apps

EmailMissedCall

Essentially used to email a user when someone called them and they didn't pick up/weren't around (they don't always leave a voicemail)...


SendEmail

Send a generic message from asterisk, maybe status messages etc...

Was written with sqlite in mind (although no db code in there). Used in conjunction with res_sqlite you could retrieve the users email address which would allow you do use this intelligently in macros...


Comments:By: Clod Patry (junky) 2004-09-27 23:28:11

i just tried the SendEmail.
i think there's a problem with the , char
cause i did the example ya gave in the README, and im only getting this into my email:
Something happend

so it misses a part (everything after the ,).

ya should ignore all , into the "body" option.


suggestion: that could be great if we can use tha app directly into the CLI.

edited on: 09-27-04 23:36

By: scaredycat (scaredycat) 2004-09-28 04:28:36

Sorry, my bad - putting , in the body! Should be \,

If you want a comma in the body/subject you'll need to escape it.

Uploaded a modified readme

By: scaredycat (scaredycat) 2004-09-28 09:50:55

Ok, updated

Added sending email from the * cli

eg:

email andy@cathouse.at.the.cattery "Test message" "Hi\n this is a test"

Can one of the bug marshals remove the files:

SendEmail.tar.gz (3,706 bytes) 09-27-04 12:18
README (822 bytes) 09-28-04 04:28

no longer needed.

By: Mark Spencer (markster) 2004-09-28 10:37:16

Can you also confirm you have a disclaimer on file?  Thanks.

By: scaredycat (scaredycat) 2004-09-28 11:17:40

Disclaimer faxed to LSS @ 18:17 CET on 28th September 2004

By: Olle Johansson (oej) 2004-10-06 07:05:49

Do we need YACF (yet another config file) or can this app use an existing file?
We send e-mail from app_voicemail as well, are we duplicating code here? We should be able to use the same setting for external mailer etc.

By: scaredycat (scaredycat) 2004-10-07 06:24:47

I agree oej, YACF is a PITA.. it could be merged with the setting in voicemail.conf but the app isn't entirely used for voicemail type messages and thus voicemail.conf doesn't really make sense, so....

Perhaps this is a good time to have something like applications.conf into which the configs go for all apps that have no real requirement for their own separate file (other than allowing the user to configure them).

eg:

applications.conf

[app-sendemail] (or [app-sendemail-general] if subsections are required)
; mailcmd=  ; alternate mailer command
mailfrom=Asterisk
mailsubject=Missed call from ${EM_CALLERID} on ${EM_DATE}
mailbody=Hi,\n\nYou missed a call on ${EM_EXTEN} from ${EM_CALLERID} on ${EM_DATE}.\n\nRegards\n\nAsterisk PBX\n

[app-anotherapps-config]
something=this
anotherthing=that

[more-apps]
blah=blah


since this is easy to implement and if adopted properly by developers should cause

a) no harm
b) a reduction in little config files

By: James Golovich (jamesgolovich) 2004-10-07 09:43:34

I think using features.conf would be more appropriate than adding YACF

By: Olle Johansson (oej) 2004-10-07 09:54:54

I thought that features.conf was the place for all small configs that didn't fit anywhere else, so maybe we should move some generic mail settings from voicemail.conf and add all of them to features.conf

By: Mark Spencer (markster) 2004-10-07 14:31:17

features.conf would be for core features.  Why does this need a configuration file at all?

By: scaredycat (scaredycat) 2004-10-07 16:39:03

Do I *really* need to answer that question?

By: Mark Spencer (markster) 2004-10-08 00:17:53

Okay, lets rephrase then:

Why do you need *another* config file instead of just using voicemail.conf for the few parameters?

Also, why a separate app for e-mailing a missed call rather than passing a string?

By: scaredycat (scaredycat) 2004-10-08 02:59:57

I don't believe that voicemail.conf is the appropriate place for these config items, the application has nothing to do with voicemail.

I agree having another config file isn't ideal, which is why I suggested applications.conf for all developers to put their configs in which would reduce the config file count for apps developed. Since you've already said features.conf is for core features we can't use that.

EmailMissedCall uses the body and subject from the config file, you only supply the email address - it makes for a tidier dialplan IMO, but more importantly I don't want to have to change the body or subject for an EmailMissedCall in 20 places in the dialplan where using the config for it allows me to do in in 1 place.

SendEmail was just a natural extension of the EmailMissedCall app. - someone was bound to ask "Why didn't you create a sendemail app too so I can create generic messages", I decided to add it in advance of that... so it's there as a separate app.

By: brc007 (brc007) 2004-10-09 05:12:27

I'm getting compiler errors with cvs HEAD as of an hour ago

"app_sendemail.c: In function `emailmissedcall_exec':
app_sendemail.c:247: error: structure has no member named `callerid'
app_sendemail.c:221: warning: unused variable `inum'
app_sendemail.c: In function `sendemail_exec':
app_sendemail.c:293: error: structure has no member named `callerid'
app_sendemail.c:295: error: structure has no member named `callerid'"

By: scaredycat (scaredycat) 2004-10-09 10:53:20

Yup, it wont work since ast_channel structure has changed yet again.

SC

By: Mark Spencer (markster) 2004-10-09 10:57:09

Should be an easy fix though.  We did branch head and stable, so that we could fix a lot of the long standing issues in Asterisk, so things will probably greatly be in flux on the devel side.

By: twisted (twisted) 2004-10-27 16:40:17

Can we get an update here?

By: scaredycat (scaredycat) 2004-11-02 04:51:02.000-0600

Try compiling again... either I'm going insane ... or.. well nothing... I've just upgraded to cvs of 02 Nov 2004 (Asterisk CVS-HEAD-11/02/04-12:06:58 ) and it compiles (and runs) fine.

edited on: 11-02-04 05:56

edited on: 11-02-04 06:03

By: twisted (twisted) 2004-11-14 21:50:35.000-0600

This too, can be done through a simple shell script.  While system() doesn't allow us to execute commands outright, (always fails), we can use scripts, with the proper exit codes.  IMO, adding apps for each thing we want to do can get a little cluttered in the system.

By: twisted (twisted) 2004-12-01 00:45:24.000-0600

Gonna require feedback or there is a chance of being closed.

--Housekeeping

By: Olle Johansson (oej) 2004-12-12 15:50:59.000-0600

submitter lost interest. Please reopen at your convienience!