Jump to content


Photo
- - - - -

Asterisk message notifacation


  • Please log in to reply
18 replies to this topic

#1 greyarea

greyarea

    Dangerous free thinker

  • Banned
  • 886 posts
  • Location:xhp 602

Posted 25 September 2005 - 12:23 AM

Ok yo, my computer is still down and I don't have very much time these days online. What I want to do is very simple but I'm having a bit of trouble getting it done.


I'm asking for a little bit of help with this.

What I want to do is, everytime I recieve a new Voicemail on my asterisk server I want to have a email or sms sent to my cellphone.

So it would probally be something like
exten => 4,1,Voicemail
exten => 4,2,Sendemail (heh)

The reason being is my cellphone is hotlinked with the HLR so I can't send sms messages with my phone or make/recieve calls but I can recieve SMS and emails
to my handset for free. So I want to utilize this since I have no phone at home for the time being.

What I want to do is after the vm is left I want the calling party number sent to my phone. I figure I would have to use the DBput and DBget commands but I can't get it done right. Anyone have the time to help..? It might be easier just to run an AGI but I dunno.
late

#2 Yauch

Yauch

    elite

  • Members
  • 103 posts

Posted 25 September 2005 - 12:52 AM

This is'nt really an answer to you question but I just set up my phone to forward to my k7 voicemail. I'm sure there is a more elegant solution using astrisk.

#3 Majest|c

Majest|c

    Dangerous free thinker

  • Members
  • 883 posts

Posted 25 September 2005 - 12:57 AM

This is'nt really an answer to you question but I just set up my phone to forward to my k7 voicemail. I'm sure there is a more elegant solution using astrisk.

View Post


well you can do that from the handset of a cellphone, or even on a landlione, just forward the number! :grr:

#4 greyarea

greyarea

    Dangerous free thinker

  • Banned
  • 886 posts
  • Location:xhp 602

Posted 25 September 2005 - 02:24 AM

Ok yo, my computer is still down and I don't have very much time these days online.  What I want to do is very simple but I'm having a bit of trouble getting it done.


I'm asking for a little bit of help with this.

What I want to do is, everytime I recieve a new Voicemail on my asterisk server I want to have a email or sms sent to my cellphone.

So it would probally be something like
exten => 4,1,Voicemail
exten => 4,2,Sendemail  (heh)

The reason being is my cellphone is hotlinked with the HLR so I can't send sms messages with my phone or make/recieve calls but I can recieve SMS and emails
to my handset for free.  So I want to utilize this since I have no phone at home for the time being.

What I want to do is after the vm is left I want the calling party number sent to my phone.  I figure I would have to use the DBput and DBget commands but I can't get it done right.  Anyone have the time to help..? It might be easier just to run an AGI but I dunno.
late

View Post



no no guys, just trying to send a email or sms to my celly for notification of recieving a vm on my asterisk server, and my celly doesnt recieve incoming calls, using either a cron job to send the email or using an asterisk app.

heh strom you think that sentence was a run on..? :)
...

#5 darkslider

darkslider

    Gibson Hacker

  • Members
  • 93 posts

Posted 25 September 2005 - 02:24 AM

EMAILTO=7005554141@verizonsucks.edu


exten => s,1,system(sendmail ${EMAILTO}, ${CALLERIDNUM})
exten => s,2,VoicemailMain

Of course, you need sendmail installed.
This will only tell you when people call though, not if they leave a message.
Edit: I just found this http://mikecathey.com/code/vmnotify/

Edited by darkslider, 25 September 2005 - 02:27 AM.


#6 natas

natas

    De La Natas

  • Agents of the Revolution
  • 4,273 posts
  • Gender:Male
  • Location:The Old Skool

Posted 25 September 2005 - 02:30 AM

hmmm....one easy solution would be that you setup a k7 voicemail going to your cell phone providers email address and forward your incoming DID to that. so say you have tmobile you could sign up at k7 as your10digitnumber@tmomail.com.

what your asking is a good question and i would like to know how to do this with asterisk as well. im guessing the system command is really the way to go as you could execute sendmail or mail or whatever command line email prog you want.

#7 greyarea

greyarea

    Dangerous free thinker

  • Banned
  • 886 posts
  • Location:xhp 602

Posted 25 September 2005 - 02:50 AM

EMAILTO=7005554141@verizonsucks.edu


exten => s,1,system(sendmail ${EMAILTO}, ${CALLERIDNUM})
exten => s,2,VoicemailMain

Of course, you need sendmail installed.
This will only tell you when people call though, not if they leave a message.
Edit: I just found this http://mikecathey.com/code/vmnotify/

View Post



Thank you sir
fjear

#8 darkslider

darkslider

    Gibson Hacker

  • Members
  • 93 posts

Posted 25 September 2005 - 04:29 AM

I just realized you have to press enter after you type sendmail address@blah.net.
So this might be a better way to do it.

exten => s,1,system(echo hey, ${CALLERIDNUM} just called you >> sendme.txt)
exten => s,2,system(less sendme.txt | sendmail 7005554141@verizonsucks.net)
exten => s,2,VoicemailMain

Edited by darkslider, 25 September 2005 - 04:29 AM.


#9 Strom Carlson

Strom Carlson

    Nub

  • Members
  • 2,575 posts
  • Gender:Male
  • Location:Los Angeles

Posted 25 September 2005 - 04:34 AM

you can set this up in the voicemail.conf as follows so it will actually send you the recorded voicemail as an attachment:

2000 => xxxxx,Strom,stromcarlson@gmail.com,tz=pacific,attach=yes


Then, in your extensions.conf:

exten => 3115552368,1,Voicemail(2000)


EASY AS PIE.

#10 greyarea

greyarea

    Dangerous free thinker

  • Banned
  • 886 posts
  • Location:xhp 602

Posted 25 September 2005 - 05:12 AM

you can set this up in the voicemail.conf as follows so it will actually send you the recorded voicemail as an attachment:

2000 => xxxxx,Strom,stromcarlson@gmail.com,tz=pacific,attach=yes


Then, in your extensions.conf:

exten => 3115552368,1,Voicemail(2000)


EASY AS PIE.

View Post



heh I reconize that number strom :)
from one of the doorbell tapes when he was in canada calling bill with the call intercept that was forwarded to pass the CPN shown above, but... bill didnt see it.

I'm doing this now I wonder if it will send the CPN of the caller..? /me finding out.

#11 Strom Carlson

Strom Carlson

    Nub

  • Members
  • 2,575 posts
  • Gender:Male
  • Location:Los Angeles

Posted 25 September 2005 - 05:20 AM

heh I reconize that number strom :)
from one of the doorbell tapes when he was in canada calling bill with the call intercept that was forwarded to pass the CPN shown above, but... bill didnt see it.

I'm doing this now I wonder if it will send the CPN of the caller..? /me finding out.

View Post


(311) 555-2368 is the fake number that AT&T used in its ads from at least 1953 through 1984. There are ads dating back to at least the 1940s that have numbers which end "2368." The use of it by us phreaks is merely an inside joke :)

And yes, that should pass the CPN in the e-mail message.

#12 natas

natas

    De La Natas

  • Agents of the Revolution
  • 4,273 posts
  • Gender:Male
  • Location:The Old Skool

Posted 25 September 2005 - 10:13 AM

hey does anyone know how you could record a conversation and then once the call is through, have the conversation emailed to you? ive never attached anything to an email sent through the command line before.

#13 spoekalb

spoekalb

    DDP r0x0rz my s0x0rz

  • Agents of the Revolution
  • 1,280 posts
  • Gender:Male

Posted 25 September 2005 - 10:41 AM

hey does anyone know how you could record a conversation and then once the call is through, have the conversation emailed to you? ive never attached anything to an email sent through the command line before.

View Post

If it's a conversation you want, I could see two possibilities. The first is to modify the code for app voicemail() so that it (your new asterisk app) records both sides of the conversation and emails the resulting file just like app voicemail() does now. The second possibility is to use app monitor() to record the call, then email that file. A couple problems with this would be that app monitor() records both sides of the conversation separately, so you would have to combine the files before emailing. The other problem is making the email message.
From sendmail.org:

Subject: Q4.15 -- How do I create attachments with sendmail?
You don't. Sendmail is a mail transfer agent (MTA). Creating e-mail messages, including adding attachments or signatures, is the function of a mail user agent (MUA). Some popular MUAs include mutt, elm, exmh, Netscape, Eudora and Pine. Some specialized packages (metamail, some Perl modules, etc.) can also be used to create messages with attachments.

Most of the MUAs listed there are graphical, user-driven environments...

Edit:

If flags contains the letter m, then when recording finishes, Asterisk will execute a unix program to combine the two sound files into a single sound file.

So that solves one of the problems...

Then I found this app, I think it's only in CVS. Basically it records both sides to only one specified file...
http://bugs.digium.c...iew.php?id=4735

[Description]
MuxMon(<file>.<ext>[|<options>[|<command>]])

That would be handy because you can specify the filename so your MUA can always find the file.

Ok last edit I promise :)
Check this MUA out:
http://www.mutt.org/doc/man_page.html

Edited by BlakeOPS, 25 September 2005 - 10:53 AM.


#14 natas

natas

    De La Natas

  • Agents of the Revolution
  • 4,273 posts
  • Gender:Male
  • Location:The Old Skool

Posted 25 September 2005 - 11:42 AM

damn i cant get mutt to send the email without needing input from me.

edit: got it. $ mutt -s "subject" -a whatever.wav all@friends.org \
< body.txt

so you could easily have a box send you an email (forwarded to a cell phone so it works like an sms) everytime you got an incoming call or something by using the system command.

i want to figure out how to convert gsms and wavs to mp3s using sox now!

#15 darkslider

darkslider

    Gibson Hacker

  • Members
  • 93 posts

Posted 25 September 2005 - 12:37 PM

I just got this idea from Natas and BlakeOPS. Email attachments are usually encoded in UUENCODE or MIME. It's quite easy to translate a file to UUENCODE via command line.

Convert the file you want attached to a UUENCODEd file.

uuencode input.JPG dummy.file >> output.TXT

or

exten => s,1,system(uuencode input.JPG dummy.file >> ${CALLERIDNUM}.TXT)
So it makes the attachment have the callers number.

Which will put the encoded JPG in (callersnumberhere).TXT. It will look something like this:

begin 644 800-555-8355.TXT
M4DE&1E)[``!7059%9FUT(!`````!``$`P!(``,`2```!``@`9F%C=`0```#8
M>@``9&%T8=AZ``"`?X"`?W]_?X"!@8&!@H*"@H.!@(&!@8&"@8"`@("`?X"`
M?W]_?W]_?W^`?X"`@("`?WY_?GY]>WIZ>WMZ>GUZ>WIZ>GIZ>7EY>7IZ>GMZ
M>GI[>WMZ>GM[?7Y]?7Y]?GY_?W]_?X"`?X!_@("`@8&!@8&"@H*!@("!@(!_
A($-R86EG+"!H='1P.B\O=W=W+F=O;&1W879E+F-O;0``
`
end

Then, send it using a system call to sendmail.

#16 natas

natas

    De La Natas

  • Agents of the Revolution
  • 4,273 posts
  • Gender:Male
  • Location:The Old Skool

Posted 25 September 2005 - 12:53 PM

why use a jpeg though?

#17 darkslider

darkslider

    Gibson Hacker

  • Members
  • 93 posts

Posted 25 September 2005 - 04:10 PM

It was just an example. You can use any binary file type.

#18 natas

natas

    De La Natas

  • Agents of the Revolution
  • 4,273 posts
  • Gender:Male
  • Location:The Old Skool

Posted 25 September 2005 - 04:54 PM

oh ok. with mutt you can attach pretty much any kind of file with the -a switch and itll use MIME encoding i guess. thats what i did above anyways. it worked good.

#19 greyarea

greyarea

    Dangerous free thinker

  • Banned
  • 886 posts
  • Location:xhp 602

Posted 26 September 2005 - 04:03 AM

you can set this up in the voicemail.conf as follows so it will actually send you the recorded voicemail as an attachment:

2000 => xxxxx,Strom,stromcarlson@gmail.com,tz=pacific,attach=yes


Then, in your extensions.conf:

exten => 3115552368,1,Voicemail(2000)


EASY AS PIE.

View Post



hmm... It still isn't sending anything at all?
I wonder is there any other config files I need to touch?
I'm using qmail for the mail server on gentoo.
thanks again for everyones responses.
late

Oh and strom I like j0r shirt but mine is still cooler :) I'll post the pics later today.




BinRev is hosted by the great people at Lunarpages!