public class webphone
JVoIP SIP Stack public interface. This webphone class contains the available API functions.
Home page: https://www.mizu-voip.com/Software/SIPSDK/JavaSIPSDK.aspx
Documentation:
PDF: https://www.mizu-voip.com/Portals/0/Files/JVoIP.pdf
CHM: https://www.mizu-voip.com/Portals/0/Files/JVoIP.chm
HTML: https://www.mizu-voip.com/Portals/0/Files/documentation/jvoip/index.html
Example code: https://www.mizu-voip.com/Portals/0/Files/JVoIPTest.java
We recommend to use the documentation as a reference as it is much better structured and more up to date.
Also the parameters are not listed here. See the documentation for the complete list of available settings ("Parameters" chapter).
Constructor Summary | |
---|---|
webphone()
Constructor to create a new SIP stack. Usually you need only one instance in your application since it has multi-account and multi-line capabilities, but if you need, you can create also multiple instances. The constructor will only create an empty phone instances. |
Method Summary | |
---|---|
boolean | API_Accept()
Connect incoming call. |
boolean | API_Accept(int line)
Connect incoming call on the specified line. |
boolean | API_Accept(int line,
int calltype)
Connect incoming call. |
boolean | API_Accept(int line,
int calltype,
int strict)
Connect incoming call. |
boolean | API_Accept(int line,
int calltype,
int audiodirection,
int videodirection)
Connect incoming call. |
boolean | API_Accept(int line,
int calltype,
int strict,
int audiodirection,
int videodirection)
Connect incoming call. |
boolean | API_AddContact(java.lang.String params)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean | API_AddLog(int level,
java.lang.String text)
Add to sip stack log. |
boolean | API_AddLog(java.lang.String text)
Add to sip stack log. |
boolean | API_AddToBlacklist(java.lang.String str)
Add user to blacklist |
boolean | API_AddToWhitelist(java.lang.String str)
Add user to whitelist |
boolean | API_AddVideo()
Add video media for an existing voice call. |
boolean | API_AddVideo(int line,
int type,
int direction)
Add video media for an existing voice call. Can be also used as video reload if it was put on hold before. |
boolean | API_AudioDevice()
Open audio device selector dialog (built-in user interface). This function will not work with the headless version (the headless is for library/SDK or command line usage and it doesn’t have any built-in GUI). |
boolean | API_Call(int line,
java.lang.String number)
Initiate call to a number or sip username. If the number parameter is empty, then will redial the last number. Note: usually you should pass only the peer number, extension or username to this function and not the full SIP URI (the SIP stack will construct the full SIP URI with the serveraddress already set) |
boolean | API_Call(int line,
java.lang.String peer,
int type)
Initiate call to a number or sip username. If the number parameter is empty, then will redial the last number. Note: usually you should pass only the peer number, extension or username to this function and not the full SIP URI (the SIP stack will construct the full SIP URI with the serveraddress already set) |
boolean | API_Call(int line,
java.lang.String peer,
int type,
int audiodirection,
int videodirection)
Initiate call to a number or sip username. If the number parameter is empty, then will redial the last number. Note: usually you should pass only the peer number, extension or username to this function and not the full SIP URI (the SIP stack will construct the full SIP URI with the serveraddress already set) |
boolean | API_Call(java.lang.String number)
Initiate call to a number or sip username. If the number parameter is empty, then will redial the last number. Note: usually you should pass only the peer number, extension or username to this function and not the full SIP URI (the SIP stack will construct the full SIP URI with the serveraddress already set) |
int | API_CallIDToLine(java.lang.String callid)
Get the line number for a SIP Call-ID. |
boolean | API_CapabilityRequest()
Will send an OPTION request to the server. |
boolean | API_CapabilityRequest(java.lang.String server,
java.lang.String username)
Request server or server capabilities with SIP OPTIONS. Rarely needed if any. |
boolean | API_Chat(java.lang.String peer)
Instead of calling the API_SendChat function and pass a message, with this function you can let the voip client to open its built-in chat form. Will open the chat dialog (the “number” parameter can be empty) Peer can be a SIP username or extension number. This function will not work with the headless version (the headless is for library or command line usage and it doesn’t have any built-in GUI). |
boolean | API_CheckBLF(java.lang.String userlist)
To subscribe to other extensions call state, you can set the blfuserlist parameter or use the API_CheckBLF(userlist) to subscribe to other extension(s) state changes (users separated by comma). User(s) passed by the userlist parameters will be added to the existing blfuserlist. |
void | API_CheckConnection()
Verify connection state and reregister if required. Should be called from app activated and screen turned on events for the quickest possible reregistration if previous registration failed (for example due to dosing or OS paused) |
boolean | API_CheckPresence(java.lang.String userlist)
Call this function to save softswitch resources, you should carefully select the contacts. (Send only the contacts which are actually used and called numbers. |
boolean | API_CheckVoicemail()
Will (re)subscribe for voicemail notifications. |
boolean | API_CheckVoicemail(int line)
Will (re)subscribe for voicemail notifications. |
boolean | API_ClearCredentials()
Clear existing user account details. |
boolean | API_Conf(java.lang.String number)
Create conference call by adding number to the current call. |
boolean | API_ConfEx(int line,
java.lang.String number,
boolean add,
int confline)
Add/remove people to/from conference. |
boolean | API_DelContact(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean | API_DelSettings(int level)
Delete settings and data. |
boolean | API_DisableBLF(java.lang.String userlist)
Remove extension(s) from BLF watch list (blfuserlist). Note: existing BLF subscriptions might not be affected until next session. |
boolean | API_Dtmf(int line,
java.lang.String dtmf)
Send DTMF message by In-Band,SIP INFO or RFC2833 method (depending on the “dtmfmode” parameter). |
boolean | API_ED137PTT(int line,
int ptt,
int pttid)
ED-137 Push to talk |
void | API_Exit()
Will destroy the SIP stack. |
void | API_ExitEx()
Will destroy the SIP stack and also will exit the Java Virtial Machine. Should not be used. |
boolean | API_Forward(int line,
java.lang.String peer)
Forward incoming call to peer (with 302 Moved Temporarily disconnect code) |
int | API_GetAccountRegState(java.lang.String domain,
java.lang.String proxy,
java.lang.String username,
java.lang.String sipusername,
boolean pushnotify,
boolean strict)
Query account register state. |
java.lang.String | API_GetAccountRegStateString(java.lang.String domain,
java.lang.String proxy,
java.lang.String username,
java.lang.String sipusername,
boolean pushnotify,
boolean strict)
Query account register state. |
java.lang.String | API_GetAddress()
Query local address. |
java.lang.String | API_GetAltWorkdir()
Query the application alternative working directory (such as folder on external SD card). |
java.lang.String | API_GetAudioDevice(int dev)
Query the current audio device name. |
java.lang.String | API_GetAudioDeviceList(int dev)
Query the list of available audio devices. Note: usually you don’t need to use this function. |
java.lang.String | API_GetBindir()
Query the application path (folder with the app binaries or app home folder) |
java.lang.String | API_GetBlacklist()
Query the current blacklist |
int | API_GetBuildNumber()
Get the BUILDNUMBER |
java.lang.String | API_GetCallerID()
Query the peer Caller ID. |
java.lang.String | API_GetCallerID(int line)
Query the peer Caller ID. |
java.lang.String | API_GetConfigHash()
Get a has value of the configuration. Should not be used. |
java.lang.String | API_GetContact(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String | API_GetContactName(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String | API_GetContactPhone(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String | API_GetContactPresence(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String | API_GetContactPresenceStr(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String | API_GetContacts()
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String | API_GetContactSIP(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String | API_GetContactSpeedDial(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
int | API_GetCurrentConnectedCallCount()
Query the number of simultaneous calls currently in progress. |
java.lang.String | API_GetDeviceID()
Get device identifier. |
java.lang.String | API_GetDiscReasonText(java.lang.String line)
Query the disconnect reason of the last disconnected call. |
int | API_GetExeVersion()
Get the SDK version |
java.lang.String | API_GetGlobalStatus()
Helper function to ask for the SIP stack state/details. |
java.lang.String | API_GetIncomingDisplay(int line)
Get incoming caller id (might return two lines: caller id \n caller name) |
int | API_GetIncomingVideoEndpoint(int line)
Return line number of the incoming video call if any, otherwise -1. |
java.lang.String | API_GetLastCallDetails()
Get details about the last finished call. |
java.lang.String | API_GetLastRecFileName()
Query recently recorded file. |
java.lang.String | API_GetLastRecInvite()
Get last received INVITE message. |
java.lang.String | API_GetLastRecSIPMessage(java.lang.String line)
Get last received SIP message. |
java.lang.String | API_GetLastSentInvite()
Get last sent INVITE message. |
int | API_GetLine()
Get the currently active line. This should be the line which you have set previously except after incoming and outgoing calls (the SIP client will automatically switch the active line to a new free line for these if the current active line is already occupied by a call). |
java.lang.String | API_GetLineDetails(int line)
Get details about a line. |
java.lang.String | API_GetLineParameter(int line,
java.lang.String param)
Get line specific parameter for a specific current/next/all line. |
int | API_GetLineStatus(int line)
Query the state of a line. Note: this is rarely needed since you receive the status also by event notifications |
java.lang.String | API_GetLineStatusText(int line)
Query the state of a line. Note: this is rarely needed since you receive the status also by event notifications |
java.lang.String | API_GetLogPath()
Query the application log file path. |
java.lang.String | API_GetMAC()
Get the device MAC address if possible. Some devices will forbid access to MAC address |
byte[] | API_GetMedia(int timeout)
|
java.lang.String | API_GetMySIPURI(boolean all)
Get the SIP URI on which the current endpoint can be reached such as username@server.com or username@localip:port. |
SIPNotification | API_GetNotification()
Return the next notification object. |
java.lang.String | API_GetNotificationStrings()
Return the notification strings. |
java.lang.String | API_GetParameter(java.lang.String param)
Query parameter. Note: some basic parameters should be set before the Start function have been called (such as “register”), however most parameters can be also changed at run-time. |
java.lang.String | API_GetPresenceStatus()
Query local presence state. |
java.lang.String | API_GetProfileStatusText(java.lang.String username)
Get the profile status text for this user. |
java.lang.String | API_GetRegFailReason()
Query the reason of the last failed registration. |
java.lang.String | API_GetRegFailReason(boolean extended)
Query the reason of the last failed registration. |
java.lang.String | API_GetSDPField(int line,
java.lang.String field)
|
java.lang.String | API_GetSIPHeader(int line,
java.lang.String hdr)
Return a sip header value received by JVoIP. |
java.lang.String | API_GetSIPMessage(int line,
int dir,
int type)
Return the last received or sent SIP signaling message as raw text. |
java.lang.String | API_GetStatus(int line)
Returns line state or global state if you pass -2 as line parameter |
java.lang.String | API_GetStatus(int line,
int strict)
Returns line state or global state if you pass -2 as line parameter |
int | API_GetStatusId(int line)
Returns line state or global state id. Should not be used (use the API_GetStatus instead) |
java.lang.String | API_GetVersion()
Get the SIP stack version number. |
java.lang.String | API_GetVideoDevice()
Query the video device in use. |
java.lang.String | API_GetVideoDeviceList()
Query video recording devices. |
java.lang.String | API_GetVideoDeviceList(int async,
boolean strict)
Query video recording devices. |
int | API_GetVideoEndpoint(int line)
Return line number for the video call if any, otherwise -1. |
java.lang.String | API_GetVideoRTPAddrForPlayback()
Return the rtsp socket address. |
int | API_GetVolume(int dev,
int line)
Get Volume level |
java.lang.String | API_GetWhitelist()
Query the current whitelist |
java.lang.String | API_GetWorkdir()
Query the application working directory (data folder) Based on appcontext.getFilesDir().getPath() and Environment.getDataDirectory().getPath(); |
boolean | API_Hangup()
Disconnect call. |
boolean | API_Hangup(int line)
Disconnect current call(s). |
boolean | API_Hangup(int line,
java.lang.String reason)
Disconnect current call(s). |
boolean | API_HasCallInProgress()
Query of there is any call in progress (including calls in ringing or connected state). |
boolean | API_HasCallInSpeaking()
Query of there is any connected call. |
int | API_HiddenLine()
Query hiddel endpoint channel. Hidden calls are usually the result of barge-in calls. |
boolean | API_Hold()
Put call on hold. |
boolean | API_Hold(int line)
Put call on hold. |
boolean | API_Hold(int line,
boolean hold)
Put call on hold. |
boolean | API_Hold(int line,
int direction)
Put call on hold. |
boolean | API_Hold(int line,
int direction,
int media)
Put call on hold. |
boolean | API_HoldChange(int line)
Togle hold state of the call. |
boolean | API_HoldEx(int line,
int direction,
int media)
Put call on hold. |
java.lang.String | API_HTTPGet(java.lang.String uri)
Send a HTTP GET request. |
boolean | API_HTTPPost(java.lang.String uri,
java.lang.String data)
Send a HTTP POST request. |
java.lang.String | API_HTTPReq(java.lang.String uri,
java.lang.String data)
Send a HTTP POST or GET request. |
boolean | API_HTTPReqAsync(java.lang.String uri,
java.lang.String data)
Send a HTTP POST or GET request. |
boolean | API_Ignore(int line)
Ignore incoming call. |
boolean | API_Info(int line,
java.lang.String msg)
Send custom INFO message (for DTMF use the API_Dtmf function instead). |
int | API_IsEncrypted()
Check if the connection is encrypted. |
int | API_IsInCall()
Query of there is any call in progress. |
boolean | API_IsIncomingVideo()
Check if current incoming call is video call. |
int | API_IsMuted(int line)
Return if the selected line is muted or not. |
int | API_IsOnHold(int line)
Query if the selected line is on hold or not |
boolean | API_IsOnline()
Query online state. This is not the same with the register state (It can return true even if not registered) |
boolean | API_IsRegistered()
Get the registered state. |
int | API_IsRegisteredEx()
Get the extended registered state. |
boolean | API_IsSpeaking()
Query of there is any connected call. |
java.lang.String | API_LineToCallID(int line)
Get the SIP Call-ID for a line number. Note: will return the current default line if the line number is 0 or negative. |
java.lang.String | API_LoadFile(java.lang.String filename)
Load file content from local disk. |
boolean | API_LoadFileRemote(java.lang.String filename)
Load file from remote storage. The download process is performed asynchronously. You need to call this function only once and then a few seconds later call the API_LoadFile function with the same file name. It will contain “ERROR: reason” text if the download failed. |
java.lang.String | API_LoadFileRemoteSync(java.lang.String filename)
Will download the specified file from remote storage synchronously (will block until done or fails). |
boolean | API_MightStop()
You might call this functions if your app might terminate soon. This will just make sure that the internal SIP stack settings are properly saved and the sipstack is prepared for an unexpected termination. Note: this function will NOT unregister or stop the SIP stack, because in some circumstances it might be better to let the app running in the background until possible to still listen for incoming calls. |
boolean | API_Mute(int line,
boolean mute)
Mute current call. |
boolean | API_Mute(int line,
boolean mute,
int what)
Mute current call. Same as the Mute API. |
boolean | API_NATKeepAlive(java.lang.String server)
Rarely needed if any, because the siptack will do it automatically. |
boolean | API_NeedRatingRequest()
Some servers might report call rating automatically in signaling. |
boolean | API_NewUser(java.lang.String user)
On newuser, you should ask the user if wish to accept it. |
boolean | API_NoUnregister()
Signal that no unregistration is needed. For example you might call this before to stop the SIP stack if you don't wish that the server to be notified. |
boolean | API_NumExists()
Use this only with the Mizu Softswitch. On first start you might call API_NumExists. If using the Mizu VoIP server, then it will return all existing contacts with SERVERCONTACTS,userlist notification where userlist are populated with the valid users and their online status. |
SIPNotification | API_ParseNotification(java.lang.String notificationstring)
Helper function to convert notification String to SIPNotification object |
boolean | API_PlaySound(int start,
java.lang.String file,
int loop,
boolean async,
boolean localfile,
boolean toremotepeer,
int line,
java.lang.String audiodevice,
boolean isring)
Play any sound file. At least wave files are supported in the following format: PCM SIGNED 8000.0 Hz (8 kHz) 16 bit mono (2 bytes/frame) in little-endian (128 kbits). This function can be used to play audio locally, but also for remote streaming. For remote playback, make sure to force a narrowband codec if your file is narrowband and wideband codec (speex, opus) if your file is wideband (16 kHz, 16 bit mono in little-endian). The file must be found locally. |
SIPNotification | API_PollNotification()
Return the next notification object if any. |
java.lang.String | API_PollNotificationStrings()
Return the notification strings. |
boolean | API_PushContactlist(java.lang.String userlist)
User for presence. Call this to pass all the usernames and phonenumbers from your external contact list if any. This is necessary, because for existing contacts JVoIP can accept the requests automatically, while for other it might ask for user permission |
boolean | API_RecFiles_Clear()
Delete old recorded files. |
boolean | API_RecFiles_Del()
Delete local recorded files. |
java.lang.String | API_RecFiles_List()
List pending voice record files. |
boolean | API_RecFiles_Upload()
Upload pending recorded files (if ftp/http URI was set) |
boolean | API_Register()
Set parameters for authentication and register to the SIP server. Will connect to the SIP server. |
boolean | API_Register(java.lang.String server,
java.lang.String username,
java.lang.String password,
java.lang.String authusername,
java.lang.String displayname,
boolean async)
Set parameters for authentication and register to the SIP server. Will connect to the SIP server. |
boolean | API_Registered()
Get the registered state. |
boolean | API_RegisterEx(java.lang.String accounts)
You can use this function for multiple secondary accounts (up to 99) on the same or other servers. Instead of this function you can just set the “extraregisteraccounts” parameter to the same value. |
boolean | API_Reject(int line)
Reject incoming call. You could also use the Hangup API function for this. |
boolean | API_RejectEx(int line,
java.lang.String reasontext)
Reject incoming call. You could also use the Hangup API function for this. Will reject the call only if the line strictly match an incoming channel number. |
boolean | API_ReStart()
Will restart the SIP stack. |
boolean | API_RTPHeaderExtension(int line,
int profile,
int extension)
Set RTP header extension for the RTP packets |
java.lang.String | API_RTPStat(int line)
Query for media quality reports. |
boolean | API_SaveFile(java.lang.String filename,
java.lang.String content)
Will save the text file to local disk in the working directory in encrypted format (use API_SaveFileRaw to save as-is) |
boolean | API_SaveFileRaw(java.lang.String filename,
java.lang.String content)
Will save the text file to local disk in the working directory as is. |
boolean | API_SaveFileRemote(java.lang.String filename,
java.lang.String content)
Save file to remote storage (preconfigured ftp or http server ) |
boolean | API_SendChat(int line,
java.lang.String number,
java.lang.String message)
Send a instant message. |
boolean | API_SendChat(int line,
java.lang.String number,
java.lang.String group,
java.lang.String message,
int msgid)
Group messaging. |
boolean | API_SendChatIsComposing(int line,
java.lang.String number)
Send IM typing notification. |
boolean | API_SendSIP(java.lang.String msg)
Send custom SIP signaling message (for example OPTIONS, NOTIFY, etc) on the current active line. |
boolean | API_SendSIPMessage(int line,
java.lang.String msg,
java.lang.String body,
java.lang.String account,
java.lang.String target)
Send custom SIP signaling message. |
boolean | API_SendSMS(int line,
java.lang.String number,
java.lang.String message,
int msgid)
Send a SMS message if softswitch has SMS delivery capabilities (Otherwise might try to deliver as IM). The message is delivered as a standard SIP MESSAGE with X-Sms: Yes header. |
boolean | API_SendUSSD(int line,
java.lang.String method,
java.lang.String ussd)
Send USSD message (After the IMS 3GPP TS 24.390 standard) |
boolean | API_SendVideoRTP(int line,
byte[] buffer,
int length)
Stream video to remote peer by passing video RTP packets with this function |
boolean | API_SetAudioDevice(int dev,
java.lang.String devicename)
Select an audio device. |
boolean | API_SetAudioDevice(int dev,
java.lang.String devicename,
int immediate)
Select an audio device. |
boolean | API_SetBlacklist(java.lang.String str)
Set whole blacklist. |
boolean | API_SetContact(java.lang.String name,
java.lang.String params)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean | API_SetContactName(java.lang.String name,
java.lang.String param)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean | API_SetContactPhone(java.lang.String name,
java.lang.String param)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean | API_SetContacts(java.lang.String contacts)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean | API_SetContactSIP(java.lang.String name,
java.lang.String param)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean | API_SetContactSpeedDial(java.lang.String name,
java.lang.String param)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean | API_SetContactStatus(java.lang.String name,
java.lang.String param)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack. If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean | API_SetCredentials(java.lang.String server,
java.lang.String username,
java.lang.String password)
Set parameters for authentication. |
boolean | API_SetCredentials(java.lang.String server,
java.lang.String username,
java.lang.String password,
java.lang.String authusername,
java.lang.String displayname)
Set parameters for authentication. |
boolean | API_SetCredentialsMD5(java.lang.String server,
java.lang.String username,
java.lang.String md5,
java.lang.String realm)
Set parameters for authentication. |
boolean | API_SetLine(int line)
Will set the current channel. Use only if you present line selection for the users. |
boolean | API_SetLineEx(java.lang.String line)
Will set the current channel. Use only if you present line selection for the users. |
boolean | API_SetLineParameter(int line,
java.lang.String param,
java.lang.String value,
int permanent)
Set parameter for a specific current/next/all line. |
boolean | API_SetLogLevel(int level)
Set loglevel at runtime. |
boolean | API_SetNotificationListener(SIPNotificationListener listener)
Subscribe to notification events |
boolean | API_SetParameter(java.lang.String param,
boolean value)
Configure the SIP stack by passing any parameter. |
boolean | API_SetParameter(java.lang.String param,
int value)
Configure the SIP stack by passing any parameter. |
boolean | API_SetParameter(java.lang.String param,
long value)
Configure the SIP stack by passing any parameter. |
boolean | API_SetParameter(java.lang.String param,
java.lang.String value)
Configure the SIP stack by passing any parameter. |
boolean | API_SetParameters(java.lang.String parameters)
Configure the SIP stack with a list of parameters. |
boolean | API_SetPresenceStatus(java.lang.String status)
Use the API_SetPresenceStatus(statustring) function call to change the user online status. This function will start to send NOTIFY requests to subscribed parties. |
boolean | API_SetSIPHeader(int line,
java.lang.String hdr)
Set a custom sip header (a line in the SIP signaling) that will be sent with all messages. Can be used for various integration purposes (for example for sending the http session id). Multiple headers can be separated by CRLF (\r\n). You can also set this with parameter (customsipheader). |
boolean | API_SetSpeakerMode(boolean loud)
Set speaker mode, |
boolean | API_SetSSLContext(javax.net.ssl.SSLContext sc)
Set custom SSLContext for new TLS connections. |
boolean | API_SetUUI(int line,
java.lang.String value,
int fortarget)
Set a custom UUI (User-to-User Call Control Information as described in RFC 7433). |
boolean | API_SetVideoDevice(java.lang.String devicename)
Set the video input device. |
boolean | API_SetVolume(int dev,
int volume)
|
boolean | API_SetVolume(int dev,
int volume,
int line)
Set volume for the selected device. |
boolean | API_SetWhitelist(java.lang.String str)
Set whole whitelist. Only these peers will be allowed. |
int | API_ShouldReset()
Check if the sipstack should be restarted. |
boolean | API_ShouldResetBeforeCall()
This function might be called before calls and you should quickly restart the sipstack if returns true (the continue to make the call). |
boolean | API_ShowLog()
Show a new window with logs. |
boolean | API_SO(java.lang.String peer,
boolean on,
java.lang.String server,
java.lang.String body)
Avaya Service Observing (barge in) https://downloads.avaya.com/elmodocs2/merlin/r1_5/html/features/service%20observing/1.htm Send a Service Observing PUBLISH request. This is a non-standard proprietary method, which might be compatible only with Avaya systems. |
boolean | API_Start()
Will start the SIP engine. This has to be called only if you use JVoIP as and SDK or as a java voip library. |
boolean | API_StartRing(int line)
Will start local ringtone. Rarely needed if any. |
boolean | API_StartStack()
This function call is optional to start the sip stack on demand. If not called, then the sip stack is started anyway if the startsipstack parameter is set, otherwise will start at first registration or outgoing call attempt. |
void | API_Stop(boolean fast)
Will stop the SIP stack. |
void | API_Stop(int fast)
Will stop the SIP stack. |
boolean | API_StopRing(int line)
Will stop pending ring tone. Rarely needed if any. |
boolean | API_StopVideo()
Remove the video stream |
boolean | API_StopVideo(int line,
int direction)
Remove the video stream at the specified line Can be also used as an alternative for video hold |
boolean | API_StreamSoundBuff(int start,
int line,
byte[] buff,
int len)
Audio streaming from buffer. |
boolean | API_StreamSoundStream(int start,
int line,
java.io.InputStream inputstream)
Audio streaming from InputStream. |
boolean | API_Test()
Test API availability. |
java.lang.String | API_TestEcho(java.lang.String echo)
Test API availability. |
boolean | API_Transfer(int line,
java.lang.String number,
int calltype)
Transfer current call to peer which is usually a phone number or a SIP username. |
boolean | API_TransferDialog()
Show the call transfer input box. |
boolean | API_Unregister()
Will stop all endpoints (hangup current calls if any and unregister) |
boolean | API_Unregister(int waitfor)
Will stop all endpoints (hangup current calls if any and unregister) |
boolean | API_Unsubscribe()
You might use the API_UnSubscribe() API to unsubscribe all endpoints (this includes presence, voicemail and BLF subscribes). |
java.lang.String | API_VAD()
Query for global voice activity statistics. |
java.lang.String | API_VAD(int line)
Query line for received voice activity statistics. |
boolean | API_VideoPreview(int line,
int type)
Launch local video preview |
boolean | API_VoiceRecord(int startstop,
int now,
java.lang.String filename)
Will start/stop a voice recording session This function should be used only if you would like to control the recording duration. If all conversations have to be recorded, then just set the “voicerecording” parameter after your needs. |
boolean | API_VoiceRecord(int startstop,
int now,
java.lang.String filename,
int line)
Will start/stop a voice recording session. Same as the API_VoiceRecord above but with an extra line parameter which you can use to record call only for a specific line. This function should be used only if you would like to control the recording duration. If all conversations have to be recorded, then just set the “voicerecording” parameter after your needs. |
boolean | API_WaitFor()
Wait max 3 seconds for sipstack to finish after Stop Should not be used. |
boolean | API_WaitFor(int maxmsec)
Wait for sipstack to finish after Stop Should not be used. |
Constructor Detail |
---|
public webphone()
Method Detail |
---|
public java.lang.String API_GetAddress()
public boolean API_SetCredentialsMD5(java.lang.String server, java.lang.String username, java.lang.String md5, java.lang.String realm)
server
- SIP server address (domain or IP:port)username
- SIP usernamemd5
- md5 checksum for username:realm:passwordrealm
- This parameter is optional (can be set as an empty string) but it is recommended for easy error detection. If present and the server realm don’t match with this one, an error message will be displayed
public java.lang.String API_GetLastRecFileName()
public boolean API_Test()
public java.lang.String API_TestEcho(java.lang.String echo)
echo
- any string
public boolean API_SetParameters(java.lang.String parameters)
parameters
- You can pass a set of parameters with this function in value=key lines separated by CRLF (\r\n).
public java.lang.String API_GetParameter(java.lang.String param)
param
- parameter name (setting name)
public boolean API_SetParameter(java.lang.String param, java.lang.String value)
param
- parameter name (setting name)
public boolean API_SetParameter(java.lang.String param, int value)
param
- parameter name (setting name)
public boolean API_SetParameter(java.lang.String param, long value)
param
- parameter name (setting name)
public boolean API_SetParameter(java.lang.String param, boolean value)
param
- parameter name (setting name)
public boolean API_SetCredentials(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String authusername, java.lang.String displayname)
server
- SIP server address (domain or IP:port)username
- SIP usernamepassword
- SIP passwordauthusername
- SIP auth username (if different from username)displayname
- user full name (can be empty)
public boolean API_SetCredentials(java.lang.String server, java.lang.String username, java.lang.String password)
server
- SIP server address (domain or IP:port)username
- SIP usernamepassword
- SIP password
public boolean API_SetCredentials()
public boolean API_DelSettings(int level)
level
- 0: nothing, 1: settings, 2: everything
public java.lang.String API_GetConfigHash()
public int API_IsEncrypted()
public java.lang.String API_GetWorkdir()
public java.lang.String API_GetAltWorkdir()
public java.lang.String API_GetLogPath()
public boolean API_RecFiles_Del()
public boolean API_RecFiles_Clear()
public java.lang.String API_RecFiles_List()
public boolean API_RecFiles_Upload()
public java.lang.String API_GetBindir()
public boolean API_IsOnline()
public java.lang.String API_RTPStat(int line)
line
- channel number
public java.lang.String API_VAD()
public java.lang.String API_VAD(int line)
line
- channel number
public int API_IsInCall()
public boolean API_IsSpeaking()
public boolean API_IsRegistered()
public boolean API_Registered()
public int API_IsRegisteredEx()
public java.lang.String API_GetRegFailReason()
public int API_GetAccountRegState(java.lang.String domain, java.lang.String proxy, java.lang.String username, java.lang.String sipusername, boolean pushnotify, boolean strict)
public java.lang.String API_GetAccountRegStateString(java.lang.String domain, java.lang.String proxy, java.lang.String username, java.lang.String sipusername, boolean pushnotify, boolean strict)
public java.lang.String API_GetGlobalStatus()
public java.lang.String API_GetRegFailReason(boolean extended)
extended
- set to true for extended report
public int API_GetCurrentConnectedCallCount()
public boolean API_SaveFile(java.lang.String filename, java.lang.String content)
filename
- file pathcontent
- file content
public boolean API_SaveFileRaw(java.lang.String filename, java.lang.String content)
filename
- file pathcontent
- file content
public java.lang.String API_LoadFile(java.lang.String filename)
filename
- file path
public boolean API_SaveFileRemote(java.lang.String filename, java.lang.String content)
filename
- file pathcontent
- file content
public boolean API_LoadFileRemote(java.lang.String filename)
filename
- file path
public java.lang.String API_LoadFileRemoteSync(java.lang.String filename)
filename
- file path
public boolean API_NeedRatingRequest()
public java.lang.String API_HTTPGet(java.lang.String uri)
uri
- HTTP URI
public boolean API_HTTPPost(java.lang.String uri, java.lang.String data)
public java.lang.String API_HTTPReq(java.lang.String uri, java.lang.String data)
uri
- HTTP URIdata
- conent to post
public boolean API_HTTPReqAsync(java.lang.String uri, java.lang.String data)
uri
- HTTP URIdata
- conent to post
public int API_ShouldReset()
public boolean API_ShouldResetBeforeCall()
public void API_CheckConnection()
public boolean API_Register()
public boolean API_StartStack()
public boolean API_Start()
public boolean API_ReStart()
public boolean API_Register(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String authusername, java.lang.String displayname, boolean async)
server
- SIP server address (domain or IP:port)username
- SIP usernamepassword
- SIP passwordauthusername
- SIP auth username (if different from username)displayname
- user full name (can be empty)async
- false if register have to be dow from this thread. true if from separate thread. It is recommended to set to true.
public boolean API_RegisterEx(java.lang.String accounts)
accounts
- must have the following format: server,usr,pwd,ival;server2,usr2,pwd2, ival;
public java.lang.String API_GetVersion()
public int API_GetExeVersion()
public int API_GetBuildNumber()
public java.lang.String API_GuiStarted()
public boolean API_ClearCredentials()
public boolean API_Unregister()
public boolean API_Unregister(int waitfor)
waitfor
- -1 (auto), 0 (do not wait) or 1 (wait for unregister to complete before to return).
public void API_Exit()
public void API_ExitEx()
public boolean API_CapabilityRequest(java.lang.String server, java.lang.String username)
server
- peer or server SIP signaling address (IP:port or domain)username
- user name to be sent in the SIP request
public boolean API_CapabilityRequest()
public boolean API_SendSIPMessage(int line, java.lang.String msg, java.lang.String body, java.lang.String account, java.lang.String target)
line
- endpoint where the message will be sent. -3: new endpoint, -2: all endpoints, -1: current active, 0: register endpoint, 1+: call channel numbermsg
- SIP message to send. It can be just the method name (OPTIONS,MESSAGE,NOTIFY,INVITE,etc), the full message header or the full message including also a body (such as SDP)body
- optional SIP message body (such as SDP, xml payload or chat text, etc). It might be set if for the msg you just pass the method name. Set to "null" if body must not be sent.account
- optional SIP account details if you wish to use other parameters then the configured one. same format like the extraregisteraccounts parametertarget
- optional target username, number of SIP URI if not specified in the msg
public boolean API_SO(java.lang.String peer, boolean on, java.lang.String server, java.lang.String body)
peer
- the extension, username or phone number of the peer to be “observed”on
- set to true to turn on the Service Observing feature or false to turn it offserver
- set this only if the request have to be sent to another server (not the configured one). same format like the extraregisteraccounts parameter (you can specify only the server address).body
- custom message body. Might be useful if the default implementation doesn’t fulfill your needs. In this case you can send any custom body (usually an xml)
Example: API_SO("111", true, "serveraddress", "");public boolean API_SendSIP(java.lang.String msg)
msg
- SIP message to send
public java.lang.String API_GetSIPHeader(int line, java.lang.String hdr)
line
- channel numberhdr
- SIP header to request
public java.lang.String API_GetSIPHeaderInternal(int line, java.lang.String hdr)
public java.lang.String API_GetSDPField(int line, java.lang.String field)
public java.lang.String API_GetSIPMessage(int line, int dir, int type)
line
- channel numberdir
- 0: in (incoming/received message), 1: out (outgoing/sent message)type
- 0: any, 1: SIP request (such as INVITE, REGISTER, BYE), 2: SIP answer (such as 200 OK, 401 Unauthorized and other response codes), 3: INVITE (the last INVITE received or sent), 4: the last 200 OK (call connect, ok for register or other)
public boolean API_SetLineParameter(int line, java.lang.String param, java.lang.String value, int permanent)
line
- channel number. If -2 then it will be set as global config like the API_SetParameter. If -1 then for the active line. If 0, then it will be applied for all next/new channel(s). Otherwise it will be applied for the specific line.param
- parameter name (setting key name)value
- param value as string (or "NULL" to clear any old preset)permanent
- param if 1 then the setting will be kept for all future lines with the same line number, if 0 then the setting will be applied only for the current or very next channel with the same line
public java.lang.String API_GetLineParameter(int line, java.lang.String param)
line
- channel number. If -2 then it will get the global config like the API_GetParameter. If -1 then for the active line. If 0, then it will get for all next/new channel(s). Otherwise it read from the the specific line.param
- parameter name (setting key name)
public boolean API_SetSIPHeader(int line, java.lang.String hdr)
line
- channel numberhdr
- SIP header (line) to set
public boolean API_RTPHeaderExtension(int line, int profile, int extension)
line
- channel numberprofile
- profile numberextension
- bytes to send as string or int
public boolean API_ED137PTT(int line, int ptt, int pttid)
line
- channel numberptt
- (0: off (not speaking), 1: on (Normal PTT ON), 2: Coupling PTT ON, 3: Priority PTT ON, 4: Emergency PTT ON)pttid
- optional PTT-ID (otherwise if default / -1 is passed then it will be loaded from global config)
public boolean API_SetUUI(int line, java.lang.String value, int fortarget)
line
- channel numbervalue
- UUI data (can include also parameters. Example: 56a390f3d2b7310023a2;encoding=hex;purpose=foo;content=barfortarget
- specify if the UUI have to be sent to target party with call transfer or redirect. 0: no (to peer with the User-to-User header), 1: yes (to target escaped in Contact or Refer-To URI), 2: both
public boolean API_NATKeepAlive(java.lang.String server)
server
- target server addressspublic java.lang.String API_LineToCallID(int line)
line
- channel number
public int API_CallIDToLine(java.lang.String callid)
callid
- SIP Call-ID string
public boolean API_SetLine(int line)
line
- channel number
public boolean API_SetLineEx(java.lang.String line)
line
- channel number, SIP Call-ID or peer username/number
public int API_GetLine()
public int API_GetLineStatus(int line)
line
- channel number
public java.lang.String API_GetLineStatusText(int line)
line
- channel number
public boolean API_Call(java.lang.String number)
number
- peer, destinationnumber, SIP username or SIP URI to call
public boolean API_Call(int line, java.lang.String number)
line
- channel numbernumber
- peer, destinationnumber, SIP username or SIP URI to call
public boolean API_Call(int line, java.lang.String peer, int type)
line
- channel numberpeer
- destinationnumber, SIP username or SIP URI to calltype
- call type: -1: auto/default, 0: audio, 1: video, 2: screen-sharing
public boolean API_Call(int line, java.lang.String peer, int type, int audiodirection, int videodirection)
line
- channel numberpeer
- destinationnumber, SIP username or SIP URI to calltype
- call type: -1: auto/default, 0: audio, 1: video, 2: screen-sharingaudiodirection
- initial hold state for audio: -1: inactive, 0: send only, 1: receive only, 2: both way (default)videodirection
- initial hold state for video: -1: inactive, 0: send only, 1: receive only, 2: both way (default)
public java.lang.String API_GetVideoDeviceList()
public java.lang.String API_GetVideoDeviceList(int async, boolean strict)
async
- optional parameter: 2: immediately never blocking, 1: returns immediately only if already cached, 0: always blocking reloadstrict
- ptional parameter: false: might failback to old cached result, true: it will return empty string if can’t list the video input devices
public java.lang.String API_GetVideoDevice()
public boolean API_SetVideoDevice(java.lang.String devicename)
devicename
- camera/webcam device name. Set to "Default" to try using the default device.
public java.lang.String API_GetVideoRTPAddrForPlayback()
public boolean API_SendVideoRTP(int line, byte[] buffer, int length)
line
- channel numberbuffer
- video RTP datalength
- buffer size
public boolean API_VideoPreview(int line, int type)
line
- optional channel number. default is -1. 3 means to be launched separatelytype
- optinal video_preview type
public boolean API_AddVideo()
public boolean API_AddVideo(int line, int type, int direction)
line
- channel numbertype
- call-type: 1: add video 2: add screen-sharingdirection
- set hold state: -1: inactive, 0: sendonly, 1: recvonly, 2: both
public boolean API_StopVideo()
public boolean API_StopVideo(int line, int direction)
line
- channel numberdirection
- 0: stop send, stop receive, 2: stop both way
public boolean API_Hangup()
public boolean API_Hangup(int line)
line
- channel number
public boolean API_Hangup(int line, java.lang.String reason)
line
- channel numberreason
- disconnect reason text
public java.lang.String API_GetLastCallDetails()
public java.lang.String API_GetProfileStatusText(java.lang.String username)
public java.lang.String API_GetMySIPURI(boolean all)
all
- if set to true, then it will return all possible URI’s separated by comma. Otherwise it will return single main URI
public boolean API_SetSSLContext(javax.net.ssl.SSLContext sc)
sc
- SSLContext object prepared by you
public java.lang.String API_GetIncomingDisplay(int line)
line
- channel number
public boolean API_Accept()
public boolean API_Accept(int line)
line
- channel number
public boolean API_Accept(int line, int calltype)
line
- channel numbercalltype
- -1: default, 0: audio only, 1: with video, 2: force video
public boolean API_Accept(int line, int calltype, int audiodirection, int videodirection)
line
- channel numbercalltype
- specify call type: -1: default, 0: audio only, 1: with video, 2: force videoaudiodirection
- audio hold state: -1: inactive, 0: sendonly, 1: recvonly, 2: both (defult)videodirection
- video hold state: -1: inactive, 0: sendonly, 1: recvonly, 2: both (defult)
public boolean API_Accept(int line, int calltype, int strict)
line
- channel numbercalltype
- specify call type: -1: default, 0: audio only, 1: with video, 2: force videostrict
- set to 1 to strictly treat the line parameter. otherwise might auto guess the best line if incorrect
public boolean API_Accept(int line, int calltype, int strict, int audiodirection, int videodirection)
line
- channel numbercalltype
- specify call type: -1: default, 0: audio only, 1: with video, 2: force videostrict
- set to 1 to strictly treat the line parameter. otherwise might auto guess the best line if incorrectaudiodirection
- audio hold state: -1: inactive, 0: sendonly, 1: recvonly, 2: both (defult)videodirection
- video hold state: -1: inactive, 0: sendonly, 1: recvonly, 2: both (defult)
public boolean API_AcceptStrict(int line)
line
- channel number
public boolean API_Ignore(int line)
line
- channel number
public boolean API_Forward(int line, java.lang.String peer)
line
- channel number
public boolean API_Reject(int line)
line
- channel number
public boolean API_RejectEx(int line, java.lang.String reasontext)
line
- channel number
public boolean API_IsIncomingVideo()
public int API_GetIncomingVideoEndpoint(int line)
line
- preferred channel number
public int API_GetVideoEndpoint(int line)
line
- preferred channel number
public java.lang.String API_GetLastRecInvite()
public java.lang.String API_GetLastSentInvite()
public boolean API_AddLog(java.lang.String text)
text
- log text
public boolean API_AddLog(int level, java.lang.String text)
level
- log leveltext
- log text
public java.lang.String API_GetLastRecSIPMessage(java.lang.String line)
line
- channel number
public java.lang.String API_GetDiscReasonText(java.lang.String line)
line
- can be line number or SIP call-id
public boolean API_TransferDialog()
public boolean API_PushContactlist(java.lang.String userlist)
userlist
- users separated by comma (or a single user)
public boolean API_SetBlacklist(java.lang.String str)
str
- users/numbers separated by comma
public java.lang.String API_GetBlacklist()
public boolean API_AddToBlacklist(java.lang.String str)
str
- username, phone number or SIP URI to block
public boolean API_SetWhitelist(java.lang.String str)
str
- users/numbers separated by comma
public java.lang.String API_GetWhitelist()
public boolean API_AddToWhitelist(java.lang.String str)
str
- username, phone number or SIP URI to block
public boolean API_NumExists()
public java.lang.String API_GetPresenceStatus()
public boolean API_SetPresenceStatus(java.lang.String status)
status
- one of the followings strings: Online, Away, DND, Invisible , Offline (case sensitive) .
public boolean API_NewUser(java.lang.String user)
user
- username of the user to accept
public boolean API_Unsubscribe()
public boolean API_CheckPresence(java.lang.String userlist)
userlist
- users separated by comma (or a single user)
public boolean API_CheckBLF(java.lang.String userlist)
userlist
- users/extensions/phone numbers separated by comma (it can be a single entry)
public boolean API_DisableBLF(java.lang.String userlist)
userlist
- users/extensions/phone numbers separated by comma (it can be a single entry)
public boolean API_SetContact(java.lang.String name, java.lang.String params)
public boolean API_SetContactPhone(java.lang.String name, java.lang.String param)
public boolean API_SetContactSIP(java.lang.String name, java.lang.String param)
public boolean API_SetContactName(java.lang.String name, java.lang.String param)
public boolean API_SetContactSpeedDial(java.lang.String name, java.lang.String param)
public boolean API_SetContactStatus(java.lang.String name, java.lang.String param)
public java.lang.String API_GetContactPhone(java.lang.String name)
public java.lang.String API_GetContactSIP(java.lang.String name)
public java.lang.String API_GetContactName(java.lang.String name)
public java.lang.String API_GetContactSpeedDial(java.lang.String name)
public boolean API_AddContact(java.lang.String params)
public boolean API_DelContact(java.lang.String name)
public java.lang.String API_GetContact(java.lang.String name)
public java.lang.String API_GetContactPresence(java.lang.String name)
public java.lang.String API_GetContactPresenceStr(java.lang.String name)
public boolean API_SetContacts(java.lang.String contacts)
public java.lang.String API_GetContacts()
public boolean API_Conf(java.lang.String number)
number
- destination number, username or SIP URI
public boolean API_ConfEx(int line, java.lang.String number, boolean add, int confline)
line
- channel number (to be created/added or removed)number
- destination number, username or SIP URIadd
- set to true to add this number or false to removeconfline
- existing line in conference in which this new conference party will be added
public boolean API_Transfer(int line, java.lang.String number, int calltype)
line
- channel numbernumber
- destination number (transfer-to)calltype
- -1: auto guess, 0: audio only, 1: audio + video, 2: screen sharing
public boolean API_Mute(int line, boolean mute)
line
- channel number (-2 for all or -1 for current line)mute
- Set the mute parameter to true for mute or false to un-mute.
public boolean API_Mute(int line, boolean mute, int what)
line
- channel number (-2 for all or -1 for current line)mute
- Set the mute parameter to true for mute or false to un-mute.what
- The direction can have the following values: 0: mute in and out, 1: mute out (speakers), 2: mute in (microphone), 3: mute in and out (same as 0), 4: mute default (set by the “defmute” parameter, which is “mute microphone only” by default)
public int API_IsMuted(int line)
line
- channel number
public int API_IsOnHold(int line)
line
- channel number
public boolean API_Hold(int line, boolean hold)
line
- channel number.hold
- true for hold and false to reload. If true, then it will hold the call as specified by the holdtypeonhold parameter.
public boolean API_HoldEx(int line, int direction, int media)
line
- channel number (-3 means for next INVITE/OK)direction
- hold direction: -2: no hold change, -1: default (holdtypeonhold), 0: unhold, 1: mute instead of hold (not recommended. use API_Mute instead), 2: send only (mute playback. JVoIP will send a=sendonly), 3: receive only (mute recording. JVoIP will send a=recvonly),4: both in hold (inactive)media
- 0: audio, 1: video, 2: both (default)
public boolean API_Hold(int line, int direction)
line
- channel number (-3 means for next INVITE/OK)direction
- hold direction: -2: no hold change, -1: default (holdtypeonhold), 0: unhold, 1: mute instead of hold (not recommended. use API_Mute instead), 2: send only (mute playback. JVoIP will send a=sendonly), 3: receive only (mute recording. JVoIP will send a=recvonly),4: both in hold (inactive)
public boolean API_Hold(int line)
line
- channel number (-3 means for next INVITE/OK)
public boolean API_Hold()
public boolean API_Hold(int line, int direction, int media)
line
- channel number. If -3 then it will be applied for the next action.direction
- -1: default (holdtypeonhold), 0=unhold,2=hold (mute microphone. this: sendonly, peer: recvonly),3=other party hold (mute speaker. this: recvonly, peer: sendonly),4=both in holdmedia
- 0=audio, 1=video, 2=both
public boolean API_HoldChange(int line)
line
- channel number
public boolean API_Dtmf(int line, java.lang.String dtmf)
line
- channel numberdtmf
- one or more dtmf digits. Use the space char to insert delays between the digits.
public boolean API_Info(int line, java.lang.String msg)
line
- channel numbermsg
- message to send
public boolean API_SendChat(int line, java.lang.String number, java.lang.String message)
line
- channel numbernumber
- phone number or SIP username/extension numbermessage
- text (chat body content)
public boolean API_SendSMS(int line, java.lang.String number, java.lang.String message, int msgid)
line
- channel numbernumber
- target mobile phone numbermessage
- text (SMS text)msgid
- optional id to be reported by the CHATREPORT (can be used the match the message)
public boolean API_SendChat(int line, java.lang.String number, java.lang.String group, java.lang.String message, int msgid)
line
- channel numbernumber
- phone number or SIP username/extension numbergroup
- groupname (members separated by | )message
- text (chat body content)msgid
- optional id to be reported by the CHATREPORT (can be used the match the message)
public boolean API_SendUSSD(int line, java.lang.String method, java.lang.String ussd)
line
- channel numbermethod
- INVITE, INFO, BYE (if INVITE, then a new session will be created. otherwise will use the session suggested by the line parameter)ussd
- the USSD string or the whole XML
public boolean API_SendChatIsComposing(int line, java.lang.String number)
line
- channel numbernumber
- phone number or SIP username/extension number
public boolean API_CheckVoicemail(int line)
line
- channel number. should be set to -1.
public boolean API_CheckVoicemail()
public boolean API_Record(int record)
record
- 0=no,1=local,2=remote ftp,3=both
public boolean API_Chat(java.lang.String peer)
public boolean API_VoiceRecord(int startstop, int now, java.lang.String filename)
startstop
- 0 to stop, 1 to start locally, 2 to start remote ftp, 3 start to record both locally and to remote ftp, 4 start to record as it is set by the “voicerecording” parameternow
- used if the startstop is set to 0. 0 means that the recorded file will be saved and/or uploaded at the end of the conversation only. 2 means that the file will be saved immediatelyfilename
- file name used for storing the recorded voice (if empty string, than will use a default file name)
public boolean API_VoiceRecord(int startstop, int now, java.lang.String filename, int line)
startstop
- 0 to stop, 1 to start locally, 2 to start remote, 3 start to record both locally and to remote, 4 start to record as it is set by the “voicerecording” parameternow
- used if the startstop is set to 0. 0 means that the recorded file will be saved and/or uploaded at the end of the conversation only. 2 means that the file will be saved immediatelyfilename
- file name used for storing the recorded voice (if empty string, than will use a default file name)line
- set to -2 for all or other to specify current line
public boolean API_AudioDevice()
public java.lang.String API_GetMAC()
public java.lang.String API_GetAudioDeviceList(int dev)
dev
- Set to 0 to list the recording device names or set to 1 for to get the playback or ringer devices.
public boolean API_SetAudioDevice(int dev, java.lang.String devicename)
dev
- 0: recording device (microphone), 1: playback device (speaker, headset), 2: ringer device (speaker, headset)devicename
- name of the audio device. Should be a valid audio device name (you can list them with the GetAudioDeviceList call)
public java.lang.String API_GetAudioDevice(int dev)
dev
- 0 for recording, 1 for playback, 2 for ringer
public boolean API_SetAudioDevice(int dev, java.lang.String devicename, int immediate)
dev
- 0: recording device (microphone), 1: playback device (speaker, headset), 2: ringer device (speaker, headset)devicename
- name of the audio device. Should be a valid audio device name (you can list them with the GetAudioDeviceList call)immediate
- 0: default (after the “changeaudiodevimmediate” parameter), 1: next call only, 2: immediately for active calls
public boolean API_SetVolume(int dev, int volume, int line)
dev
- specify the device: 0 for the recording (microphone) audio device, 1 for the playback (speaker) audio device, 2 for the ringback (speaker) audio devicevolume
- volume level from 0 to 100 (percent value: 0-100%)line
- optional channel number
public int API_GetVolume(int dev, int line)
dev
- specify the device to query: 0 for the recording (microphone) audio device, 1 for the playback (speaker) audio device, 2 for the ringback (speaker) audio device
public boolean API_SetVolumeIn(int val)
val
- volume level 0-100%
public boolean API_SetVolumeOut(int val)
val
- volume level 0-100%
public boolean API_HasCallInProgress()
public boolean API_HasCallInSpeaking()
public boolean API_SetLogLevel(int level)
level
- loglevel from 1-5 (0 is not recommended because it will mute also the important notifications. values higher then 5 will increase the system load)
public boolean API_ShowLog()
public boolean API_SetNotificationListener(SIPNotificationListener listener)
public SIPNotification API_GetNotification()
public SIPNotification API_PollNotification()
public java.lang.String API_GetNotificationStrings()
public java.lang.String API_PollNotificationStrings()
public SIPNotification API_ParseNotification(java.lang.String notificationstring)
public byte[] API_GetMedia(int timeout)
Get RTP stream. Will return the next media (audio or video) packet as a byte buffer from the JVoIP internal queue.
Parameters:
timeout
- specified in milliseconds. If it is higher then 0, then JVoIP will use an additional waiting lock. If 0 then will issue a simple/fast blocking read. Returns: byte buffer on success, null on failure
public boolean API_GetMediaEnd()
You might call this function if you don't need the media stream anymore (if you will not use the API_GetMedia anymore)
public java.lang.String API_GetCallerID()
public java.lang.String API_GetCallerID(int line)
line
- channel number
public java.lang.String API_GetLineDetails(int line)
line
- channel number
public java.lang.String API_GetCallerID(int line, int type)
line
- channel number
public int API_HiddenLine()
public java.lang.String API_GetStatus(int line)
line
- channel number
public int API_GetStatusId(int line)
line
- channel number
public java.lang.String API_GetStatus(int line, int strict)
line
- channel numberstrict
- If set to 1, then it will return “Unknown” if no such line is activated. If set to 0, then it will return the default active line if the line doesn’t exists.
public boolean API_SetSpeakerMode(boolean loud)
loud
- set to true if you wish to set to loudspeaker. otherwise false for normal earspeaker.public boolean API_MightStop()
public boolean API_WaitFor()
public boolean API_WaitFor(int maxmsec)
public boolean API_NoUnregister()
public java.lang.String API_GetDeviceID()
public void API_Stop(boolean fast)
public void API_Stop(int fast)
fast
- set to false if you can't wait a bit for graceful shutdown, or set to true for immediate shutdown.public boolean API_StopRing(int line)
line
- channel number
public boolean API_StartRing(int line)
line
- channel number
public boolean API_PlaySound(int start, java.lang.String file, int loop, boolean async, boolean localfile, boolean toremotepeer, int line, java.lang.String audiodevice, boolean isring)
start
- 1 for start or 0 to stop the playback, -1 to pre-cachefile
- file namelocalfile
- true if the file have to be read from the device file system. False if remote file (for example if the file is on the webserver)toremotepeer
- stream the playback to the connected peerline
- used with toremotepeer if there are multiple calls in progress to specify the call (usually set to -1 for the current call if any)
public boolean API_StreamSoundStream(int start, int line, java.io.InputStream inputstream)
start
- 1 for start or 0 to stop the playback, -1 to pre-cacheline
- channel numberinputstream
- audio data stream
public boolean API_StreamSoundBuff(int start, int line, byte[] buff, int len)
start
- 1 for start or 0 to stop the playback, -1 to pre-cacheline
- channel numberbuff
- audio data bufferlen
- audio data size in bytes