Send an e-mail to the asterisk to make it call my cell phone


I’m new to asterisk and I’d like to know how to implement my cheap cell phone calls gateway :wink:

I want to send an e-mail to the asterisk server to make it call my cell phone. Then I want a dialtone to make an outgoing call.

Is it possible ?

I can make my SMTP server (postfix) run a program upon the reception of an e-mail to a particular address if Asterisk doesn’t support e-mail reception.

Thanks a lot,


I forgot to say that I’ve got free incoming calls on my cell phone and I want to be able to make cheap long distance calls.

Another question. To make asterisk call my cell phone when I’m out of town, it has to dial a phone number first and then wait for a dial tone and then dial my cell phone number. How do I make it dial something like this ?

Thanks again,


Asterisk doesn’t have the ability to read email, but there’s no reason you can’t setup an email server program, and on receipt of the email, extract text to a file that makes an outcall.

What most people seem to miss is that Asterisk is less of an application, and more of a development environment. You can make it do anything if you’re willing to do the developement.

Don’t automatically assume that Asterisk will do all the work. It can work alongside any application that you can run on your OS. Using other (already created) applications is a lot easier than re-inventing the wheel.

Oh, and the Dial() command has a D(digits) switch that will send the digits of your cell phone number to the new system as DTMF.

Click here for more about how to use the dial command. … k+cmd+Dial

Ok…That’s what I thought but How can I tell Asterisk to place a phone call ?

you said something about creating files ? I’m a little confused!

Can you just give me some hints!

Thanks a lot!



What you’re looking for are something called .call files.

They are files that are formatted to tell Asterisk to place a call. All the information about the destination of the call, and the features (context) that the call can use are inside.

They are created and copied to the /var/spool/asterisk/outgoing, and as SOON as they are placed there, Asterisk will place a call.

Click here for more about the dial-out feature. … o-dial+out

Another way to think about it and I use this, is to have a web page that is password protected that runs on the same server as your Asterisk server. Using a simple perl script you can have the number entered into a form on this page, drop that number into a .call file that places a call your phone with a dial tone waiting for you when you pick up.

Actually, this is easier than using mail for the same purpose. Just have to have an httpd server running, perl installed and the right form.


Hi again,

I’ve got some more questions. How do I make asterisk to place a call that when answered sends a dialtone and wait for a phone number to call ?

thanks again,


Do you know how to make asterisk dial out using a .call file? You need to start there for starters.

Can you do that first step?


Bulgin :

Yes, That worked fine!

But there is nothing happening when I answer the phone on the other side and I don`t understand the logic behind extensions.conf to make what I want.



Hi, I too have the same request of Chandi! I would like to send an e-mail to Asterisk and it makes a phone call to my cell phone number. It is not necessary that the call reproduces the voice of the text I wrote in the e-mail. Even a standard audio file.
I read about the creation of these files. call. Here I write the phone number to ring and the voice from play.
What I do not understand is how to tell Asterisk to initiate the file. call!
He should make this phone call at my command.
It would be ideal receipt of an email.
Is it possible? Or are there alternatives to do this?

Thank you all!

Very interesting subject.

My question, what should I put in the dial plan so that when I answer the asterisk call it gives me a dial tone where I would be able to enter an extension or any external number?

Try the DISA application.

I don’t know, i think you have to create the files .call with a difference phone number!

Thanks, I tried the DISA application but it needs to call an external number as if it were an extension of the PBX, right?
I don’t know if DISA manages the mail!


No, DISA doesn’t handle any e-mail.

I haven’t read the rest of this thread, so this may have already been stated…

You probably want to have some python script or other just check a pop or imap mailbox and when it gets an e-mail, or gets an e-mail that matches whatever you’re going to match on in the script, generates a call file, and drops it in the Asterisk outgoing spool directory. You’d probably do an Originate into the DISA application.


Nsaluzzo,chandi :
You can add entry in “postfix-aliases” file.
Below is the example I used in my system:
xyz "|/var/www/html/tools/mail/script.php"
When I send email to, it triggers the “script.php” which reads your email information and creates the .call file.

I am having problem with DISA when asterisk call me, when I hear the dial tone and press any key it gives me busy tone (I am using no-password in DISA).

ah, then you already have a system similar to what I need?
Can you send me this script.php naturally covering your personal information? If this isn’t a problem for you!


This is my script.php
I assume that the callback number in the subject filed of the email


<?php header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); getMail(); $ext = $subject; $stm = date("YmdHis", time()); $fn = "/var/spool/asterisk/outgoing/$"; $fp = fopen( $fn , "wb" ); $t = "Channel: Local/$ext@custom-auto-dial-out\nExtension: 12\nCallerID: DISA\nPriority: 1\nMaxRetries: 5\nRetryTime: 300\nWaitTime: 120\nContext: custom-auto-dial-out-context\n"; fwrite( $fp, $t); fclose( $fp ); ?>

and the context:

exten => 12,1,Answer()
exten => 12,n,DISA(no-password,from-internal)

Ok, thank you!! But I have to install and configure DISA for this script? If yes,I have to configure it in a particular way?
Thank you very much jalmod


From the usage of DISA: … ation_DISA

Perhaps you’re operating in a context that doesn’t like the digit you entered? It matches incorrectly or isn’t handled?

I think DISA comes with asterisk, in my system, I have not done any DISA installation.

DISA works fine when I use it from local extension, but it is not working when I use it from external line (PSTN).