]> sjero.net Git - linphone/blob - java/common/org/linphone/core/LinphoneCoreListener.java
JNI DTMF listener
[linphone] / java / common / org / linphone / core / LinphoneCoreListener.java
1 /*
2 LinphoneCoreListener.java
3 Copyright (C) 2010  Belledonne Communications, Grenoble, France
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18  */
19 package org.linphone.core;
20
21
22 /**
23  * 
24  *This interface holds all callbacks that the application should implement. None is mandatory.
25  */
26 public interface LinphoneCoreListener {
27         /**< Ask the application some authentication information 
28          * @return */
29         void authInfoRequested(LinphoneCore lc,String realm,String username); 
30
31         /** General State notification  
32          * @param state LinphoneCore.State
33          * @return 
34          * */           
35         void globalState(LinphoneCore lc,LinphoneCore.GlobalState state, String message);
36
37         /** Call  State notification  
38          * @param state LinphoneCall.State
39          * @return 
40          * */           
41         void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State cstate,String message);
42
43         /**
44          * Call stats notification
45          */
46         void callStatsUpdated(LinphoneCore lc, LinphoneCall call, LinphoneCallStats stats);
47
48         /**
49          * Callback to display change in encryption state.
50          * @param encrypted true if all streams of the call are encrypted
51          * @param authenticationToken token like ZRTP SAS that may be displayed to user
52          */
53         void callEncryptionChanged(LinphoneCore lc, LinphoneCall call, boolean encrypted, String authenticationToken);
54
55         /**
56          * Registration state notification
57          * */
58         void registrationState(LinphoneCore lc, LinphoneProxyConfig cfg, LinphoneCore.RegistrationState cstate, String smessage);
59
60         /**
61          * Reports that a new subscription request has been received and wait for a decision. 
62          *Status on this subscription request is notified by changing policy for this friend
63          *@param lc LinphoneCore        
64          *@param lf LinphoneFriend corresponding to the subscriber
65          *@param url of the subscriber
66          * 
67          */
68         void newSubscriptionRequest(LinphoneCore lc, LinphoneFriend lf, String url);
69
70         /**
71          * Report status change for a friend previously added to LinphoneCore.
72          * @param lc LinphoneCore
73          * @param lf updated LinphoneFriend
74          */
75         void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf);
76
77         /**
78          * invoked when a new text message is received
79          * @param lc LinphoneCore
80          * @param  room         LinphoneChatRoom involved in this conversation. Can be be created by the framework in case the from is not present in any chat room.
81          * @param from          LinphoneAddress from
82          * @param message       incoming message
83          */
84         void textReceived(LinphoneCore lc, LinphoneChatRoom cr, LinphoneAddress from, String message);
85         
86         /**
87          * invoked when a new linphone chat message is received
88          * @param lc LinphoneCore
89          * @param  room         LinphoneChatRoom involved in this conversation. Can be be created by the framework in case the from is not present in any chat room.
90          * @param message       incoming linphone chat message message
91          */
92         void messageReceived(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message);
93
94         /**
95          * invoked when a new dtmf is received
96          * @param lc    LinphoneCore
97          * @param call  LinphoneCall involved in the dtmf sending
98          * @param dtmf  value of the dtmf sent
99          */
100         void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf);
101         
102         /**
103          * Invoked when echo cancalation calibration is completed
104          * @param lc LinphoneCore
105          * @param status 
106          * @param delay_ms echo delay
107          * @param data
108          */
109         void ecCalibrationStatus(LinphoneCore lc,LinphoneCore.EcCalibratorStatus status, int delay_ms, Object data);
110         /**
111          *  Report Notified message received for this identity.
112          *  @param lc LinphoneCore
113          *  @param call LinphoneCall in case the notify is part of a dialog, may be null
114          *  @param from LinphoneAddress the message comes from
115          *  @param event String the raw body of the notify event.
116          *  
117          */
118         void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event);
119
120         
121         /**< @Deprecated Notifies the application that it should show up
122          * @return */
123         void show(LinphoneCore lc);
124         /**< @Deprecated Callback that notifies various events with human readable text.
125          * @return */
126         void displayStatus(LinphoneCore lc,String message);
127
128         /**< @Deprecated Callback to display a message to the user 
129          * @return */
130         void displayMessage(LinphoneCore lc,String message);
131
132         /** @Deprecated Callback to display a warning to the user 
133          * @return */
134         void displayWarning(LinphoneCore lc,String message);
135
136 }
137