简体   繁体   中英

How to make an application interact with Asterisk server to make a call?

I have project to write a application to make call, voice mail interact with asterisk server. I have search about Asterisk AGI . What do I do in Asterisk server and Android App?

AGI has nothing to do with this. You need a SIP library for Android, such as the one available in Android 2.3, or a third party one. You will then use the library to build your application and connect to a SIP server.

All you have to do to make Asterisk place a call for you is drop a text file in the outgoing spool directory of the Asterisk server. Asterisk will place the call as soon as you do.

Place the file in the following location:

/var/spool/asterisk/outgoing/

Channel:SIP/Phonenukmber@YourSipProvider
Context: context in your dialplan to place this call when it is answered
Exten: extension in that context to place call on
Priority: priority to start on, normally 1
Callerid: number to use when placing the call

There are several other values you can pass in look here for more information: http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out

This is by far the easy way of doing that does not require any programming interaction with Asterisk.

IF you need call from android phone, search for SIP library or sip softphone for android.

If you need control asterisks call from android, you have check AMI(manager interface) or write server-side API on your asterisk server and use it in your application.

You install the server and then write a client app that communicates with SIP. Use any of these open source projects to get started quickly.

http://www.codeplex.com/site/search?query=SIP&ac=2

Just install Asterisk and create some SIP peers. To make call to PSTN you need to have either VOIP trunk or analog trunk or ISDN trunk.

Once you have done the above, download the 3cx softphone from the Android App Market for your Android mobile, and register any SIP extension created in Asterisk.

For making calls you need to write dialplan based on your requirement. For newbies you can refer to the "Trixbox Without Tears" book, available in Google for free.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM