Anda di halaman 1dari 3

AsteriskJava - ADempiere ERP Wiki

http://www.adempiere.com/index.php?title=AsteriskJava&printable=yes

From ADempiere ERP Wiki

1 Using Asterisk-Java to integrate with Asterisk 1.1 Outbound 1.1.1 Scenario 1.1.2 Solution 1.1.3 Design 1.1.4 Implementation 1.2 Inbound 2 See Also

Outbound
Scenario The ADempiere user wants to initiate a phone call to a customer from within ADempiere. She uses a SIP phone. Solution ADempiere talks to the Asterisk Manager API using the Asterisk-Java library (see http://asterisk-java.org). A request is sent to Asterisk to initiate a call to a certain phone number using a certain SIP phone. These data are passed via the interface. Design The necessary data for a connection are the host identification where Asterisk is living the Asterisk user for authentication the related password the channel to connect the call to ("SIP/11" e.g.) the Asterisk context to be used These are user specific. They could be maintained via an extra tab of the User window. The phone numbers to be called are found either on business partner location (four different) or on business partner user/contact (two different).

1 of 3

7/11/2012 4:11 PM

AsteriskJava - ADempiere ERP Wiki

http://www.adempiere.com/index.php?title=AsteriskJava&printable=yes

Implementation The user data will be kept within a new table named e.g. SIP_UserData. Example:
CREATE TABLE SIP_UserData ( SIP_UserData_ID NUMBER(10,0), AD_CLIENT_ID NUMBER(10,0), AD_ORG_ID NUMBER(10,0), CREATED DATE , CREATEDBY NUMBER(10,0), UPDATED DATE, UPDATEDBY NUMBER(10,0), ISACTIVE CHAR(1 BYTE), AD_USER_ID NUMBER(10,0), SIP_HOST NVARCHAR2(32), SIP_USER NVARCHAR2(32), SIP_PASS NVARCHAR2(32), SIP_CHAN NVARCHAR2(32), SIP_CONTEXT NVARCHAR2(32) )

The user data are maintained on a new tab of the User window. For the interaction with the Asterisk server the class AsteriskManager is used. See contributions tracker (http://sourceforge.net /tracker/?func=detail& aid=2812695& group_id=176962& atid=883808) item The method Extension of window User "initiateCall" can be used by a process (linked to a button) to send one of the phone numbers to Asterisk and connect to the defined channel for the user logged in to ADempiere. Example code skeleton:
loc = MBPartnerLocation( C_BPartnerLocation_ID ); astExten = loc.getPhone(); astData = X_XX_Asterisk_Data( xx_asterisk_data_id ); astChannel = astData.getAstChan(); astContext = astData.getAstContext(); asteriskManager = AsteriskManager(astData.getAstHost(),astData.getAstUser(),astData.getAstPass()); result = asteriskManager.initiateCall(astChannel, astContext, astExten, astPrority, astTimeout);

On the Asterisk side you have to put the necessary data into the configuration file manager.conf. Example:

2 of 3

7/11/2012 4:11 PM

AsteriskJava - ADempiere ERP Wiki

http://www.adempiere.com/index.php?title=AsteriskJava&printable=yes

; ; Asterisk Call Management support ; [general] enabled = yes port = 5038 bindaddr = 10.1.1.100 permit = 0.0.0.0/0.0.0.0 [gardenuser] secret = gardenpass ;deny=0.0.0.0/0.0.0.0 ;permit=209.16.236.73/255.255.255.0 read = system,call,log,verbose,command,agent,user write = system,call,log,verbose,command,agent,user

Inbound
TBD

Cli-CE_Project by Redhuan D. Oon Retrieved from "http://www.adempiere.com/AsteriskJava" Category: Projects and Tools This page was last modified on 3 December 2010, at 03:08. Content is available under GNU Free Documentation License 1.2.

3 of 3

7/11/2012 4:11 PM

Anda mungkin juga menyukai