Skip to content
Snippets Groups Projects
Commit bd17dccc authored by Prasad's avatar Prasad
Browse files

Adding files

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 266 additions and 0 deletions
This software is a collective work consisting of following major Open Source Components:
asterisk-java.jar, jetty-all-server.jar, httpclient.jar, sqlite-jdbc.jar, log4j.jar, slf4j.jar and other maven libraries
each licensed under a separate Open Source License.
1. Asterisk Java library is licensed under Apache License 2.0.
2. Jetty All Server library is dual licensed under Apache License 2.0 and Eclipse License 1.0
3. HTTP Client, HTTP Client Cache, HTTP Core, HTTP MIME libraries are licensed under Apache License 2.0.
4. Sqlite JDBC library is licensed under Apache License 2.0.
5. log4j library is licensed under Apache License 2.0.
6. slf4j API and slf4j-log4j libraries are licensed under MIT License.
7. Commons Logging and Commons Codec libraries are licensed under Apache License 2.0.
8. Activation library is licensed under COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0.
9. JAVAX Annotation library is licensed under COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0.
10. JAVAX Glassfish library is licensed under COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0.
11. JAVAX Security Auth Message library is licensed under COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0.
12. JAVAX Servlet library is licensed under COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0.
13. JAVAX Activation library is licensed under Apache License 2.0.
14. Mail library is licensed under COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0.
\ No newline at end of file
This diff is collapsed.
Vtiger Asterisk Connector is light weight JAVA application used for routing calls that land on Asterisk to Vtiger. It
periodically posts the call events that are triggered by Asterisk and let Vtiger decide on the next action that needs
to be done.
Connector internally has two different JAVA applications
1. vtigeragi
2. vtigerwebapp
"vtigeragi" refers to Vtiger Asterisk Gateway Interface, it acts as an gateway between Asterisk and Vtiger.
It uses asterisk-java library and provides wrapper APIs to communicate with asterisk, listens to the events that are
triggered by asterisk. vtigeragi is listening for asterisk events on default port(4573).
Note:
To make vtigeragi default port as configurable port, fastagi.properties file needs to be included in class path with following contents.
* bindPort = 4573
For more information refer https://asterisk-java.org/tutorial/
"vtigerwebapp" is JAVA MAVEN web application, it is used by vtigeragi to communicate with Vtiger. All the events that are
triggered by vtigeragi is logged into connector database and same is posted to Vtiger. All the communication between
vtigeragi and vtigerwebapp is done using servlets. This uses JETTY server bundled within the application and runs on the
port that is configured in VtigerAsteriskConnector.properties file.
Connector uses Sqlite database handler to store events triggered by asterisk and local path info for call recording files.
Connector is designed to obfuscate the source files. For more information on obfuscation, please refer http://proguard.sourceforge.net/
Follow below steps to create and build the project from IDE.
1. vtigeragi
Create new java application in any IDE like NetBeans using existing source and set following project properties.
* Set Main Class = org.asteriskjava.Cli
* Include following libraries in class path
a. asterisk-java-1.0.0.M3.jar
b. commons-codec-1.6.jar
c. commons-logging-1.1.3.jar
d. httpclient-4.3.1.jar
e. httpclient-cache-4.3.1.jar
f. httpcore-4.3.jar
g. httpmime-4.3.1.jar
h. slf4j-api-1.6.1.jar
i. slf4j-log4j12-1.6.1.jar
j. log4j-1.2.16.jar
Once the properties are configured, use the build option in IDE to create a JAR file. For more information refer build.xml to know/change properties about the JAR file.
2. vtigerwebapp
Create new MAVEN web application in any IDE like NetBeans using existing source and set following properties.
* Copy existing pom.xml to newly created project/Create project using existing pom.xml
* Include following dependencies
a. asterisk-java-1.0.0.M3.jar
b. commons-logging-1.1.3.jar
c. javax.servlet-api-3.0.1.jar
d. jetty-all-server-8.1.14.v20131031.jar
e. org.jbundle.util.osgi.wrapped.org.apache.http.client-4.1.2.jar
f. slf4j-api-1.6.1.jar
g. log4j-1.2.16.jar
h. slf4j-log4j12-1.6.1.jar
* Copy the src folder from existing source to newly created project source
Once the properties are configured, use the build option in IDE to build the WAR file.
Once building process for both connector components are completed, then run package.sh script to generate distributable ZIP file.
\ No newline at end of file
#Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger= INFO, stdout
# A1 is set to be a ConsoleAppender.
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%t] %-5p %c %x - %m%n
File added
#!/bin/bash
VTIGER_COMP_1=vtigeragi
VTIGER_COMP_2=vtigerwebapp
VTIGER_COMP_1_JARNAME=vtigeragi.jar
PACKAGEFOLDER=package/
PACKAGENAME=VtigerAsteriskConnector
# To rebuild vtigeragi JAR by updating MANIFEST
VTIGER_COMP_1_TEMPFOLDER=vtigeragi_temp
mkdir $VTIGER_COMP_1_TEMPFOLDER/
cp $VTIGER_COMP_1/dist/$VTIGER_COMP_1_JARNAME $VTIGER_COMP_1_TEMPFOLDER/
cd $VTIGER_COMP_1_TEMPFOLDER/
jar xvf $VTIGER_COMP_1_JARNAME
rm -rf $VTIGER_COMP_1_JARNAME
cp ../$VTIGER_COMP_1/META-INF/MANIFEST.MF META-INF/MANIFEST.MF
# Force jar to pickup modified MANIFEST file during building using M option
jar cvfM $VTIGER_COMP_1_JARNAME *
echo vtigeragi jar rebuilt successfully
cd ../
# Copy rebuilt JAR to package folder
cp $VTIGER_COMP_1_TEMPFOLDER/$VTIGER_COMP_1_JARNAME $PACKAGEFOLDER/agi/
rm -rf $VTIGER_COMP_1_TEMPFOLDER/
# Copy classes of vtigerwebapp to package folder
cp -r $VTIGER_COMP_2/target/classes $PACKAGEFOLDER/webapps/
echo Copied $VTIGER_COMP_2 and $VTIGER_COMP_1 JAR to package folder successfully
# Build distributable ZIP
rm $PACKAGEFOLDER/webapps/classes/vtigerwebapp.map
cp -r $PACKAGEFOLDER $PACKAGENAME
zip -r $PACKAGENAME.zip $PACKAGENAME
rm -rf $PACKAGENAME
echo Package $PACKAGENAME.zip created successfully
This diff is collapsed.
/*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************/
Readme
==================
1. Edit conf/VtigerAsteriskConnector.properties and update the information.
2. Execute bin/start.sh
(To restart)
1. Execute bin/stop.sh
2. Execute bin/start.sh
/*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************/
version = 1.4
File added
#!/bin/sh
THISDIR=$(cd "$(dirname "$0")"; pwd)
cd $THISDIR
JAVAJARNAME=vtigeragi.jar
JAVAJARPATH=../agi/vtigeragi.jar
# Kill old process
JAVAPID=$(ps ax | grep $JAVAJARPATH | grep -v grep | head -1 | awk '{print $1}')
if [ "$JAVAPID" != "" ]
then
kill -15 $JAVAPID
fi
if [ "$1" != "stop" ]
then
java -jar ../agi/$JAVAJARNAME
fi
#!/bin/bash
THISDIR=$(cd "$(dirname "$0")"; pwd)
cd $THISDIR
date="$(date +'%Y%m%d')"
nohup "${THISDIR}/webapp.sh" > ../logs/nohup.webapp.${date}.out 2>&1 &
nohup "${THISDIR}/agi.sh" > ../logs/nohup.agi.${date}.out 2>&1 &
#!/bin/sh
THISDIR=$(cd "$(dirname "$0")"; pwd)
cd $THISDIR
sh ${THISDIR}/webapp.sh stop
sh ${THISDIR}/agi.sh stop
#!/bin/sh
THISDIR=$(cd "$(dirname "$0")"; pwd)
cd $THISDIR
JAVACLASS=com.vtiger.apps.asterisk.webapp.helpers.ServerRunner
JAVACP=../webapps/classes:"../lib/*"
# Kill old process
JAVAPID=$(ps ax | grep $JAVACLASS | grep -v grep | head -1 | awk '{print $1}')
if [ "$JAVAPID" != "" ]
then
kill -15 $JAVAPID
fi
if [ "$1" != "stop" ]
then
java -cp $JAVACP $JAVACLASS
fi
/*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************/
// Location where the application server will be running.
ServerIP = 0.0.0.0
ServerPort =
// Call Recordings storage path
StorageDir =
// Enable(true) or Disable(false) call recordings
Recording = true
// Location where the applications database files will be stored.
AsteriskAppDBPath =
// Asterisk Server Details
AsteriskServerPublicIP =
AsteriskServerIP =
AsteriskServerPort =
AsteriskUsername =
AsteriskPassword =
// Vtiger CRM URL
VtigerURL =
VtigerSecretKey =
//Enable(true) or Disable(false) Asterisk Events and Database Logs in Connector
AsteriskLog = true
DatabaseLog = true
File added
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment