Difference between revisions of "AsteriskJava"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
(related Asterisk config)
(Image showing extension of window User)
Line 44: Line 44:
 
)
 
)
 
</pre>
 
</pre>
 +
* The user data are maintained on a new tab of the User window. [[Image:User_xx_asteriskdata.jpg|Extension of window User]]
 
* For the interaction with the Asterisk server the class AsteriskManager is used. <br />See contributions [https://sourceforge.net/tracker/?func=detail&aid=2812695&group_id=176962&atid=883808 tracker] item
 
* For the interaction with the Asterisk server the class AsteriskManager is used. <br />See contributions [https://sourceforge.net/tracker/?func=detail&aid=2812695&group_id=176962&atid=883808 tracker] item
  

Revision as of 02:39, 28 June 2009

Using Asterisk-Java to integrate with Asterisk

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 Asterik-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).

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. Extension of window User
  • For the interaction with the Asterisk server the class AsteriskManager is used.
    See contributions tracker item
  • The method "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.
  • On the Asterisk side you have to put the necessary data into the configuration file manager.conf.

Example:

;                                                                               
; 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