Giter Site home page Giter Site logo

legart / asterisk-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from asterisk-java/asterisk-java

0.0 2.0 0.0 17.04 MB

The free Java library for Asterisk PBX integration.

Home Page: http://asterisk-java.org

License: Apache License 2.0

PHP 0.02% Java 99.95% JavaScript 0.02% Groovy 0.02%

asterisk-java's Introduction

README for Asterisk-Java

INTRODUCTION

The Asterisk-Java package consists of a set of Java classes that allow you to easily build Java applications that interact with an Asterisk PBX Server. Asterisk-Java supports both interfaces that Asterisk provides for this scenario: The FastAGI protocol and the Manager API.

The FastAGI implementation supports all commands currently available from Asterisk.

The Manager API implementation supports receiving events from the Asterisk server (e.g. call progess, registered peers, channel state) and sending actions to Asterisk (e.g. originate call, agent login/logoff, start/stop voice recording).

A complete list of the available events and actions is available in the javadocs.

See docs/tutorial.html for examples.

GETTING ASTERISK-JAVA

Asterisk-Java is available from http://asterisk-java.org

INSTALLATION FROM SOURCE

git clone https://github.com/srt/asterisk-java.git
cd asterisk-java
mvn install

After the build is complete, the jar will then be built as target/asterisk-java.jar in the asterisk-java directory.

EXAMPLE

The file 'examples/ExampleCallIn.java' will answer the call and playback the audio file 'tt-monkeys'.

import org.asteriskjava.fastagi.AgiChannel;
import org.asteriskjava.fastagi.AgiException;
import org.asteriskjava.fastagi.AgiRequest;
import org.asteriskjava.fastagi.BaseAgiScript;
/* Example incoming call handler
Answer call, speak message */
public class ExampleCallIn extends BaseAgiScript {
  public void service(AgiRequest request, AgiChannel channel) throws AgiException {
    answer();
    exec("Playback", "tt-monkeys"); 
    hangup();
  }
}

The file 'examples/fastagi-mapping.properties' maps your Asterisk diaplan context to the class you would like to invoke above.

callin.agi = ExampleCallIn

To compile and run do:

javac -cp asterisk-java.jar ExampleCallIn.java
java -cp asterisk-java.jar org.asteriskjavafastagi.DefaultAgiServer

SYSTEM REQUIREMENTS

Asterisk-Java needs a Java Virtual Machine of at least version 1.6 (Java SE 6.0). If you want to build the jar from source, you will also need Maven.

LEGAL

Asterisk-Java is subject to the terms detailed in the license agreement accompanying it.

asterisk-java's People

Contributors

danieldbower avatar jsgoecke avatar juradoz avatar legart avatar sprior avatar srt avatar videanuadrian avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.