webphone
Class webphone


public class webphone

JVoIP SIP Stack public interface. This webphone class contains all the available API functions.

Home page: https://www.mizu-voip.com/Software/SIPSDK/JavaSIPSDK.aspx
Documentation: https://www.mizu-voip.com/Portals/0/Files/JVoIP.pdf
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).

See Also:
Serialized Form

 
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.
webphone(String parameters)
           
 
Method Summary
 booleanAPI_Accept()
          Connect incoming call.
 booleanAPI_Accept(int line)
          Connect incoming call on the specified line.
 booleanAPI_Accept(int line, int calltype)
          Connect incoming call.
 booleanAPI_Accept(int line, int calltype, int strict)
          Connect incoming call.
 booleanAPI_Accept(int line, int calltype, int audiodirection, int videodirection)
          Connect incoming call.
 booleanAPI_Accept(int line, int calltype, int strict, int audiodirection, int videodirection)
          Connect incoming call.
 booleanAPI_AcceptStrict(int line)
          Deprecated. by API_Accept strict parameter
 booleanAPI_AddAccount(String uri)
          Add/register (secondary) account.
 booleanAPI_AddAccount(String server, String proxy, String username, String sipusername, String displayname, String password, int transport, long registerinterval)
           
 booleanAPI_AddAccount(String server, String proxy, String username, String sipusername, String displayname, String password, int transport, long registerinterval, boolean ismain)
           
 booleanAPI_AddAccount(String server, String proxy, String username, String sipusername, String displayname, String password, int transport, long registerinterval, int ismain)
          Add (secondary) account.
 booleanAPI_AddContact(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.
 booleanAPI_AddLog(int level, String text)
          Add to sip stack log.
 booleanAPI_AddLog(String text)
          Add to sip stack log.
 booleanAPI_AddToBlacklist(String str)
          Add user to blacklist
 booleanAPI_AddToWhitelist(String str)
          Add user to whitelist
 booleanAPI_AddVideo_Now(int line, int type, int direction)
           
 booleanAPI_AddVideo()
          Add video media for an existing voice call.
 booleanAPI_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.
 booleanAPI_AI()
           
 booleanAPI_AI(boolean start)
           
 booleanAPI_AI(int line)
           
 booleanAPI_AI(int line, boolean start)
          Start/stop realtime AI streaming at run-time
 booleanAPI_AI(int line, int start)
           
 booleanAPI_AI(int line, int start, String params)
           
 booleanAPI_AISend(int line, String msg)
          Send a message directly on the AI comnnection (usuaally a websocket)
 booleanAPI_AISend(int line, String msg, boolean isaudio)
           
 booleanAPI_AsyncCall(String param1, String param2, String param3, String param4, String param5, String param6, String param7)
           
 booleanAPI_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).
 booleanAPI_Call_Now(int line, String number)
           
 booleanAPI_Call_Now(int line, String number, int calltype, int audiodirection, int videodirection)
           
 booleanAPI_Call_Now(int line, String number, int calltype, int audiodirection, int videodirection, String callparameters)
           
 booleanAPI_Call(int line, 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)
 booleanAPI_Call(int line, String peer, int calltype)
           
 booleanAPI_Call(int line, String peer, int calltype, int audiodirection, int videodirection)
           
 booleanAPI_Call(int line, String peer, int calltype, int audiodirection, int videodirection, String callparameters)
          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)
 booleanAPI_Call(int line, String peer, int calltype, String callparameters)
          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)
 booleanAPI_Call(int line, String number, String callparameters)
           
 booleanAPI_Call(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)
 booleanAPI_CallEx(int line, String peer, int type)
           
 booleanAPI_CallEx(int line, String peer, int type, String callparameters)
           
 intAPI_CallIDToLine(String callid)
          Get the line number for a SIP Call-ID.
 booleanAPI_CapabilityRequest()
          Will send an OPTION request to the server.
 booleanAPI_CapabilityRequest(String server, String username)
          Request server or server capabilities with SIP OPTIONS.
Rarely needed if any.
 booleanAPI_Chat(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).
 booleanAPI_CheckBLF(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.
 voidAPI_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)
 booleanAPI_CheckPresence(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.
 booleanAPI_CheckVoicemail()
          Will (re)subscribe for voicemail notifications.
 booleanAPI_CheckVoicemail(int line)
          Will (re)subscribe for voicemail notifications.
 booleanAPI_ClearCredentials()
          Clear existing user account details.
 booleanAPI_Conf(int line)
           
 booleanAPI_Conf(int line, String number)
           
 booleanAPI_Conf(int line, String number, boolean add)
           
 booleanAPI_Conf(int line, String number, boolean add, int confline)
          Add/remove people to/from conference.
 booleanAPI_Conf(String number)
          Create conference call by adding number to the current call.
 booleanAPI_ConfEx(int line)
           
 booleanAPI_ConfEx(int line, String number)
           
 booleanAPI_ConfEx(int line, String number, boolean add)
           
 booleanAPI_ConfEx(int line, String number, boolean add, int confline)
           
 intAPI_ConvertSampleRate(byte[] buffer_in, int offset_in, int length, byte[] buffer_out, int offset_out, int originalSampleRate, int targetSampleRate)
           
 booleanAPI_CredentialsChanged(String newserver, String newusername)
          Deprecated.  
 booleanAPI_DelAccount(String uri)
          Delete SIP account and unregister.
 booleanAPI_DelAccount(String uri, boolean unregister)
          Delete SIP account.
 booleanAPI_DelContact(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.
 booleanAPI_DelSettings()
           
 booleanAPI_DelSettings(int level)
          Delete settings and data.
 booleanAPI_DisableBLF(String userlist)
          Remove extension(s) from BLF watch list (blfuserlist).
Note: existing BLF subscriptions might not be affected until next session.
 booleanAPI_Dtmf(int line, String dtmf)
          Send DTMF message by In-Band,SIP INFO or RFC2833 method (depending on the “dtmfmode” parameter).
 booleanAPI_Dtmf(String dtmf)
           
 booleanAPI_ED137PTT(int line, int ptt)
           
 booleanAPI_ED137PTT(int line, int ptt, int pttid)
          ED-137 Push to talk
 booleanAPI_ED137PTT(int line, int ptt, int pttid, Endpoint calledfromep)
           
 voidAPI_Exit()
          Will destroy the SIP stack.
 voidAPI_ExitEx()
          Will destroy the SIP stack and also will exit the Java Virtial Machine.
Should not be used.
 booleanAPI_Forward(int line, String peer)
          Forward incoming call to peer (with 302 Moved Temporarily disconnect code)
 booleanAPI_Forward(String peer)
          Forward incoming call to peer (with 302 Moved Temporarily disconnect code)
 StringAPI_GetAccount(String uri)
          Get account details.
 StringAPI_GetAccount(String uri, boolean strict)
          Get account details.
 StringAPI_GetAccountForLine(int line)
          Get the account used for a call
 StringAPI_GetAccountForLine(int line, boolean strict)
           
 StringAPI_GetAccountForLine(int line, boolean strict, int format)
          Get the account used for a call
 StringAPI_GetAccountForLine(int line, int format)
           
 intAPI_GetAccountRegState(String uri)
          Query account register state.
 intAPI_GetAccountRegState(String domain, String proxy, String username, String sipusername)
          Query account register state.
 intAPI_GetAccountRegState(String domain, String proxy, String username, String sipusername, boolean pushnotify, boolean strict)
           
 StringAPI_GetAccountRegStateString(String uri)
          Query account register state.
 StringAPI_GetAccountRegStateString(String domain, String proxy, String username, String sipusername)
          Query account register state.
 StringAPI_GetAccountRegStateString(String domain, String proxy, String username, String sipusername, boolean pushnotify, boolean strict)
           
 StringAPI_GetAddress()
          Query local address.
 SIPNotification.AIAPI_GetAI(int line)
           
 StringAPI_GetAltWorkdir()
          Query the application alternative working directory (such as folder on external SD card).
 StringAPI_GetAudioDevice(int dev)
          Query the current audio device name.
 StringAPI_GetAudioDeviceList(int dev)
          Query the list of available audio devices.
Note: usually you don’t need to use this function.
 StringAPI_GetBindir()
          Query the application path (folder with the app binaries or app home folder)
 StringAPI_GetBlacklist()
          Query the current blacklist
 intAPI_GetBuildNumber()
          Get the BUILDNUMBER
 StringAPI_GetCallerID()
           
 StringAPI_GetCallerID(int line)
           
 StringAPI_GetCallerID(int line, int type)
          Deprecated.  
 StringAPI_GetClasses()
           
 StringAPI_GetConfigHash()
          Get a has value of the configuration.
Should not be used.
 StringAPI_GetContact(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.
 StringAPI_GetContactName(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.
 StringAPI_GetContactPhone(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.
 StringAPI_GetContactPresence(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.
 StringAPI_GetContactPresenceStr(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.
 StringAPI_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.
 StringAPI_GetContactSIP(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.
 StringAPI_GetContactSpeedDial(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.
 intAPI_GetCurrentConnectedCallCount()
          Query the number of simultaneous calls currently in progress.
 StringAPI_GetDeviceID()
          Get device identifier unique per user
 intAPI_GetDiscReasonCode(String line)
          Query the disconnect reason SIP code of the last call or register.
 StringAPI_GetDiscReasonText(String line)
          Query the disconnect reason of the last disconnected call.
 SIPNotification.StatusAPI_GetEndpointDetails(int line)
           
 StringAPI_GetEndpointDetailsStr()
           
 StringAPI_GetEndpointDetailsStr(int line)
           
 intAPI_GetExeVersion()
          Get the SDK version
 StringAPI_GetGlobalStatus()
          Helper function to ask for the SIP stack state/details.
 StringAPI_GetGlobalStatus(boolean shortlines)
           
 StringAPI_GetIncomingDisplay()
          Get incoming caller id (might return two lines: caller id \n caller name)
 StringAPI_GetIncomingDisplay(int line)
          Get incoming caller id (might return two lines: caller id \n caller name)
 intAPI_GetIncomingVideoEndpoint(int line)
          Return line number of the incoming video call if any, otherwise -1.
 StringAPI_GetLastCallDetails()
          Get details about the last finished call.
 StringAPI_GetLastRecFileName()
          Query recently recorded file.
 StringAPI_GetLastRecInvite()
          Get last received INVITE message.
 StringAPI_GetLastRecSIPMessage(String line)
          Get last received SIP message.
 StringAPI_GetLastSentInvite()
          Get last sent INVITE message.
 intAPI_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).
 StringAPI_GetLineDetails(int line)
          Get details about a line.
 StringAPI_GetLineParameter(int line, String param)
          Get line specific parameter for a specific current/next/all line.
 intAPI_GetLineStatus(int line)
          Query the state of a line.
Note: this is rarely needed since you receive the status also by event notifications Use the API_GetState function instead
 StringAPI_GetLineStatusText(int line)
          Query the state of a line.
Note: this is rarely needed since you receive the status also by event notifications
 StringAPI_GetLogPath()
          Query the application log file path.
 StringAPI_GetMAC()
          Get the device MAC address if possible.
Some devices will forbid access to MAC address
 StringAPI_GetMainAccount()
          Get the SIP URI of the main account.
 StringAPI_GetMainAccount(boolean strict)
           
 StringAPI_GetMainAccount(boolean strict, int format)
          Get the SIP URI of the main account.
 StringAPI_GetMainAccount(int format)
           
 byte[]API_GetMedia()
           
 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.
 booleanAPI_GetMediaEnd()
          You might call this function if you don't need the media stream anymore (if you will not use the API_GetMedia anymore)
 StringAPI_GetMySIPURI(boolean all)
          Get the SIP URI on which the current endpoint can be reached such as username@server.com or username@localip:port.
 SIPNotificationAPI_GetNotification()
          Return the next notification object.
 StringAPI_GetNotifications()
           
 StringAPI_GetNotificationsSync()
           
 StringAPI_GetNotificationStrings()
          Return the notification strings.
 StringAPI_GetParameter(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.
 StringAPI_GetPeer()
          Query the peer username / Caller ID.
 StringAPI_GetPeer(int line)
          Query the peer username / Caller ID.
 StringAPI_GetPeerDisplayname()
          Query the peer displayname.
 StringAPI_GetPeerDisplayname(int line)
          Query the peer displayname.
 StringAPI_GetPresenceStatus()
          Query local presence state.
 StringAPI_GetProfileStatusText(String username)
          Get the profile status text for this user.
 StringAPI_GetRegFailReason()
          Query the reason of the last failed registration.
 StringAPI_GetRegFailReason(boolean extended)
          Query the reason of the last failed registration.
 StringAPI_GetSDPField(int line, String field)
          Return a SDP field value received by JVoIP
 StringAPI_GetSIPHeader(int line, String hdr)
          Return a sip header value received by JVoIP.
 StringAPI_GetSIPHeaderInternal(int line, String hdr)
           
 StringAPI_GetSIPMessage(int line, int dir, int type)
          Return the last received or sent SIP signaling message as raw text.
 intAPI_GetState(int line)
           
 intAPI_GetState(int line, int strict)
          Returns line state or global state if you pass -2 as line parameter
 StringAPI_GetStateStr(int line)
          Returns line state or global state if you pass -2 as line parameter
 StringAPI_GetStateStr(int line, int strict)
          Returns line state or global state if you pass -2 as line parameter
 StringAPI_GetStatus(int line)
           
 StringAPI_GetStatus(int line, int strict)
           
 intAPI_GetStatusId(int line)
          Returns line state or global state id.
Should not be used (use the API_GetStatus instead)
 StringAPI_GetUDeviceID()
          Get device identifier unique per device.
 StringAPI_GetVersion()
          Get the SIP stack version number.
 StringAPI_GetVideoDevice()
          Query the video device in use.
 StringAPI_GetVideoDeviceList()
          Query video recording devices.
 StringAPI_GetVideoDeviceList(int async, boolean strict)
          Query video recording devices.
 intAPI_GetVideoEndpoint(int line)
          Return line number for the video call if any, otherwise -1.
 StringAPI_GetVideoRTPAddrForPlayback()
          Return the rtsp socket address.
 StringAPI_GetVideoSDPFilePath()
           
 StringAPI_GetVideoSDPFilePath(int line)
           
 StringAPI_GetVideoSDPFilePath(int line, boolean force)
          Return SDP file path.
 intAPI_GetVolume(int dev)
           
 intAPI_GetVolume(int dev, int line)
          Get Volume level
 StringAPI_GetWhitelist()
          Query the current whitelist
 StringAPI_GetWorkdir()
          Query the application working directory (data folder) Based on appcontext.getFilesDir().getPath() and Environment.getDataDirectory().getPath();
 StringAPI_GuiStarted()
          Test API
 booleanAPI_HandleCall(int line)
          Handle incoming call (send ringing, prepare media, process early media, etc).
This function should be used only if the incoming call handling have been deferred using the deferincomingcall parameter.
 booleanAPI_Hangup()
          Disconnect call.
 booleanAPI_Hangup(int line)
          Disconnect current call(s).
 booleanAPI_Hangup(int line, String reason)
          Disconnect current call(s).
 booleanAPI_HasAudioTricks()
           
 booleanAPI_HasCallInProgress()
          Query of there is any call in progress (including calls in ringing or connected state).
 booleanAPI_HasCallInSpeaking()
          Query of there is any connected call.
 intAPI_HiddenLine()
          Query hiddel endpoint channel.
Hidden calls are usually the result of barge-in calls.
 booleanAPI_Hold()
          Put call on hold.
 booleanAPI_Hold(int line)
          Put call on hold.
 booleanAPI_Hold(int line, boolean hold)
          Put call on hold.
 booleanAPI_Hold(int line, int direction)
          Put call on hold.
 booleanAPI_Hold(int line, int direction, int media)
          Put call on hold.
 booleanAPI_HoldChange(int line)
          Togle hold state of the call.
 booleanAPI_HoldEx(int line, int direction, int media)
          Put call on hold.
 StringAPI_HTTPGet(String uri)
          Send a HTTP GET request.
 booleanAPI_HTTPKeepAlive()
           
 booleanAPI_HTTPPost(String uri, String data)
          Send a HTTP POST request.
 StringAPI_HTTPReq(String uri, String data)
          Send a HTTP POST or GET request.
 booleanAPI_HTTPReqAsync(String uri, String data)
          Send a HTTP POST or GET request.
 booleanAPI_HTTPReqAsyncFavafone(String uri, String data)
           
 booleanAPI_Ignore(int line)
          Ignore incoming call.
 booleanAPI_Info(int line, String msg)
          Send custom INFO message (for DTMF use the API_Dtmf function instead).
 intAPI_IsEncrypted()
          Check if the connection is encrypted.
 intAPI_IsInCall()
          Query of there is any call in progress.
 booleanAPI_IsIncomingVideo()
          Check if current incoming call is video call.
 intAPI_IsMuted(int line)
          Return if the selected line is muted or not.
 intAPI_IsMutedIntern(int line)
           
 intAPI_IsMutedIntern(int line, boolean intern)
           
 voidAPI_IsNewBrowserConnection()
           
 intAPI_IsOnHold(int line)
          Query if the selected line is on hold or not
 intAPI_IsOnHoldIntern(int line)
           
 intAPI_IsOnHoldIntern(int line, boolean intern)
           
 booleanAPI_IsOnline()
          Query online state.
This is not the same with the register state (It can return true even if not registered)
 booleanAPI_IsRegistered()
          Get the registered state.
 intAPI_IsRegisteredEx()
          Get the extended registered state.
 booleanAPI_IsSpeaking()
          Query of there is any connected call.
 booleanAPI_IsTerminated()
          Check if JVoIP is terminated
 intAPI_JSSendTest(int count)
           
 StringAPI_LcExpired()
           
 StringAPI_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.
 StringAPI_ListAccounts()
          Will return the list of the account URI's separated by semicolon ;
 StringAPI_ListAccounts(int format, String markmain, boolean withstatus, String separator)
          Will return the list of the account URI's separated by semicolon ;
 StringAPI_LoadFile(String filename)
          Load file content from local disk.
 booleanAPI_LoadFileRemote(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.
 StringAPI_LoadFileRemoteSync(String filename)
          Will download the specified file from remote storage synchronously (will block until done or fails).
 booleanAPI_Log(String str)
          Deprecated.  
 booleanAPI_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.
 booleanAPI_Mute(int line, boolean mute)
          Mute current call.
 booleanAPI_Mute(int line, boolean mute, int what)
          Mute current call.
Same as the Mute API.
 booleanAPI_MuteArg(int line, boolean mute, int what)
           
 booleanAPI_MuteEx(int line, boolean mute, int what)
           
 booleanAPI_NATKeepAlive(String server)
          Rarely needed if any, because the siptack will do it automatically.
 booleanAPI_NeedRatingRequest()
          Some servers might report call rating automatically in signaling.
 booleanAPI_NewUser(String user)
          On newuser, you should ask the user if wish to accept it.
 StringAPI_NextCallID()
           
 StringAPI_NextCallID(String callid)
          Set or get the SIP Call-ID used for the first upcoming new SIP session.
 booleanAPI_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.
 booleanAPI_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.
 booleanAPI_NumExistsEx(String contactlist)
           
 SIPNotificationAPI_ParseNotification(String notificationstring)
          Helper function to convert notification String to SIPNotification object
 booleanAPI_PeerIsMizu(int line)
          Check if peer is Mizutech software.
 booleanAPI_PlayBuff()
          Stop local audio playback
 booleanAPI_PlayBuff(boolean start, byte[] buff, int len, boolean isring, String audiodevice, int samplerate, int reset)
          Play a PCM sound buffer locally (on the local audio player device) .
 booleanAPI_PlayBuff(byte[] buff)
          Play a PCM sound buffer locally (on the local audio player device) .
 booleanAPI_PlayBuff(byte[] buff, int len)
          Play a PCM sound buffer locally (on the local audio player device) .
 booleanAPI_PlayBuff(byte[] buff, int len, int samplerate)
          Play a PCM sound buffer locally (on the local audio player device) .
 booleanAPI_PlayBuffOld(boolean start, byte[] buff, int len, boolean isring, String audiodevice)
           
 booleanAPI_PlaySound(int line, String file)
          Play any sound file to peer.
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).
 booleanAPI_PlaySound(int start, String file, int loop, boolean async)
           
 booleanAPI_PlaySound(int start, String file, int loop, boolean async, boolean localfile)
           
 booleanAPI_PlaySound(int start, String file, int loop, boolean async, boolean localfile, boolean toremotepeer, int line)
           
 booleanAPI_PlaySound(int start, String file, int loop, boolean async, boolean localfile, boolean toremotepeer, int line, 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, it is recommended to force a narrowband codec if your file is narrowband or a wideband codec (speex, opus) if your file is wideband (16 kHz, 16 bit mono in little-endian).
The file must be found locally.
 booleanAPI_PlaySound(String file)
           
 booleanAPI_PlaySoundInternal(int start, String file, int loop, boolean async, boolean localfile, boolean toremotepeer, int line, String audiodevice, boolean isring)
           
 booleanAPI_PlayTone(int tone)
           
 StringAPI_Poll()
          Deprecated.  
 StringAPI_Poll(boolean all)
           
 SIPNotificationAPI_PollNotification()
          Return the next notification object if any.
 StringAPI_PollNotificationStrings()
          Return the notification strings.
 StringAPI_PollSync()
           
 StringAPI_PollSync(boolean all)
           
 booleanAPI_PushContactlist(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
 booleanAPI_RecFiles_Clear()
          Delete old recorded files.
 booleanAPI_RecFiles_Del()
          Delete local recorded files.
 StringAPI_RecFiles_List()
          List pending voice record files.
 booleanAPI_RecFiles_Upload()
          Upload pending recorded files (if ftp/http URI was set)
 booleanAPI_RecFiles_UploadEx(String filelist, String ftp)
           
 booleanAPI_Record(int record)
          Deprecated.  
 booleanAPI_Register()
          Set parameters for authentication and register to the SIP server.
Will connect to the SIP server.
 booleanAPI_Register(String server, String username, String password)
           
 booleanAPI_Register(String server, String username, String password, String authusername, String displayname)
           
 booleanAPI_Register(String server, String username, String password, String authusername, String displayname, boolean async)
          Set parameters for authentication and register to the SIP server.
Will connect to the SIP server.
 booleanAPI_Register(String server, String username, String password, String authusername, String displayname, String proxy)
           
 booleanAPI_RegisterAsync()
           
 booleanAPI_Registered()
          Get the registered state.
 booleanAPI_RegisterEx(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.
 booleanAPI_RegisterNoParam()
           
 booleanAPI_Reject()
          Reject incoming call.
You could also use the Hangup API function for this.
 booleanAPI_Reject(int line)
          Reject incoming call.
You could also use the Hangup API function for this.
 booleanAPI_Reject(int line, String reason)
          Reject incoming call.
You could also use the Hangup API function for this.
 booleanAPI_RejectEx(int line, 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.
 voidAPI_RequestStatus()
           
 booleanAPI_ReStart()
          Will restart the SIP stack.
 booleanAPI_RTPHeaderExtension(int line, int profile, int extension)
          Set RTP header extension for the RTP packets
 booleanAPI_RTPHeaderExtension(int line, int profile, String extension)
           
 StringAPI_RTPStat()
           
 StringAPI_RTPStat(int line)
          Query for media quality reports.
 booleanAPI_SaveFile(String filename, String content)
          Will save the text file to local disk in the working directory in encrypted format (use API_SaveFileRaw to save as-is)
 booleanAPI_SaveFileRaw(String filename, String content)
          Will save the text file to local disk in the working directory as is.
 booleanAPI_SaveFileRemote(String filename, String content)
          Save file to remote storage (preconfigured ftp or http server )
 booleanAPI_ScreenShare(String peer)
           
 booleanAPI_ScreenShareAccept(String peer)
           
 booleanAPI_ScreenShareReject(String peer)
           
 booleanAPI_SendChat(int line, String message)
           
 booleanAPI_SendChat(int line, String number, String message)
          Send a instant message.
 booleanAPI_SendChat(int line, String number, String group, String message)
           
 booleanAPI_SendChat(int line, String number, String group, String message, int msgid)
          Group messaging.
 booleanAPI_SendChat(String message)
           
 booleanAPI_SendChat(String number, String message)
           
 booleanAPI_SendChatIsComposing(int line, String number)
          Send IM typing notification.
 booleanAPI_SendSIP(String msg)
          Send custom SIP signaling message (for example OPTIONS, NOTIFY, etc) on the current active line.
 booleanAPI_SendSIPMessage(int line, String msg)
           
 booleanAPI_SendSIPMessage(int line, String msg, String body)
           
 booleanAPI_SendSIPMessage(int line, String msg, String body, String account)
           
 booleanAPI_SendSIPMessage(int line, String msg, String body, String account, String target)
          Send custom SIP signaling message.
 booleanAPI_SendSIPMethod(int msg)
           
 booleanAPI_SendSMS(int line, String number, String message)
           
 booleanAPI_SendSMS(int line, String number, 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.
 booleanAPI_SendSMS(int line, String number, String group, String message, int msgid)
           
 booleanAPI_SendSMS(String number, String message)
           
 booleanAPI_SendUSSD(int line, String method, String ussd)
          Send USSD message (After the IMS 3GPP TS 24.390 standard)
 booleanAPI_SendVideoRTP(int line, byte[] buffer, int length)
          Stream video to remote peer by passing video RTP packets with this function
 booleanAPI_ServerInit(String ip)
           
 booleanAPI_ServerIsMizu()
          Check if server is Mizutech software.
 booleanAPI_SetAccount(String params)
          Change (secondary) account.
 booleanAPI_SetAccount(String server, String proxy, String username, String sipusername, String displayname, String password, int transport, long registerinterval)
           
 booleanAPI_SetAccount(String server, String proxy, String username, String sipusername, String displayname, String password, int transport, long registerinterval, boolean ismain)
           
 booleanAPI_SetAccount(String server, String proxy, String username, String sipusername, String displayname, String password, int transport, long registerinterval, int ismain)
          Change (secondary) account.
 voidAPI_SetAChange()
           
 booleanAPI_SetAudioDevice(int dev, String devicename)
          Select an audio device.
 booleanAPI_SetAudioDevice(int dev, String devicename, int immediate)
          Select an audio device.
 voidAPI_SetBChange()
           
 booleanAPI_SetBlacklist(String str)
          Set whole blacklist.
 booleanAPI_SetContact(String name, 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.
 booleanAPI_SetContactName(String name, 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.
 booleanAPI_SetContactPhone(String name, 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.
 booleanAPI_SetContacts(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.
 booleanAPI_SetContactSIP(String name, 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.
 booleanAPI_SetContactSpeedDial(String name, 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.
 booleanAPI_SetContactStatus(String name, 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.
 booleanAPI_SetCredentials()
          Deprecated.  
 booleanAPI_SetCredentials(String server, String username, String password)
          Set parameters for authentication.
 booleanAPI_SetCredentials(String server, String username, String password, String authusername, String displayname)
          Set parameters for authentication.
 booleanAPI_SetCredentialsMD5(String server, String username, String md5, String realm)
          Set parameters for authentication.
 booleanAPI_SetDIDChange(String did1, String did2, String fromcode)
           
 booleanAPI_SetKey(String key)
           
 booleanAPI_SetLine(int line)
          Will set the current channel.
Use only if you present line selection for the users.
 booleanAPI_SetLineEx(String line)
          Will set the current channel.
Use only if you present line selection for the users.
 booleanAPI_SetLineParameter(int line, String param, boolean value, int permanent)
           
 booleanAPI_SetLineParameter(int line, String param, int value, int permanent)
           
 booleanAPI_SetLineParameter(int line, String param, long value, int permanent)
           
 booleanAPI_SetLineParameter(int line, String param, String value, int permanent)
          Set parameter for a specific current/next/all line.
 booleanAPI_SetLogLevel(int level)
          Set loglevel at runtime.
 booleanAPI_SetMainAccount(String uri)
          Change/switch main account.
 booleanAPI_SetMediaListener(SIPMediaListener listener)
          Subscribe to media packets
 booleanAPI_SetNotificationListener(SIPNotificationListener listener)
          Subscribe to notification events
 booleanAPI_SetParameter(String param, boolean value)
          Configure the SIP stack by passing any parameter.
 booleanAPI_SetParameter(String param, int value)
          Configure the SIP stack by passing any parameter.
 booleanAPI_SetParameter(String param, long value)
          Configure the SIP stack by passing any parameter.
 booleanAPI_SetParameter(String param, String value)
          Configure the SIP stack by passing any parameter.
 booleanAPI_SetParameters(String parameters)
          Configure the SIP stack with a list of parameters.
 booleanAPI_SetPresenceStatus(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.
 booleanAPI_SetPushNotifications(int pushnotifications, String clientid, String packagename, String gateway)
           
 booleanAPI_SetPushNotifications(int pushnotifications, String clientid, String packagename, String gateway, int fromcode)
          Call this function if you wish the SIP stack to manage push notifications, useful especially when used with the mizu server or MPUSH gateway.
Should be called after API_Start.
 booleanAPI_SetSDPField(int line, String field, int type)
           
 booleanAPI_SetSIPHeader(int line, 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).
 booleanAPI_SetSpeakerMode(boolean loud)
          Set speaker mode,
 booleanAPI_SetSSID(String ssidval)
          Should not be used.
 booleanAPI_SetSSLContext(javax.net.ssl.SSLContext sc)
          Set custom SSLContext for new TLS connections.
 booleanAPI_SetUUI(int line, String value, int fortarget)
          Set a custom UUI (User-to-User Call Control Information as described in RFC 7433).
 booleanAPI_SetVideoDevice(String devicename)
          Set the video input device.
 booleanAPI_SetVolume(int dev, int volume)
           
 booleanAPI_SetVolume(int dev, int volume, int line)
          Set volume for the selected device.
 booleanAPI_SetVolumeIn(int val)
          Deprecated.  
 booleanAPI_SetVolumeOut(int val)
          Deprecated.  
 booleanAPI_SetWhitelist(String str)
          Set whole whitelist.
Only these peers will be allowed.
 voidAPI_SetXChange(int code)
           
 voidAPI_SetXChangeOld(int vers)
           
 intAPI_ShouldReset()
          Check if the sipstack should be restarted.
 booleanAPI_ShouldResetBeforeCall()
          This function might be called before calls and you should quickly restart the sipstack if returns true (the continue to make the call).
 booleanAPI_ShowLog()
          Show a new window with logs.
 booleanAPI_SO(String peer, boolean on, String server, 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.
 booleanAPI_SoftphoneScreenshare(String peer)
           
 booleanAPI_SoftphoneVideoCall(String peer)
           
 booleanAPI_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.
 booleanAPI_Start2()
           
 booleanAPI_StartGUI()
           
 booleanAPI_StartInner(boolean isrestart)
           
 booleanAPI_StartRing(int line)
          Will start local ringtone.
Rarely needed if any.
 booleanAPI_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.
 voidAPI_Stop()
           
 voidAPI_Stop(boolean fast)
          Will stop the SIP stack.
 voidAPI_Stop(int fast)
          Will stop the SIP stack.
 voidAPI_Stop(int fast, boolean fromdelayedthread)
           
 booleanAPI_StopRing(int line)
          Will stop pending ring tone.
Rarely needed if any.
 booleanAPI_StopVideo_Now(int line, int direction)
           
 booleanAPI_StopVideo()
          Remove the video stream
 booleanAPI_StopVideo(int line, int direction)
          Remove the video stream at the specified line
Can be also used as an alternative for video hold
 booleanAPI_StreamSoundBuff(byte[] buff)
           
 booleanAPI_StreamSoundBuff(byte[] buff, int len)
           
 booleanAPI_StreamSoundBuff(int line, byte[] buff, int len)
           
 booleanAPI_StreamSoundBuff(int start, int line, byte[] buff, int len)
          Audio streaming from buffer.
 booleanAPI_StreamSoundBuff(int start, int line, byte[] buff, int len, int samplerate)
           
 booleanAPI_StreamSoundBuff(int start, int line, byte[] buff, int len, int samplerate, boolean from_ai)
           
 booleanAPI_StreamSoundStream(int start, int line, java.io.InputStream inputstream)
          Audio streaming from InputStream.
 booleanAPI_SwitchVideo_Now(int line)
           
 booleanAPI_SwitchVideo(int line, int type)
           
 booleanAPI_Test()
          Test API availability.
 StringAPI_TestEcho(String echo)
          Test API availability.
 StringAPI_TestEncoded()
           
 intAPI_TestEx()
           
 voidAPI_TestPrint()
           
 StringAPI_TestService()
          Test API
 booleanAPI_Transfer()
           
 booleanAPI_Transfer(int line)
           
 booleanAPI_Transfer(int line, String number)
           
 booleanAPI_Transfer(int line, String number, int calltype)
          Transfer current call to peer which is usually a phone number or a SIP username.
 booleanAPI_Transfer(int line, String number, int calltype, String callparameters)
           
 booleanAPI_Transfer(int line, String number, String callparameters)
           
 booleanAPI_Transfer(String number)
           
 booleanAPI_TransferDialog()
          Show the call transfer input box.
 booleanAPI_Unregister()
          Will stop all endpoints (hangup current calls if any and unregister)
 booleanAPI_Unregister(int waitfor)
          Will stop all endpoints (hangup current calls if any and unregister)
 booleanAPI_Unregister(String account)
          Will unregister an account (hangup current calls if any and unregister)
 booleanAPI_Unregister(String account, int waitfor)
          Will unregister an account (hangup current calls if any and unregister)
 booleanAPI_Unregister(String account, int waitfor, int stopallsessions)
           
 booleanAPI_Unregister(String account, int waitfor, int stopallsessions, boolean delaccount)
           
 booleanAPI_Unregister(String account, String server, int waitfor)
          Will unregister an account (hangup current calls if any and unregister)
 booleanAPI_Unregister(String account, String server, int waitfor, int stopallsessions)
          Unregister a SIP account
 booleanAPI_Unregister(String account, String server, int waitfor, int stopallsessions, boolean delaccount)
          Unregister a SIP account
 booleanAPI_Unregister(String account, String server, int waitfor, int stopallsessions, int delaccount)
           
 booleanAPI_Unsubscribe()
          You might use the API_UnSubscribe() API to unsubscribe all endpoints (this includes presence, voicemail and BLF subscribes).
 StringAPI_VAD()
          Query for global voice activity statistics.
 StringAPI_VAD(boolean fromexternapi)
           
 StringAPI_VAD(int line)
          Query line for received voice activity statistics.
 booleanAPI_VideoAccept(int accept, int direction, boolean remember)
           
 booleanAPI_VideoDisplayAccept()
           
 StringAPI_VideoFileExt()
           
 StringAPI_VideoGetCodec()
           
 StringAPI_VideoGetCointainer()
           
 intAPI_VideoGetPayload()
           
 booleanAPI_VideoPreview()
           
 booleanAPI_VideoPreview(int line)
           
 booleanAPI_VideoPreview(int line, int type)
          Launch local video preview
 booleanAPI_VideoTest()
           
 booleanAPI_VoiceRecord()
           
 booleanAPI_VoiceRecord(int startstop)
           
 booleanAPI_VoiceRecord(int startstop, int now)
           
 booleanAPI_VoiceRecord(int startstop, int now, 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.
 booleanAPI_VoiceRecord(int startstop, int now, 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.
 booleanAPI_VoiceRecord(String filename)
           
 booleanAPI_WaitFor()
          Wait max 3 seconds for sipstack to finish after Stop
Should not be used.
 booleanAPI_WaitFor(int maxmsec)
          Wait for sipstack to finish after Stop
Should not be used.
 SIPNotificationAPI_WaitForNotification(int notification)
          Helper function to wait for a notification
 SIPNotificationAPI_WaitForNotification(int notification, int line, String filter, long timeout)
          Helper function to wait for a notification
 SIPNotificationAPI_WaitForNotification(int notification, long timeout)
          Helper function to wait for a notification
 SIPNotificationAPI_WaitForNotification(int notification, String filter)
          Helper function to wait for a notification
 SIPNotificationAPI_WaitForNotification(int notification, String filter, long timeout)
          Helper function to wait for a notification
 
Constructor Detail

webphone

public 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. The real initialization is performed by the API_Start function.

Parameters:
startsipstack - Set to 0 if you don't want to auto start the sip stack (same as the startsipstack parameter). If the start parameter is set to 0, then you will need to call the API_Start function later to actually start the SIP stack.

webphone

public webphone(int startsipstack)

webphone

public webphone(String parameters)

webphone

public webphone(int startsipstack,
                String userdir)

webphone

public webphone(int startsipstack,
                String userdir,
                int loglevel)

webphone

public webphone(SIPNotificationListener listener)
Method Detail

API_StartGUI

public boolean API_StartGUI()

API_HasAudioTricks

public boolean API_HasAudioTricks()

API_GetAddress

public String API_GetAddress()
Query local address.

Returns:
local SIP listener address (IP:port)

API_GetClasses

public String API_GetClasses()

API_AsyncCall

public boolean API_AsyncCall(String param1,
                             String param2,
                             String param3,
                             String param4,
                             String param5,
                             String param6,
                             String param7)

API_SetCredentialsMD5

public boolean API_SetCredentialsMD5(String server,
                                     String username,
                                     String md5,
                                     String realm)
Set parameters for authentication. These values can also be passed by parameters (SetParameter).

Parameters:
server - SIP server address (domain or IP:port)
username - SIP username
md5 - md5 checksum for username:realm:password
realm - 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
Returns:
true on success, false on failure

API_GetLastRecFileName

public String API_GetLastRecFileName()
Query recently recorded file.

Returns:
the last recorded file name.

API_Test

public boolean API_Test()
Test API availability. Should not be used.

Returns:
true if API working, otherwise false

API_TestEx

public int API_TestEx()

API_TestEcho

public String API_TestEcho(String echo)
Test API availability. Should not be used.

Parameters:
echo - any string
Returns:
echo

API_SetParameters

public boolean API_SetParameters(String parameters)
Configure the SIP stack with a list of parameters. See the documentation for the available settings.

Parameters:
parameters - You can pass a set of parameters with this function in value=key lines separated by CRLF (\r\n).
Returns:
true on success, false on failure

API_GetParameter

public String API_GetParameter(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.

Parameters:
param - parameter name (setting name)
Returns:
the value of the parameter as string (you might convert it to int/long/boolean after your needs)

API_SetParameter

public boolean API_SetParameter(String param,
                                String value)
Configure the SIP stack by passing any parameter. See the documentation for the available setting.
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.

Parameters:
param - parameter name (setting name)
Returns:
true on success, false on failure

API_SetParameter

public boolean API_SetParameter(String param,
                                int value)
Configure the SIP stack by passing any parameter. See the documentation for the available setting.
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.

Parameters:
param - parameter name (setting name)
Returns:
true on success, false on failure

API_SetParameter

public boolean API_SetParameter(String param,
                                long value)
Configure the SIP stack by passing any parameter. See the documentation for the available setting.
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.

Parameters:
param - parameter name (setting name)
Returns:
true on success, false on failure

API_SetParameter

public boolean API_SetParameter(String param,
                                boolean value)
Configure the SIP stack by passing any parameter. See the documentation for the available setting.
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.

Parameters:
param - parameter name (setting name)
Returns:
true on success, false on failure

API_SetCredentials

public boolean API_SetCredentials(String server,
                                  String username,
                                  String password,
                                  String authusername,
                                  String displayname)
Set parameters for authentication. These values can also be passed by parameters (SetParameter).
If authname is empty, then the username will be used for authentications.

Parameters:
server - SIP server address (domain or IP:port)
username - SIP username
password - SIP password
authusername - SIP auth username (if different from username)
displayname - user full name (can be empty)
Returns:
true on success, false on failure

API_SetCredentials

public boolean API_SetCredentials(String server,
                                  String username,
                                  String password)
Set parameters for authentication. These values can also be passed by parameters (SetParameter).

Parameters:
server - SIP server address (domain or IP:port)
username - SIP username
password - SIP password
Returns:
true on success, false on failure

API_SetCredentials

public boolean API_SetCredentials()
Deprecated. 

Apply the crendential parameters.

Returns:
true on success, false on failure

API_DelSettings

public boolean API_DelSettings(int level)
Delete settings and data.

Parameters:
level - 0: settings only if it was not already cleared, 1: settings only forced, 2: force all, 3: delete also library cache
Returns:
true on success, false on failure

API_DelSettings

public boolean API_DelSettings()

API_GetConfigHash

public String API_GetConfigHash()
Get a has value of the configuration.
Should not be used.

Returns:
hash string

API_HTTPKeepAlive

public boolean API_HTTPKeepAlive()

API_SetSSID

public boolean API_SetSSID(String ssidval)
Should not be used.


API_SetAChange

public void API_SetAChange()

API_SetBChange

public void API_SetBChange()

API_SetXChange

public void API_SetXChange(int code)

API_SetXChangeOld

public void API_SetXChangeOld(int vers)

API_IsNewBrowserConnection

public void API_IsNewBrowserConnection()

API_RequestStatus

public void API_RequestStatus()

API_SetDIDChange

public boolean API_SetDIDChange(String did1,
                                String did2,
                                String fromcode)

API_IsEncrypted

public int API_IsEncrypted()
Check if the connection is encrypted.

Returns:
-1: unknown, 0=no,1=partially/weak yes,2=yes,3=always strong

API_GetWorkdir

public String API_GetWorkdir()
Query the application working directory (data folder) Based on appcontext.getFilesDir().getPath() and Environment.getDataDirectory().getPath();

Returns:
path

API_GetAltWorkdir

public String API_GetAltWorkdir()
Query the application alternative working directory (such as folder on external SD card).

Returns:
path

API_GetLogPath

public String API_GetLogPath()
Query the application log file path. This is usually the workdir + webphonelog.dat

Returns:
path

API_RecFiles_Del

public boolean API_RecFiles_Del()
Delete local recorded files.

Returns:
true on success, false on failure

API_RecFiles_Clear

public boolean API_RecFiles_Clear()
Delete old recorded files.

Returns:
true on success, false on failure

API_RecFiles_List

public String API_RecFiles_List()
List pending voice record files.

Returns:
file names separated by comma

API_RecFiles_UploadEx

public boolean API_RecFiles_UploadEx(String filelist,
                                     String ftp)

API_RecFiles_Upload

public boolean API_RecFiles_Upload()
Upload pending recorded files (if ftp/http URI was set)

Returns:
true on success, false on failure

API_GetBindir

public String API_GetBindir()
Query the application path (folder with the app binaries or app home folder)

Returns:
path

API_IsOnline

public boolean API_IsOnline()
Query online state.
This is not the same with the register state (It can return true even if not registered)

Returns:
true if network connection can be made, otherwise false (no network or no internet connection).

API_RTPStat

public String API_RTPStat(int line)
Query for media quality reports. See the RTPSTAT notification for more details.
Note: if you call this function, RTPSTAT will not be sent automatically anymore after the rtpstat setting.

Parameters:
line - channel number
Returns:
media quality statistics

API_RTPStat

public String API_RTPStat()

API_VAD

public String API_VAD()
Query for global voice activity statistics. See the VAD notification for more details.
Note: if you call this function, VAD will not be sent automatically anymore. (So you will need to continue to poll for the details).

Returns:
voice activity statistics: VAD,local_vad: ON local_avg: 0 local_max: 0 local_speaking: no remote_vad: ON remote_avg: 0 remote_max: 0 remote_speaking: no

API_VAD

public String API_VAD(int line)
Query line for received voice activity statistics. See the VAD notification for more details.
Note: if you call this function, VAD will not be sent automatically anymore. (So you will need to continue to poll for the details).

Parameters:
line - channel number
Returns:
voice activity statistics: VAD,line: X remote_vad: ON remote_avg: 0 remote_max: 0 remote_speaking: no

API_VAD

public String API_VAD(boolean fromexternapi)

API_IsInCall

public int API_IsInCall()
Query of there is any call in progress.

Returns:
0 if no call is in progress, 1 if we have a ringing call or 2 if we have a connected call

API_IsSpeaking

public boolean API_IsSpeaking()
Query of there is any connected call.

Returns:
true if there is any connected call, otherwise false.

API_IsRegistered

public boolean API_IsRegistered()
Get the registered state.

Returns:
true if the UAC is registered (“connected”) to the SIP server.

API_Registered

public boolean API_Registered()
Get the registered state.

Returns:
true if the UAC is registered (“connected”) to the SIP server.

API_IsRegisteredEx

public int API_IsRegisteredEx()
Get the extended registered state.

Returns:
0=unknown,1=not needed,2=yes,3=working yes,4=working unknown,5=working no,6=unregistered,7=no (failed)

API_GetRegFailReason

public String API_GetRegFailReason()
Query the reason of the last failed registration. Set the extended parameter to true to get more details

Returns:
reason text of the last failed registered attempt

API_GetAccountRegState

public int API_GetAccountRegState(String uri)
Query account register state. Useful if you are using multiple accounts.

Parameters:
uri - the account uri in user@server format (or only the user or the server part if there are no other similar accounts)
Returns:
-4: not initialized or error, -3: invaid account input, -2: no such account, -1: not registering, 0: working, 1: success, 2: failed, 3: unregistered

API_GetAccountRegState

public int API_GetAccountRegState(String domain,
                                  String proxy,
                                  String username,
                                  String sipusername)
Query account register state. Useful if you are using multiple accounts.

Returns:
-4: not initialized or error, -3: invalid account input, -2: no such account, -1: not registering, 0: working, 1: success, 2: failed, 3: unregistered

API_GetAccountRegState

public int API_GetAccountRegState(String domain,
                                  String proxy,
                                  String username,
                                  String sipusername,
                                  boolean pushnotify,
                                  boolean strict)

API_GetAccountRegStateString

public String API_GetAccountRegStateString(String uri)
Query account register state. Useful if you are using multiple accounts.

Parameters:
uri - the account uri in user@server format (or only the user or the server part if there are no other similar accounts)
Returns:
status text (for example "Registered" if the account is registered to the server)

API_GetAccountRegStateString

public String API_GetAccountRegStateString(String domain,
                                                     String proxy,
                                                     String username,
                                                     String sipusername)
Query account register state. Useful if you are using multiple accounts.

Returns:
status text (for example "Registered" if the account is registered to the server)

API_GetAccountRegStateString

public String API_GetAccountRegStateString(String domain,
                                                     String proxy,
                                                     String username,
                                                     String sipusername,
                                                     boolean pushnotify,
                                                     boolean strict)

API_GetGlobalStatus

public String API_GetGlobalStatus()
Helper function to ask for the SIP stack state/details.

Returns:
SIP stack details

API_GetGlobalStatus

public String API_GetGlobalStatus(boolean shortlines)

API_GetRegFailReason

public String API_GetRegFailReason(boolean extended)
Query the reason of the last failed registration. Set the extended parameter to true to get more details

Parameters:
extended - set to true for extended report
Returns:
reason text of the last failed registered attempt

API_GetCurrentConnectedCallCount

public int API_GetCurrentConnectedCallCount()
Query the number of simultaneous calls currently in progress.

Returns:
the number of concurrent calls or 0 if there is no any calls.

API_SaveFile

public boolean API_SaveFile(String filename,
                            String content)
Will save the text file to local disk in the working directory in encrypted format (use API_SaveFileRaw to save as-is)

Parameters:
filename - file path
content - file content
Returns:
true on success, false on failure

API_SaveFileRaw

public boolean API_SaveFileRaw(String filename,
                               String content)
Will save the text file to local disk in the working directory as is.

Parameters:
filename - file path
content - file content
Returns:
true on success, false on failure

API_LoadFile

public String API_LoadFile(String filename)
Load file content from local disk.

Parameters:
filename - file path
Returns:
text file content

API_SaveFileRemote

public boolean API_SaveFileRemote(String filename,
                                  String content)
Save file to remote storage (preconfigured ftp or http server )

Parameters:
filename - file path
content - file content
Returns:
true on success, false on failure

API_LoadFileRemote

public boolean API_LoadFileRemote(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.

Parameters:
filename - file path
Returns:
true on success, false on failure

API_LoadFileRemoteSync

public String API_LoadFileRemoteSync(String filename)
Will download the specified file from remote storage synchronously (will block until done or fails).

Parameters:
filename - file path
Returns:
text file content

API_NeedRatingRequest

public boolean API_NeedRatingRequest()
Some servers might report call rating automatically in signaling.

Returns:
true if rating can be received only by API. return false if rating can be received automatically.

API_HTTPGet

public String API_HTTPGet(String uri)
Send a HTTP GET request.

Parameters:
uri - HTTP URI
Returns:
content or failure reason beginning with “ERROR”.

API_HTTPPost

public boolean API_HTTPPost(String uri,
                            String data)
Send a HTTP POST request.

Returns:
true on success, false on failure

API_HTTPReq

public String API_HTTPReq(String uri,
                                    String data)
Send a HTTP POST or GET request. (If data is empty, then GET will be sent). Can be tunneled. Can block for up to 20 seconds.

Parameters:
uri - HTTP URI
data - conent to post
Returns:
content or failure reason beginning with “ERROR”.

API_HTTPReqAsync

public boolean API_HTTPReqAsync(String uri,
                                String data)
Send a HTTP POST or GET request. (If data is empty, then GET will be sent). Can be tunneled. The result will be returned in notifications with “ANSWER” header.

Parameters:
uri - HTTP URI
data - conent to post
Returns:
true on success, false on failure

API_HTTPReqAsyncFavafone

public boolean API_HTTPReqAsyncFavafone(String uri,
                                        String data)

API_ShouldReset

public int API_ShouldReset()
Check if the sipstack should be restarted. Usually this is required only on local network change (such as IP change or changing from mobile data to wifi).

Returns:
0=no,1=not registered for a while,2=network changed

API_JSSendTest

public int API_JSSendTest(int count)

API_ShouldResetBeforeCall

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

Returns:
true if you should restart the sip stack before to make the call

API_RegisterNoParam

public boolean API_RegisterNoParam()

API_CheckConnection

public 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)


API_Register

public boolean API_Register()
Set parameters for authentication and register to the SIP server.
Will connect to the SIP server. This can be also done automatically by parameter (“register”). This function have to be called only once at the startup. Further re-registrations are done automatically based on the “registerinterval” parameter. When called subsequently, the old registrar endpoint is deleted, a new one will be created with a new call-id and AJVoIP will reregister.
Even if you wish to force re-registration, you should not call this more frequently than 40 seconds (because up to 40 seconds might be needed for a slow registration attempt)

Returns:
true on success, false on failure. The true return value doesn't mean successful registration (That it returned later via notifications)

API_StartStack

public 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.

Returns:
true on success, false on failure

API_Start

public 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. Don’t call it from JavaScript. Will start the engine.
The autostart behavior can be altered with the startsipstack setting.

Returns:
true on success, false on failure

API_Start2

public boolean API_Start2()

API_ReStart

public boolean API_ReStart()
Will restart the SIP stack.

Returns:
true on success, false on failure

API_StartInner

public boolean API_StartInner(boolean isrestart)

API_Register

public boolean API_Register(String server,
                            String username,
                            String password,
                            String authusername,
                            String displayname)

API_Register

public boolean API_Register(String server,
                            String username,
                            String password,
                            String authusername,
                            String displayname,
                            boolean async)
Set parameters for authentication and register to the SIP server.
Will connect to the SIP server. This can be also done automatically by parameter (“register”). This function have to be called only once at the startup. Further re-registrations are done automatically based on the “registerinterval” parameter. When called subsequently, the old registrar endpoint is deleted, a new one will be created with a new call-id and AJVoIP will reregister.
Even if you wish to force re-registration, you should not call this more frequently than 40 seconds (because up to 40 seconds might be needed for a slow registration attempt)

Parameters:
server - SIP server address (domain or IP:port)
username - SIP username
password - SIP password
authusername - 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.
Returns:
true on success, false on failure. The true return value doesn't mean successful registration (That it returned later via notifications)

API_Register

public boolean API_Register(String server,
                            String username,
                            String password,
                            String authusername,
                            String displayname,
                            String proxy)

API_RegisterEx

public boolean API_RegisterEx(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.

Parameters:
accounts - must have the following format: server,usr,pwd,ival;server2,usr2,pwd2, ival;
Returns:
true on success, false on failure. The true return value means that the operation was initiated successfully (not completed yet)

API_AddAccount

public boolean API_AddAccount(String uri)
Add/register (secondary) account.

Parameters:
uri - SIP URI (Example: user@domain. Can include also the password and port like usr:password@domain:port)
Returns:
true on success, false on failure

API_AddAccount

public boolean API_AddAccount(String server,
                              String proxy,
                              String username,
                              String sipusername,
                              String displayname,
                              String password,
                              int transport,
                              long registerinterval,
                              int ismain)
Add (secondary) account. If the account represented by the URI (username@server) already exists, then it will skip or merge. If no username or server address is provided, then JVoIP will use the main/global username/serveraddress.

Parameters:
server - SIP server address: domain or IP:port
proxy - outbound SIP proxy if any (required only if it is different then the above server address
username - SIP account user ID / extension ID
sipusername - SIP auth username for authentication (if different then the above username)
displayname - optional displayname / caller-id
password - SIP account password
transport - -1: auto, 0: UDP, 1: TCP, 2: TLS
registerinterval - register refresh timer in seconds (default is 3600)
ismain - -1: auto, 0: secondary account, 1: main account
Returns:
true on success, false on failure

API_AddAccount

public boolean API_AddAccount(String server,
                              String proxy,
                              String username,
                              String sipusername,
                              String displayname,
                              String password,
                              int transport,
                              long registerinterval)

API_AddAccount

public boolean API_AddAccount(String server,
                              String proxy,
                              String username,
                              String sipusername,
                              String displayname,
                              String password,
                              int transport,
                              long registerinterval,
                              boolean ismain)

API_SetAccount

public boolean API_SetAccount(String params)
Change (secondary) account.

Parameters:
params - account parameters separated by command as described at the extraregisteraccounts parameter.
Returns:
true on success, false on failure If the account represented by the URI doesn’t exists, then it will add as new account.

API_SetAccount

public boolean API_SetAccount(String server,
                              String proxy,
                              String username,
                              String sipusername,
                              String displayname,
                              String password,
                              int transport,
                              long registerinterval,
                              int ismain)
Change (secondary) account. If the account represented by the URI (username@server) doesn’t exists, then it will add as new account.

Parameters:
server - SIP server address: domain or IP:port
proxy - outbound SIP proxy if any (required only if it is different then the above server address
username - SIP account user ID / extension ID
sipusername - SIP auth username for authentication (if different then the above username)
displayname - optional displayname / caller-id
password - SIP account password
transport - -1: auto, 0: UDP, 1: TCP, 2: TLS
registerinterval - register refresh timer in seconds (default is 3600)
ismain - -1: auto, 0: secondary account, 1: main account
Returns:
true on success, false on failure

API_SetAccount

public boolean API_SetAccount(String server,
                              String proxy,
                              String username,
                              String sipusername,
                              String displayname,
                              String password,
                              int transport,
                              long registerinterval)

API_SetAccount

public boolean API_SetAccount(String server,
                              String proxy,
                              String username,
                              String sipusername,
                              String displayname,
                              String password,
                              int transport,
                              long registerinterval,
                              boolean ismain)

API_DelAccount

public boolean API_DelAccount(String uri)
Delete SIP account and unregister.

Parameters:
uri - SIP URI (Example: user@domain)

API_DelAccount

public boolean API_DelAccount(String uri,
                              boolean unregister)
Delete SIP account.

Parameters:
uri - SIP URI (Example: user@domain)
unregister - true if also unregister, false if keep the endpoint

API_GetMainAccount

public String API_GetMainAccount(boolean strict,
                                           int format)
Get the SIP URI of the main account.

Parameters:
strict - if set to true, then it will return the main global account (even if no accounts have been configured)
format - 1: full string, 2: SIP URI, 3: compact/display, 4: user part only, 5: domain part only .Default is 2

API_GetMainAccount

public String API_GetMainAccount()
Get the SIP URI of the main account.


API_GetMainAccount

public String API_GetMainAccount(boolean strict)

API_GetMainAccount

public String API_GetMainAccount(int format)

API_SetMainAccount

public boolean API_SetMainAccount(String uri)
Change/switch main account. If the specified account doesn’t exists yet, then it will create it.

Parameters:
uri - SIP URI

API_ListAccounts

public String API_ListAccounts()
Will return the list of the account URI's separated by semicolon ;


API_ListAccounts

public String API_ListAccounts(int format,
                                         String markmain,
                                         boolean withstatus,
                                         String separator)
Will return the list of the account URI's separated by semicolon ;

Parameters:
format - 1: full string, 2: SIP URI, 3: compact/display .Default is 2
markmain - any string to prefix the main account with (for example “*” or “[MAIN]”. Default is empty.
separator - string to separate the accounts. Default is semicolon; Example to display accounts for selection: API_ListAccounts(3, "*", true, "\r\n");

API_GetAccountForLine

public String API_GetAccountForLine(int line)
Get the account used for a call

Parameters:
line - the call line
Returns:
the account URI

API_GetAccountForLine

public String API_GetAccountForLine(int line,
                                              boolean strict)

API_GetAccountForLine

public String API_GetAccountForLine(int line,
                                              int format)

API_GetAccountForLine

public String API_GetAccountForLine(int line,
                                              boolean strict,
                                              int format)
Get the account used for a call

Parameters:
line - the call line
strict - if false then it will return local endpoint URI even if account doesn't exists; if true then it will return only exact account match; default is false
format - 1: full string, 2: SIP URI, 3: compact/display, 4: user part only, 5: domain part only .Default is 2
Returns:
the account URI

API_GetAccount

public String API_GetAccount(String uri)
Get account details.

Parameters:
uri - SIP URI (Example: user@domain)
Returns:
the account string as described at extraregisteraccounts

API_GetAccount

public String API_GetAccount(String uri,
                                       boolean strict)
Get account details.

Parameters:
uri - SIP URI (Example: user@domain)
if - strict is false, then will accept also partial match. if true then requires exact match. default is false.
Returns:
the account string as described at extraregisteraccounts

API_RegisterAsync

public boolean API_RegisterAsync()

API_GetVersion

public String API_GetVersion()
Get the SIP stack version number.

Returns:
version string

API_GetExeVersion

public int API_GetExeVersion()
Get the SDK version

Returns:
MAPPVERSION

API_GetBuildNumber

public int API_GetBuildNumber()
Get the BUILDNUMBER

Returns:
BUILDNUMBER

API_TestService

public String API_TestService()
Test API

Returns:
string

API_GuiStarted

public String API_GuiStarted()
Test API

Returns:
string

CleanCredentials

public void CleanCredentials()

API_ClearCredentials

public boolean API_ClearCredentials()
Clear existing user account details.

Returns:
true on success, false on failure

API_Unregister

public boolean API_Unregister()
Will stop all endpoints (hangup current calls if any and unregister)

Returns:
true on success, false on failure

API_Unregister

public boolean API_Unregister(int waitfor)
Will stop all endpoints (hangup current calls if any and unregister)

Parameters:
waitfor - -1 (auto), 0 (do not wait) or 1 (wait for unregister to complete before to return).
Returns:
true on success, false on failure

API_Unregister

public boolean API_Unregister(String account)
Will unregister an account (hangup current calls if any and unregister)

Parameters:
account - username or SIP URI or Call-ID to unregister (in case if you have multiple/extra registered accounts)
Returns:
true on success, false on failure

API_Unregister

public boolean API_Unregister(String account,
                              int waitfor)
Will unregister an account (hangup current calls if any and unregister)

Parameters:
account - username or SIP URI or Call-ID to unregister (in case if you have multiple/extra registered accounts)
waitfor - -1 (auto), 0 (do not wait) or 1 (wait for unregister to complete before to return)
Returns:
true on success, false on failure

API_Unregister

public boolean API_Unregister(String account,
                              String server,
                              int waitfor)
Will unregister an account (hangup current calls if any and unregister)

Parameters:
account - username or SIP URI or Call-ID (in case if you have multiple/extra registered accounts)
server - ths SIP server address (in case if you have accounts across multiple servers)
waitfor - -1 (auto), 0 (do not wait) or 1 (wait for unregister to complete before to return)
Returns:
true on success, false on failure

API_Unregister

public boolean API_Unregister(String account,
                              String server,
                              int waitfor,
                              int stopallsessions)
Unregister a SIP account

Parameters:
account - username or SIP URI (user@server) or Call-ID (in case if you have multiple/extra registered accounts)
server - SIP server address (optional. might be used in case if you have accounts across multiple servers)
waitfor - -1 (auto), 0 (do not wait) or 1 (wait for unregister to complete before to return)
stopallsessions - -1 (auto), 0 (only unregister) or 1 (disconnect all other sessions belonging to this account)
Returns:
true on success, false on failure

API_Unregister

public boolean API_Unregister(String account,
                              int waitfor,
                              int stopallsessions)

API_Unregister

public boolean API_Unregister(String account,
                              int waitfor,
                              int stopallsessions,
                              boolean delaccount)

API_Unregister

public boolean API_Unregister(String account,
                              String server,
                              int waitfor,
                              int stopallsessions,
                              boolean delaccount)
Unregister a SIP account

Parameters:
account - username or SIP URI or Call-ID (in case if you have multiple/extra registered accounts)
server - SIP server address (optional. might be used in case if you have accounts across multiple servers)
waitfor - -1 (auto), 0 (do not wait) or 1 (wait for unregister to complete before to return)
stopallsessions - -1 (auto), 0 (only unregister) or 1 (disconnect all other sessions belonging to this account)
Returns:
true on success, false on failure

API_Unregister

public boolean API_Unregister(String account,
                              String server,
                              int waitfor,
                              int stopallsessions,
                              int delaccount)

API_Exit

public void API_Exit()
Will destroy the SIP stack. Usually should not be used. Stop all endpoints and terminates the java sip application. This function call is optional when you unload the JVoIP java module or wish to issue a forced termination. Its behavior can be controlled by the “exitmethod” parameter.


API_ExitEx

public void API_ExitEx()
Will destroy the SIP stack and also will exit the Java Virtial Machine.
Should not be used.


API_CapabilityRequest

public boolean API_CapabilityRequest(String server,
                                     String username)
Request server or server capabilities with SIP OPTIONS.
Rarely needed if any.

Parameters:
server - peer or server SIP signaling address (IP:port or domain)
username - user name to be sent in the SIP request
Returns:
true on success, false on failure

API_CapabilityRequest

public boolean API_CapabilityRequest()
Will send an OPTION request to the server. Usually you should not use this function.
The server parameter can be empty if you already set it with other API calls or by parameter.
The username parameter can be empty (in this case the “From” address will be set to “unknown”)

Returns:
true on success, false on failure

API_SendSIPMessage

public boolean API_SendSIPMessage(int line,
                                  String msg,
                                  String body,
                                  String account,
                                  String target)
Send custom SIP signaling message.

Parameters:
line - endpoint where the message will be sent. -3: new endpoint, -2: all endpoints, -1: current active, 0: register endpoint, 1+: call channel number
msg - 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 parameter
target - optional target username, number of SIP URI if not specified in the msg
Returns:
true on success, false on failure

API_SendSIPMessage

public boolean API_SendSIPMessage(int line,
                                  String msg,
                                  String body,
                                  String account)

API_SendSIPMessage

public boolean API_SendSIPMessage(int line,
                                  String msg,
                                  String body)

API_SendSIPMessage

public boolean API_SendSIPMessage(int line,
                                  String msg)

API_SO

public boolean API_SO(String peer,
                      boolean on,
                      String server,
                      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.

Parameters:
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 off
server - 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", "");

API_SendSIP

public boolean API_SendSIP(String msg)
Send custom SIP signaling message (for example OPTIONS, NOTIFY, etc) on the current active line.

Parameters:
msg - SIP message to send
Returns:
true on success, false on failure

API_SendSIPMethod

public boolean API_SendSIPMethod(int msg)

API_GetSIPHeader

public String API_GetSIPHeader(int line,
                                         String hdr)
Return a sip header value received by JVoIP. If not found it will return a string beginning with “ERROR:” such as “ERROR: no such line”.

Parameters:
line - channel number
hdr - SIP header to request
Returns:
SIP header value

API_GetSIPHeaderInternal

public String API_GetSIPHeaderInternal(int line,
                                                 String hdr)

API_GetSDPField

public String API_GetSDPField(int line,
                                        String field)
Return a SDP field value received by JVoIP

Parameters:
line - endpoint
field - SDP key
Returns:
SDP field value. If not found it will return a string beginning with “ERROR:” such as “ERROR: no such line”

API_GetSIPMessage

public String API_GetSIPMessage(int line,
                                          int dir,
                                          int type)
Return the last received or sent SIP signaling message as raw text.

Parameters:
line - channel number
dir - 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)
Returns:
the SIP message

API_AI

public boolean API_AI(int line,
                      boolean start)
Start/stop realtime AI streaming at run-time

Parameters:
line - channel number. -2: all current calls, -1 the current active line, 0: only enable/disable the AI module globally, 1+: start/stop AI on the specific line.
start - true to start/connect, false to stop/disconnect

API_AI

public boolean API_AI(int line,
                      int start)

API_AI

public boolean API_AI(int line)

API_AI

public boolean API_AI(boolean start)

API_AI

public boolean API_AI()

API_AI

public boolean API_AI(int line,
                      int start,
                      String params)

API_GetAI

public SIPNotification.AI API_GetAI(int line)

API_AISend

public boolean API_AISend(int line,
                          String msg)
Send a message directly on the AI comnnection (usuaally a websocket)

Parameters:
line - endpoint channel number
msg - message to send (usually JSON)

API_AISend

public boolean API_AISend(int line,
                          String msg,
                          boolean isaudio)

API_SetLineParameter

public boolean API_SetLineParameter(int line,
                                    String param,
                                    String value,
                                    int permanent)
Set parameter for a specific current/next/all line.

Parameters:
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
Returns:
true on success, false on failure Note: remove line setting by passing "NULL" as the value. Remove all settings for all lines by passing 0 for the line and empty or NULL for both the key and the value.

API_SetLineParameter

public boolean API_SetLineParameter(int line,
                                    String param,
                                    int value,
                                    int permanent)

API_SetLineParameter

public boolean API_SetLineParameter(int line,
                                    String param,
                                    long value,
                                    int permanent)

API_SetLineParameter

public boolean API_SetLineParameter(int line,
                                    String param,
                                    boolean value,
                                    int permanent)

API_GetLineParameter

public String API_GetLineParameter(int line,
                                             String param)
Get line specific parameter for a specific current/next/all line.

Parameters:
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)
Returns:
value as string

API_SetSIPHeader

public boolean API_SetSIPHeader(int line,
                                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).

Parameters:
line - channel number
hdr - SIP header (line) to set
Returns:
true on success, false on failure

API_SetSDPField

public boolean API_SetSDPField(int line,
                               String field,
                               int type)

API_RTPHeaderExtension

public boolean API_RTPHeaderExtension(int line,
                                      int profile,
                                      int extension)
Set RTP header extension for the RTP packets

Parameters:
line - channel number
profile - profile number
extension - bytes to send as string or int
Returns:
true if send initialized successfully or false on failure. Received RTP header extension can be seen from the RTPE notifications.

API_RTPHeaderExtension

public boolean API_RTPHeaderExtension(int line,
                                      int profile,
                                      String extension)

API_ED137PTT

public boolean API_ED137PTT(int line,
                            int ptt)

API_ED137PTT

public boolean API_ED137PTT(int line,
                            int ptt,
                            int pttid)
ED-137 Push to talk

Parameters:
line - channel number
ptt - (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)
Returns:
true if send initiated successfully or false on failure.

API_ED137PTT

public boolean API_ED137PTT(int line,
                            int ptt,
                            int pttid,
                            Endpoint calledfromep)

API_SetUUI

public boolean API_SetUUI(int line,
                          String value,
                          int fortarget)
Set a custom UUI (User-to-User Call Control Information as described in RFC 7433).

Parameters:
line - channel number
value - UUI data (can include also parameters. Example: 56a390f3d2b7310023a2;encoding=hex;purpose=foo;content=bar
fortarget - 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
Returns:
true on success, false on failure

API_ServerInit

public boolean API_ServerInit(String ip)

API_NATKeepAlive

public boolean API_NATKeepAlive(String server)
Rarely needed if any, because the siptack will do it automatically.

Parameters:
server - target server addresss

API_Register

public boolean API_Register(String server,
                            String username,
                            String password)

API_LineToCallID

public 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.

Parameters:
line - channel number
Returns:
call-id string or empty string if no such line found

LineToCallID

public String LineToCallID(int line)

API_CallIDToLine

public int API_CallIDToLine(String callid)
Get the line number for a SIP Call-ID.

Parameters:
callid - SIP Call-ID string
Returns:
line number or -1 if no such Call-ID exists

CallIDToLine

public int CallIDToLine(String callid)

API_NextCallID

public String API_NextCallID(String callid)
Set or get the SIP Call-ID used for the first upcoming new SIP session.

Parameters:
callid - the new SIP Call-ID or empty string
Returns:
the new/next SIP Call-ID

API_NextCallID

public String API_NextCallID()

API_SetLine

public boolean API_SetLine(int line)
Will set the current channel.
Use only if you present line selection for the users. Otherwise you don’t have to take care about the lines.
Note: Instead of using each API call with the line parameter, you can just use this function when you wish to change the active line and use all the other API calls with -1 for the line parameter.

Parameters:
line - channel number
Returns:
true on success, false on failure

API_SetLineEx

public boolean API_SetLineEx(String line)
Will set the current channel.
Use only if you present line selection for the users. Otherwise you don’t have to take care about the lines.
Note: Instead of using each API call with the line parameter, you can just use this function when you wish to change the active line and use all the other API calls with -1 for the line parameter.

Parameters:
line - channel number, SIP Call-ID or peer username/number
Returns:
true on success, false on failure

API_GetLine

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

Returns:
the current active channel number

API_SetKey

public boolean API_SetKey(String key)

API_Call

public boolean API_Call(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)

Parameters:
number - peer, destinationnumber, SIP username or SIP URI to call
Returns:
true on success, false on failure. The true return value means that the call was initiated successfully (Not completed yet. You will receive STATUS notifications about the call state)

API_Call

public boolean API_Call(int line,
                        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)

Parameters:
line - channel number
number - peer, destinationnumber, SIP username or SIP URI to call
Returns:
true on success, false on failure. The true return value means that the call was initiated successfully (Not completed yet. You will receive STATUS notifications about the call state)

API_Call

public boolean API_Call(int line,
                        String number,
                        String callparameters)

API_CallEx

public boolean API_CallEx(int line,
                          String peer,
                          int type)

API_CallEx

public boolean API_CallEx(int line,
                          String peer,
                          int type,
                          String callparameters)

API_Call

public boolean API_Call(int line,
                        String peer,
                        int calltype,
                        String callparameters)
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)

Parameters:
line - channel number
peer - destinationnumber, SIP username or SIP URI to call
type - optinal call type: -1: auto/default, 0: audio, 1: video, 2: screen-sharing
callparameters - optinal parameters for the call session
Returns:
true on success, false on failure. The true return value means that the call was initiated successfully (Not completed yet. You will receive STATUS notifications about the call state)

API_Call

public boolean API_Call(int line,
                        String peer,
                        int calltype)

API_Call

public boolean API_Call(int line,
                        String peer,
                        int calltype,
                        int audiodirection,
                        int videodirection)

API_Call

public boolean API_Call(int line,
                        String peer,
                        int calltype,
                        int audiodirection,
                        int videodirection,
                        String callparameters)
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)

Parameters:
line - channel number
peer - destinationnumber, SIP username or SIP URI to call
calltype - call type: -1: auto/default, 0: audio, 1: video, 2: screen-sharing
audiodirection - 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)
callparameters - optinal parameters for the call session
Returns:
true on success, false on failure. The true return value means that the call was initiated successfully (Not completed yet. You will receive STATUS notifications about the call state)

API_Call_Now

public boolean API_Call_Now(int line,
                            String number)

API_Call_Now

public boolean API_Call_Now(int line,
                            String number,
                            int calltype,
                            int audiodirection,
                            int videodirection)

API_Call_Now

public boolean API_Call_Now(int line,
                            String number,
                            int calltype,
                            int audiodirection,
                            int videodirection,
                            String callparameters)

API_VideoTest

public boolean API_VideoTest()

API_GetVideoDeviceList

public String API_GetVideoDeviceList()
Query video recording devices.

Returns:
list of installed camera devices or empty string if none are found

API_GetVideoDeviceList

public String API_GetVideoDeviceList(int async,
                                               boolean strict)
Query video recording devices.

Parameters:
async - optional parameter: 2: immediately never blocking, 1: returns immediately only if already cached, 0: always blocking reload
strict - ptional parameter: false: might failback to old cached result, true: it will return empty string if can’t list the video input devices
Returns:
list of installed camera devices or empty string if none are found

API_GetVideoDevice

public String API_GetVideoDevice()
Query the video device in use.

Returns:
selected video input device name if any (camera/webcam device name)

API_SetVideoDevice

public boolean API_SetVideoDevice(String devicename)
Set the video input device.

Parameters:
devicename - camera/webcam device name. Set to "Default" to try using the default device.
Returns:
true on success or false on failure

API_VideoAccept

public boolean API_VideoAccept(int accept,
                               int direction,
                               boolean remember)

API_VideoDisplayAccept

public boolean API_VideoDisplayAccept()

API_VideoGetCodec

public String API_VideoGetCodec()

API_VideoGetPayload

public int API_VideoGetPayload()

API_VideoFileExt

public String API_VideoFileExt()

API_VideoGetCointainer

public String API_VideoGetCointainer()

API_GetVideoRTPAddrForPlayback

public String API_GetVideoRTPAddrForPlayback()
Return the rtsp socket address. For old/android only.


API_SendVideoRTP

public boolean API_SendVideoRTP(int line,
                                byte[] buffer,
                                int length)
Stream video to remote peer by passing video RTP packets with this function

Parameters:
line - channel number
buffer - video RTP data
length - buffer size
Returns:
true on success, false on failure

API_VideoPreview

public boolean API_VideoPreview()

API_VideoPreview

public boolean API_VideoPreview(int line)

API_VideoPreview

public boolean API_VideoPreview(int line,
                                int type)
Launch local video preview

Parameters:
line - optional channel number. default is -1. 3 means to be launched separately
type - optinal video_preview type
Returns:
disconnect reason text

API_AddVideo

public boolean API_AddVideo()
Add video media for an existing voice call.

Returns:
true on success, false on failure

API_AddVideo

public 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.

Parameters:
line - channel number
type - call-type: 1: add video 2: add screen-sharing
direction - set hold state: -1: inactive, 0: sendonly, 1: recvonly, 2: both
Returns:
true on success, false on failure

API_AddVideo_Now

public boolean API_AddVideo_Now(int line,
                                int type,
                                int direction)

API_StopVideo

public boolean API_StopVideo()
Remove the video stream

Returns:
true on success, false on failure

API_StopVideo

public 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

Parameters:
line - channel number
direction - 0: stop send, 1: stop receive, 2: stop both way
Returns:
true on success, false on failure (Success doesn't mean call connected here)

API_StopVideo_Now

public boolean API_StopVideo_Now(int line,
                                 int direction)

API_SwitchVideo

public boolean API_SwitchVideo(int line,
                               int type)

API_SwitchVideo_Now

public boolean API_SwitchVideo_Now(int line)

API_Hangup

public boolean API_Hangup()
Disconnect call.

Returns:
true on success, false on failure

API_Hangup

public boolean API_Hangup(int line)
Disconnect current call(s).

Parameters:
line - channel number
Returns:
true on success, false on failure

API_Hangup

public boolean API_Hangup(int line,
                          String reason)
Disconnect current call(s).

Parameters:
line - channel number
reason - disconnect reason text
Returns:
true on success, false on failure

API_GetLastCallDetails

public String API_GetLastCallDetails()
Get details about the last finished call.

Returns:
call details

API_GetProfileStatusText

public String API_GetProfileStatusText(String username)
Get the profile status text for this user.

Returns:
profile status text

API_GetMySIPURI

public 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.

Parameters:
all - if set to true, then it will return all possible URI’s separated by comma. Otherwise it will return single main URI
Returns:
main URI or multiple possible URI separated by comma

API_SetSSLContext

public boolean API_SetSSLContext(javax.net.ssl.SSLContext sc)
Set custom SSLContext for new TLS connections.

Parameters:
sc - SSLContext object prepared by you
Returns:
true on success, false on failure

API_GetIncomingDisplay

public String API_GetIncomingDisplay()
Get incoming caller id (might return two lines: caller id \n caller name)

Returns:
details like: name, number, for incoming calls

API_GetIncomingDisplay

public String API_GetIncomingDisplay(int line)
Get incoming caller id (might return two lines: caller id \n caller name)

Parameters:
line - channel number
Returns:
details like: name, number, for incoming calls

HandleConfRequest

public boolean HandleConfRequest()

API_Accept

public boolean API_Accept()
Connect incoming call.

Returns:
true on success, false on failure (Success doesn't mean call connected here)

API_Accept

public boolean API_Accept(int line)
Connect incoming call on the specified line.

Parameters:
line - channel number
Returns:
true on success, false on failure (Success doesn't mean call connected here)

API_Accept

public boolean API_Accept(int line,
                          int calltype)
Connect incoming call.

Parameters:
line - channel number
calltype - -1: default, 0: audio only, 1: with video, 2: force video
Returns:
true on success, false on failure (Success doesn't mean call connected here)

API_Accept

public boolean API_Accept(int line,
                          int calltype,
                          int audiodirection,
                          int videodirection)
Connect incoming call.

Parameters:
line - channel number
calltype - specify call type: -1: default, 0: audio only, 1: with video, 2: force video
audiodirection - 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)
Returns:
true on success, false on failure (Success doesn't mean call connected here)

API_Accept

public boolean API_Accept(int line,
                          int calltype,
                          int strict)
Connect incoming call.

Parameters:
line - channel number
calltype - specify call type: -1: default, 0: audio only, 1: with video, 2: force video
strict - set to 1 to strictly treat the line parameter. otherwise might auto guess the best line if incorrect
Returns:
true on success, false on failure (Success doesn't mean call connected here)

API_Accept

public boolean API_Accept(int line,
                          int calltype,
                          int strict,
                          int audiodirection,
                          int videodirection)
Connect incoming call.

Parameters:
line - channel number
calltype - specify call type: -1: default, 0: audio only, 1: with video, 2: force video
strict - set to 1 to strictly treat the line parameter. otherwise might auto guess the best line if incorrect
audiodirection - 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)
Returns:
true on success, false on failure (Success doesn't mean call connected here)

API_AcceptStrict

public boolean API_AcceptStrict(int line)
Deprecated. by API_Accept strict parameter

Connect incoming call.
Will accept the call only if the line strictly match an incoming channel number.

Parameters:
line - channel number
Returns:
true on success, false on failure

API_Ignore

public boolean API_Ignore(int line)
Ignore incoming call.

Parameters:
line - channel number
Returns:
true on success, false on failure

API_Forward

public boolean API_Forward(String peer)
Forward incoming call to peer (with 302 Moved Temporarily disconnect code)

Parameters:
peer - forward to target
Returns:
true on success, false on failure

API_Forward

public boolean API_Forward(int line,
                           String peer)
Forward incoming call to peer (with 302 Moved Temporarily disconnect code)

Parameters:
line - channel number
peer - forward to target
Returns:
true on success, false on failure

API_Reject

public boolean API_Reject()
Reject incoming call.
You could also use the Hangup API function for this.

Returns:
true on success, false on failure

API_Reject

public boolean API_Reject(int line)
Reject incoming call.
You could also use the Hangup API function for this.

Parameters:
line - channel number
Returns:
true on success, false on failure

API_Reject

public boolean API_Reject(int line,
                          String reason)
Reject incoming call.
You could also use the Hangup API function for this.

Parameters:
line - channel number
reason - disconnect reason text
Returns:
true on success, false on failure

API_HandleCall

public boolean API_HandleCall(int line)
Handle incoming call (send ringing, prepare media, process early media, etc).
This function should be used only if the incoming call handling have been deferred using the deferincomingcall parameter.

Parameters:
line - channel number
Returns:
true on success, false on failure

API_SoftphoneVideoCall

public boolean API_SoftphoneVideoCall(String peer)

API_SoftphoneScreenshare

public boolean API_SoftphoneScreenshare(String peer)

API_RejectEx

public boolean API_RejectEx(int line,
                            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.

Parameters:
line - channel number
Returns:
true on success, false on failure

API_ScreenShare

public boolean API_ScreenShare(String peer)

API_ScreenShareAccept

public boolean API_ScreenShareAccept(String peer)

API_ScreenShareReject

public boolean API_ScreenShareReject(String peer)

API_IsIncomingVideo

public boolean API_IsIncomingVideo()
Check if current incoming call is video call.

Returns:
true if video call, false if audio call

API_GetIncomingVideoEndpoint

public int API_GetIncomingVideoEndpoint(int line)
Return line number of the incoming video call if any, otherwise -1.

Parameters:
line - preferred channel number
Returns:
line number with video call or -1 if no video call found

API_GetVideoEndpoint

public int API_GetVideoEndpoint(int line)
Return line number for the video call if any, otherwise -1.

Parameters:
line - preferred channel number
Returns:
line number with video call or -1 if no video call found

API_GetVideoSDPFilePath

public String API_GetVideoSDPFilePath(int line,
                                                boolean force)
Return SDP file path.

Parameters:
line - preferred channel number
force - if true, then it will check only for endpoints with video. if false, then will return the path even if the endpoint is audio only
Returns:
SDP file path or empty string

API_GetVideoSDPFilePath

public String API_GetVideoSDPFilePath(int line)

API_GetVideoSDPFilePath

public String API_GetVideoSDPFilePath()

API_GetLastRecInvite

public String API_GetLastRecInvite()
Get last received INVITE message.

Returns:
message text

API_GetLastSentInvite

public String API_GetLastSentInvite()
Get last sent INVITE message.

Returns:
message text

API_AddLog

public boolean API_AddLog(String text)
Add to sip stack log.

Parameters:
text - log text
Returns:
true on success, false on failure

API_AddLog

public boolean API_AddLog(int level,
                          String text)
Add to sip stack log.

Parameters:
level - log level
text - log text
Returns:
true on success, false on failure

API_Log

public boolean API_Log(String str)
Deprecated. 

Send a log to JVoIP (to write it in its own logfile/console/etc)

Parameters:
str - the log message
Returns:
false if failed, true if processed

API_GetLastRecSIPMessage

public String API_GetLastRecSIPMessage(String line)
Get last received SIP message.

Parameters:
line - channel number
Returns:
message text

API_GetDiscReasonText

public String API_GetDiscReasonText(String line)
Query the disconnect reason of the last disconnected call.

Parameters:
line - can be line number or SIP call-id
Returns:
disconnect reason text

API_GetDiscReasonCode

public int API_GetDiscReasonCode(String line)
Query the disconnect reason SIP code of the last call or register.

Parameters:
line - can be line number or SIP call-id
Returns:
disconnect reason text

API_TransferDialog

public boolean API_TransferDialog()
Show the call transfer input box.

Returns:
true on success, false on failure

API_PushContactlist

public boolean API_PushContactlist(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

Parameters:
userlist - users separated by comma (or a single user)
Returns:
true on success, false on failure

API_SetBlacklist

public boolean API_SetBlacklist(String str)
Set whole blacklist.

Parameters:
str - users/numbers separated by comma
Returns:
true on success, false on failure

API_GetBlacklist

public String API_GetBlacklist()
Query the current blacklist

Returns:
blacklisted users serparated by comma

API_AddToBlacklist

public boolean API_AddToBlacklist(String str)
Add user to blacklist

Parameters:
str - username, phone number or SIP URI to block
Returns:
true on success, false on failure

API_SetWhitelist

public boolean API_SetWhitelist(String str)
Set whole whitelist.
Only these peers will be allowed.

Parameters:
str - users/numbers separated by comma
Returns:
true on success, false on failure

API_GetWhitelist

public String API_GetWhitelist()
Query the current whitelist

Returns:
blacklisted users serparated by comma

API_AddToWhitelist

public boolean API_AddToWhitelist(String str)
Add user to whitelist

Parameters:
str - username, phone number or SIP URI to block
Returns:
true on success, false on failure

API_NumExists

public 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.

Returns:
true on success, false on failure

API_NumExistsEx

public boolean API_NumExistsEx(String contactlist)

API_GetPresenceStatus

public String API_GetPresenceStatus()
Query local presence state.

Returns:
presence text

API_SetPresenceStatus

public boolean API_SetPresenceStatus(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.

Parameters:
status - one of the followings strings: Online, Away, DND, Invisible , Offline (case sensitive) .
Returns:
true on success, false on failure

API_NewUser

public boolean API_NewUser(String user)
On newuser, you should ask the user if wish to accept it. If accepted, call the API_NewUser function.
The same function should be called when the user adds a new contact to its contactlist.

Parameters:
user - username of the user to accept
Returns:
true on success, false on failure

API_Unsubscribe

public boolean API_Unsubscribe()
You might use the API_UnSubscribe() API to unsubscribe all endpoints (this includes presence, voicemail and BLF subscribes).

Returns:
true on success, false on failure

API_CheckPresence

public boolean API_CheckPresence(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. We recommend up to 50 contacts. If the user select a contact, then you can call this function later with that single contact to request its status).
This function will start to send SUBSCRIBE requests.

Parameters:
userlist - users separated by comma (or a single user)
Returns:
true on success, false on failure

API_CheckBLF

public boolean API_CheckBLF(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.

Parameters:
userlist - users/extensions/phone numbers separated by comma (it can be a single entry)
Returns:
true on success, false on failure

API_DisableBLF

public boolean API_DisableBLF(String userlist)
Remove extension(s) from BLF watch list (blfuserlist).
Note: existing BLF subscriptions might not be affected until next session.

Parameters:
userlist - users/extensions/phone numbers separated by comma (it can be a single entry)
Returns:
true on success, false on failure

API_SetContact

public boolean API_SetContact(String name,
                              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.


API_SetContactPhone

public boolean API_SetContactPhone(String name,
                                   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.


API_SetContactSIP

public boolean API_SetContactSIP(String name,
                                 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.


API_SetContactName

public boolean API_SetContactName(String name,
                                  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.


API_SetContactSpeedDial

public boolean API_SetContactSpeedDial(String name,
                                       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.


API_SetContactStatus

public boolean API_SetContactStatus(String name,
                                    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.


API_GetContactPhone

public String API_GetContactPhone(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.


API_GetContactSIP

public String API_GetContactSIP(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.


API_GetContactName

public String API_GetContactName(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.


API_GetContactSpeedDial

public String API_GetContactSpeedDial(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.


API_AddContact

public boolean API_AddContact(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.


API_DelContact

public boolean API_DelContact(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.


API_GetContact

public String API_GetContact(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.


API_GetContactPresence

public String API_GetContactPresence(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.


API_GetContactPresenceStr

public String API_GetContactPresenceStr(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.


API_SetContacts

public boolean API_SetContacts(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.


API_GetContacts

public 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.


API_Conf

public boolean API_Conf(String number)
Create conference call by adding number to the current call.

Parameters:
number - destination number, username or SIP URI
Returns:
true on success, false on failure

API_Conf

public boolean API_Conf(int line,
                        String number,
                        boolean add,
                        int confline)
Add/remove people to/from conference.

Parameters:
line - channel number (to be created/added or removed)
number - destination number, username or SIP URI
add - set to true to add this number or false to remove
confline - existing line in conference in which this new conference party will be added
Returns:
true on success, false on failure

API_ConfEx

public boolean API_ConfEx(int line,
                          String number,
                          boolean add,
                          int confline)

API_ConfEx

public boolean API_ConfEx(int line,
                          String number,
                          boolean add)

API_ConfEx

public boolean API_ConfEx(int line,
                          String number)

API_ConfEx

public boolean API_ConfEx(int line)

API_Conf

public boolean API_Conf(int line,
                        String number,
                        boolean add)

API_Conf

public boolean API_Conf(int line,
                        String number)

API_Conf

public boolean API_Conf(int line)

API_Transfer

public boolean API_Transfer(int line,
                            String number,
                            int calltype)
Transfer current call to peer which is usually a phone number or a SIP username. (Will use the REFER method after SIP standards).
You can set the mode of the transfer with the “transfertype” parameter.
If the peer parameter is empty than will interconnect the currently running calls (should be used only if you have 2 simultaneous calls)

Parameters:
line - channel number
number - destination number (transfer-to)
calltype - -1: auto guess, 0: audio only, 1: audio + video, 2: screen sharing
Returns:
true on success, false on failure

API_Transfer

public boolean API_Transfer(int line,
                            String number,
                            String callparameters)

API_Transfer

public boolean API_Transfer(int line,
                            String number,
                            int calltype,
                            String callparameters)

API_Transfer

public boolean API_Transfer(int line,
                            String number)

API_Transfer

public boolean API_Transfer(int line)

API_Transfer

public boolean API_Transfer(String number)

API_Transfer

public boolean API_Transfer()

API_Mute

public boolean API_Mute(int line,
                        boolean mute)
Mute current call.

Parameters:
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.
Returns:
true on success, false on failure

API_MuteArg

public boolean API_MuteArg(int line,
                           boolean mute,
                           int what)

API_Mute

public boolean API_Mute(int line,
                        boolean mute,
                        int what)
Mute current call.
Same as the Mute API.

Parameters:
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)
Returns:
true on success, false on failure

API_MuteEx

public boolean API_MuteEx(int line,
                          boolean mute,
                          int what)

API_ServerIsMizu

public boolean API_ServerIsMizu()
Check if server is Mizutech software.

Returns:
false: Third-party or unknown, true: Mizutech softswitch, gateway or proxy

API_PeerIsMizu

public boolean API_PeerIsMizu(int line)
Check if peer is Mizutech software.

Returns:
false: Third-party or unknown, true: Mizutech softphone or webphone

API_IsMuted

public int API_IsMuted(int line)
Return if the selected line is muted or not.

Parameters:
line - channel number
Returns:
-1: unknown, 0: not muted, 1: both muted (in/out), 2: out muted (speaker), 3: in muted (microphone), 4: both muted (in/out; same as 1)

API_IsMutedIntern

public int API_IsMutedIntern(int line)

API_IsMutedIntern

public int API_IsMutedIntern(int line,
                             boolean intern)

API_IsOnHold

public int API_IsOnHold(int line)
Query if the selected line is on hold or not

Parameters:
line - channel number
Returns:
-1: unknown, 0: no, 1: not used, 2: on hold, 3: other party held, 4: both in hold

API_IsOnHoldIntern

public int API_IsOnHoldIntern(int line)

API_IsOnHoldIntern

public int API_IsOnHoldIntern(int line,
                              boolean intern)

API_Hold

public boolean API_Hold(int line,
                        boolean hold)
Put call on hold. This will trigger an UPDATE or a reINVITE request.

Parameters:
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.
Returns:
true on success, false on failure

API_HoldEx

public boolean API_HoldEx(int line,
                          int direction,
                          int media)
Put call on hold. This will trigger an UPDATE or a reINVITE request.

Parameters:
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)
Returns:
true on success, false on failure

API_Hold

public boolean API_Hold(int line,
                        int direction)
Put call on hold. This will trigger an UPDATE or a reINVITE request.

Parameters:
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)
Returns:
true on success, false on failure

API_Hold

public boolean API_Hold(int line)
Put call on hold. This will trigger an UPDATE or a reINVITE request.

Parameters:
line - channel number (-3 means for next INVITE/OK)
Returns:
true on success, false on failure

API_Hold

public boolean API_Hold()
Put call on hold. This will trigger an UPDATE or a reINVITE request.

Returns:
true on success, false on failure

API_Hold

public boolean API_Hold(int line,
                        int direction,
                        int media)
Put call on hold. This will set the hold state of the endpoint and might trigger an UPDATE or a reINVITE request.

Parameters:
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 hold
media - 0=audio, 1=video, 2=both
Returns:
true on success, false on failure

API_HoldChange

public boolean API_HoldChange(int line)
Togle hold state of the call.

Parameters:
line - channel number
Returns:
true on success, false on failure

API_Dtmf

public boolean API_Dtmf(int line,
                        String dtmf)
Send DTMF message by In-Band,SIP INFO or RFC2833 method (depending on the “dtmfmode” parameter).

Parameters:
line - channel number
dtmf - one or more dtmf digits. Use the space char to insert delays between the digits.
Returns:
true on success, false on failure

API_Dtmf

public boolean API_Dtmf(String dtmf)

API_Info

public boolean API_Info(int line,
                        String msg)
Send custom INFO message (for DTMF use the API_Dtmf function instead).

Parameters:
line - channel number
msg - message to send
Returns:
true on success, false on failure

API_SendChat

public boolean API_SendChat(int line,
                            String number,
                            String message)
Send a instant message. (SIP MESSAGE method after RFC 3428)

Parameters:
line - channel number
number - phone number or SIP username/extension number
message - text (chat body content)
Returns:
true on success, false on failure

API_SendChat

public boolean API_SendChat(String number,
                            String message)

API_SendChat

public boolean API_SendChat(int line,
                            String message)

API_SendChat

public boolean API_SendChat(String message)

API_SendSMS

public boolean API_SendSMS(int line,
                           String number,
                           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. The server is responsible to convert it to SMS.

Parameters:
line - channel number
number - target mobile phone number
message - text (SMS text)
msgid - optional id to be reported by the CHATREPORT (can be used the match the message)
Returns:
true on success, false on failure

API_SendSMS

public boolean API_SendSMS(int line,
                           String number,
                           String group,
                           String message,
                           int msgid)

API_SendSMS

public boolean API_SendSMS(int line,
                           String number,
                           String message)

API_SendSMS

public boolean API_SendSMS(String number,
                           String message)

API_SendChat

public boolean API_SendChat(int line,
                            String number,
                            String group,
                            String message,
                            int msgid)
Group messaging. (SIP MESSAGE method after RFC 3428)

Parameters:
line - channel number
number - phone number or SIP username/extension number
group - 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)
Returns:
true on success, false on failure

API_SendChat

public boolean API_SendChat(int line,
                            String number,
                            String group,
                            String message)

API_SendUSSD

public boolean API_SendUSSD(int line,
                            String method,
                            String ussd)
Send USSD message (After the IMS 3GPP TS 24.390 standard)

Parameters:
line - channel number
method - 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
Returns:
true if send initialized successfully or false on failure. Further feedback about the actual delivery can be obtained from the USSD notifications.

API_SendChatIsComposing

public boolean API_SendChatIsComposing(int line,
                                       String number)
Send IM typing notification.

Parameters:
line - channel number
number - phone number or SIP username/extension number
Returns:
true on success, false on failure

API_CheckVoicemail

public boolean API_CheckVoicemail(int line)
Will (re)subscribe for voicemail notifications. No need to call this function if the “voicemail” parameter is set to 2.

Parameters:
line - channel number. should be set to -1.
Returns:
true on success, false on failure

API_CheckVoicemail

public boolean API_CheckVoicemail()
Will (re)subscribe for voicemail notifications. No need to call this function if the “voicemail” parameter is set to 2.

Returns:
true on success, false on failure

API_Record

public boolean API_Record(int record)
Deprecated. 

Set voice recording.
You should not use this function. Use the VoiceRecord API instead.

Parameters:
record - 0=no,1=local,2=remote ftp,3=both
Returns:
true on success, false on failure

API_Chat

public boolean API_Chat(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).

Returns:
true on success, false on failure

API_VoiceRecord

public boolean API_VoiceRecord(int startstop,
                               int now,
                               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.

Parameters:
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” parameter
now - 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 immediately
filename - file name used for storing the recorded voice (if empty string, than will use a default file name)
Returns:
true on success, false on failure

API_VoiceRecord

public boolean API_VoiceRecord(int startstop,
                               int now,
                               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.

Parameters:
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” parameter
now - 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 immediately
filename - 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
Returns:
true on success, false on failure

API_VoiceRecord

public boolean API_VoiceRecord(int startstop,
                               int now)

API_VoiceRecord

public boolean API_VoiceRecord(int startstop)

API_VoiceRecord

public boolean API_VoiceRecord()

API_VoiceRecord

public boolean API_VoiceRecord(String filename)

API_AudioDevice

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

Returns:
true on success, false on failure

API_GetMAC

public String API_GetMAC()
Get the device MAC address if possible.
Some devices will forbid access to MAC address

Returns:
MAC address if successfully loaded

API_TestPrint

public void API_TestPrint()

API_TestEncoded

public String API_TestEncoded()

API_GetAudioDeviceList

public String API_GetAudioDeviceList(int dev)
Query the list of available audio devices.
Note: usually you don’t need to use this function. Just call the “API_AudioDevice” to let the users to change their audio settings.

Parameters:
dev - Set to 0 to list the recording device names or set to 1 for to get the playback or ringer devices.
Returns:
list of audio devices separated by CRLF.

API_SetAudioDevice

public boolean API_SetAudioDevice(int dev,
                                  String devicename)
Select an audio device.

Parameters:
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)
Returns:
true on success, false on failure

API_GetAudioDevice

public String API_GetAudioDevice(int dev)
Query the current audio device name.

Parameters:
dev - 0 for recording, 1 for playback, 2 for ringer
Returns:
the currently selected audio device for the dev line

API_SetAudioDevice

public boolean API_SetAudioDevice(int dev,
                                  String devicename,
                                  int immediate)
Select an audio device.

Parameters:
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
Returns:
true on success, false on failure

API_SetVolume

public boolean API_SetVolume(int dev,
                             int volume,
                             int line)
Set volume for the selected device.

Parameters:
dev - specify the device: 0 for the recording (microphone) audio device, 1 for the playback (speaker) audio device, 2 for the ringback (speaker) audio device
volume - volume level from 0 to 100 (percent value: 0-100%)
line - optional channel number
Returns:
true on success, false on failure

API_SetVolume

public boolean API_SetVolume(int dev,
                             int volume)

SetVolumeForEp

public boolean SetVolumeForEp(int dev,
                              float volume2,
                              int line)

API_GetVolume

public int API_GetVolume(int dev,
                         int line)
Get Volume level

Parameters:
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
Returns:
the volume (0-100%) for the selected device.

API_GetVolume

public int API_GetVolume(int dev)

API_SetVolumeIn

public boolean API_SetVolumeIn(int val)
Deprecated. 

Set volume in. Deprecated Use the SetVolume API instead

Parameters:
val - volume level 0-100%
Returns:
true on success, false on failure

API_SetVolumeOut

public boolean API_SetVolumeOut(int val)
Deprecated. 

Set volume out. Deprecated Use the SetVolume API instead

Parameters:
val - volume level 0-100%
Returns:
true on success, false on failure

API_HasCallInProgress

public boolean API_HasCallInProgress()
Query of there is any call in progress (including calls in ringing or connected state).

Returns:
true if there is call in progress, otherwise false.

API_HasCallInSpeaking

public boolean API_HasCallInSpeaking()
Query of there is any connected call.

Returns:
true if there is any connected call, otherwise false.

API_SetLogLevel

public boolean API_SetLogLevel(int level)
Set loglevel at runtime. You can also just pass the "loglevel" parameter

Parameters:
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)
Returns:
true on success, false on failure

API_ShowLog

public boolean API_ShowLog()
Show a new window with logs.

Returns:
true on success, false on fail

API_SetNotificationListener

public boolean API_SetNotificationListener(SIPNotificationListener listener)
Subscribe to notification events

Returns:
true on success or false on error (should never return false)

API_GetNotification

public SIPNotification API_GetNotification()
Return the next notification object. You should call this function from a separate thread.
Will return only when new notification(s) exists (Blocking read).

Returns:
accumulated events since the last function call (notifications separated by ",NEOL \r\n").

API_PollNotification

public SIPNotification API_PollNotification()
Return the next notification object if any. You should poll for the notifications periodically.
Will return immediatly (with null if no new notifications)

Returns:
notification object or null

API_GetNotificationStrings

public String API_GetNotificationStrings()
Return the notification strings. You should call this function from a separate thread.
Will return only when new notification(s) exists (Blocking read).

Returns:
accumulated events since the last function call (notifications separated by CRLF).

API_GetNotificationsSync

public String API_GetNotificationsSync()

API_PollNotificationStrings

public String API_PollNotificationStrings()
Return the notification strings. You should poll for the notifications periodically.
Will return immediatly (with empty string if no new notifications)

Returns:
accumulated notifications or empty string. It will return accumulated events since the last function call (notifications separated by ",NEOL \r\n").

API_GetNotifications

public String API_GetNotifications()

API_ParseNotification

public SIPNotification API_ParseNotification(String notificationstring)
Helper function to convert notification String to SIPNotification object

Returns:
the SIPNotification object

API_WaitForNotification

public SIPNotification API_WaitForNotification(int notification,
                                               int line,
                                               String filter,
                                               long timeout)
Helper function to wait for a notification

Parameters:
notificaton - the notification even constants (SIPNotification.NOTIFICATION_*)
line - filter for line (set to -9 if not needed)
filter - filter for string (if the notification string contains this filter)
timeout - max wait time
Returns:
the SIPNotification object or null on error or timeout

API_WaitForNotification

public SIPNotification API_WaitForNotification(int notification,
                                               long timeout)
Helper function to wait for a notification

Parameters:
notificaton - the notification even constants (SIPNotification.NOTIFICATION_*)
timeout - max wait time
Returns:
the SIPNotification object or null on error or timeout

API_WaitForNotification

public SIPNotification API_WaitForNotification(int notification)
Helper function to wait for a notification

Parameters:
notificaton - the notification even constants (SIPNotification.NOTIFICATION_*)
Returns:
the SIPNotification object or null on error or timeout

API_WaitForNotification

public SIPNotification API_WaitForNotification(int notification,
                                               String filter)
Helper function to wait for a notification

Parameters:
notificaton - the notification even constants (SIPNotification.NOTIFICATION_*)
filter - filter for string (if the notification string contains this filter)
Returns:
the SIPNotification object or null on error or timeout

API_WaitForNotification

public SIPNotification API_WaitForNotification(int notification,
                                               String filter,
                                               long timeout)
Helper function to wait for a notification

Parameters:
notificaton - the notification even constants (SIPNotification.NOTIFICATION_*)
filter - filter for string (if the notification string contains this filter)
timeout - max wait time
Returns:
the SIPNotification object or null on error or timeout

API_Poll

public String API_Poll()
Deprecated. 

Return the notification strings. Interal API.


API_Poll

public String API_Poll(boolean all)

API_PollSync

public String API_PollSync()

API_PollSync

public String API_PollSync(boolean all)

API_SetMediaListener

public boolean API_SetMediaListener(SIPMediaListener listener)
Subscribe to media packets

Returns:
true on success or false on error

API_GetMedia

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

API_GetMedia

public byte[] API_GetMedia()

API_GetMediaEnd

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)

Returns:
true on success

API_IsTerminated

public boolean API_IsTerminated()
Check if JVoIP is terminated

Returns:
true if JVoIP is terminating or terminated. return false if running

API_SetPushNotifications

public boolean API_SetPushNotifications(int pushnotifications,
                                        String clientid,
                                        String packagename,
                                        String gateway,
                                        int fromcode)
Call this function if you wish the SIP stack to manage push notifications, useful especially when used with the mizu server or MPUSH gateway.
Should be called after API_Start. Never before API_Start. It can be called also at runtime if needed.

Parameters:
pushnotifications - -1=auto guess, 0=disabled, 1=enabled auto, 2=enabled direct,3=enabled via gateway
clientid - token received from FCM
packagename - your app package name to be used for push notification. If empty then it will readed from your app context. If using mizu push gateway then leave it empty or set to "com.mizuvoip.mizudroid.app"
gateway - address of the gateway if you wish to use a gateway for push notifications
Returns:
true on success, false on failure

API_SetPushNotifications

public boolean API_SetPushNotifications(int pushnotifications,
                                        String clientid,
                                        String packagename,
                                        String gateway)

API_GetEndpointDetailsStr

public String API_GetEndpointDetailsStr()

API_GetEndpointDetailsStr

public String API_GetEndpointDetailsStr(int line)

API_GetEndpointDetails

public SIPNotification.Status API_GetEndpointDetails(int line)

GetLineDetails

public String GetLineDetails(int line)

API_GetLineDetails

public String API_GetLineDetails(int line)
Get details about a line. The line parameter can be -1 (will return the “best” line status).

Parameters:
line - channel number
Returns:
LINEDETAILS,line,state,callid,remoteusername,localusername,type,localaddress,serveraddress,mute,hold,remotefullname

API_GetPeer

public String API_GetPeer()
Query the peer username / Caller ID. This is usually the remote party name, phone number, username or extension

Returns:
the caller-id

API_GetCallerID

public String API_GetCallerID()

API_GetPeer

public String API_GetPeer(int line)
Query the peer username / Caller ID. This is usually the remote party name, phone number, username or extension

Parameters:
line - channel number
Returns:
the caller-id

API_GetCallerID

public String API_GetCallerID(int line)

API_GetPeerDisplayname

public String API_GetPeerDisplayname()
Query the peer displayname. This is usually the remote party name, phone number, username or extension

Returns:
the caller-id

API_GetPeerDisplayname

public String API_GetPeerDisplayname(int line)
Query the peer displayname. This is usually the remote party name, phone number, username or extension

Parameters:
line - channel number
Returns:
the caller-id

API_GetCallerID

public String API_GetCallerID(int line,
                                        int type)
Deprecated. 

Query the remote party name.

Parameters:
line - channel number
Returns:
the remote party name

API_HiddenLine

public int API_HiddenLine()
Query hiddel endpoint channel.
Hidden calls are usually the result of barge-in calls.

Returns:
hidden line number or 0/minus value if no hidden call is in progress.

API_GetLineStatus

public 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 Use the API_GetState function instead

Parameters:
line - channel number
Returns:
line state id

API_GetLineStatusText

public 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

Parameters:
line - channel number
Returns:
line state as text

API_GetStateStr

public String API_GetStateStr(int line)
Returns line state or global state if you pass -2 as line parameter

Parameters:
line - channel number
Returns:
The possible returned texts are the same like for notifications.

API_GetStatus

public String API_GetStatus(int line)

API_GetStateStr

public String API_GetStateStr(int line,
                                        int strict)
Returns line state or global state if you pass -2 as line parameter

Parameters:
line - channel number
strict - 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.
Returns:
The possible returned texts are the same like for notifications.

API_GetStatus

public String API_GetStatus(int line,
                                      int strict)

API_GetState

public int API_GetState(int line,
                        int strict)
Returns line state or global state if you pass -2 as line parameter

Parameters:
line - channel number
strict - 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.
Returns:
The possible returned texts are the same like for notifications.

API_GetState

public int API_GetState(int line)

API_GetStatusId

public int API_GetStatusId(int line)
Returns line state or global state id.
Should not be used (use the API_GetStatus instead)

Parameters:
line - channel number
Returns:
the state id

button2_actionPerformed

public void button2_actionPerformed(java.awt.event.ActionEvent e)

Hangup

public void Hangup(String reason)

API_SetSpeakerMode

public boolean API_SetSpeakerMode(boolean loud)
Set speaker mode,

Parameters:
loud - set to true if you wish to set to loudspeaker. otherwise false for normal earspeaker.

API_MightStop

public 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.


API_WaitFor

public boolean API_WaitFor()
Wait max 3 seconds for sipstack to finish after Stop
Should not be used.


API_WaitFor

public boolean API_WaitFor(int maxmsec)
Wait for sipstack to finish after Stop
Should not be used.


API_Stop

public void API_Stop()

API_CredentialsChanged

public boolean API_CredentialsChanged(String newserver,
                                      String newusername)
Deprecated. 

Notify the sipstack abut credentials change.


API_NoUnregister

public 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.


API_GetDeviceID

public String API_GetDeviceID()
Get device identifier unique per user

Returns:
unique device ID

API_GetUDeviceID

public String API_GetUDeviceID()
Get device identifier unique per device.

Returns:
unique device ID

API_Stop

public void API_Stop(boolean fast)
Will stop the SIP stack.


API_Stop

public void API_Stop(int fast)
Will stop the SIP stack.

Parameters:
fast - set to false if you can't wait a bit for graceful shutdown, or set to true for immediate shutdown.

API_Stop

public void API_Stop(int fast,
                     boolean fromdelayedthread)

SetModuleStatus

public void SetModuleStatus(int newstatus,
                            int fromcode)

DestroyCachedAudio

public void DestroyCachedAudio()

DoStop

public void DoStop(int fast)

Terminate

public void Terminate()

API_ConvertSampleRate

public int API_ConvertSampleRate(byte[] buffer_in,
                                 int offset_in,
                                 int length,
                                 byte[] buffer_out,
                                 int offset_out,
                                 int originalSampleRate,
                                 int targetSampleRate)

API_StopRing

public boolean API_StopRing(int line)
Will stop pending ring tone.
Rarely needed if any.

Parameters:
line - channel number
Returns:
true on success, false on failure

API_StartRing

public boolean API_StartRing(int line)
Will start local ringtone.
Rarely needed if any.

Parameters:
line - channel number
Returns:
true on success, false on failure

API_PlaySound

public boolean API_PlaySound(int line,
                             String file)
Play any sound file to peer.
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).

Parameters:
line - used with toremotepeer if there are multiple calls in progress to specify the call (usually set to -1 for the current call if any)
file - file path
Returns:
true on success, false on failure

API_PlaySound

public boolean API_PlaySound(String file)

API_PlaySound

public boolean API_PlaySound(int start,
                             String file,
                             int loop,
                             boolean async,
                             boolean localfile,
                             boolean toremotepeer,
                             int line,
                             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, it is recommended to force a narrowband codec if your file is narrowband or a wideband codec (speex, opus) if your file is wideband (16 kHz, 16 bit mono in little-endian).
The file must be found locally.

Parameters:
start - 1 for start or 0 to stop the playback, -1 to pre-cache
file - file name
loop - 1 to repeat, 0 to play once (only for local playback)
async - false if no, true if playback should be done in a separate thread (false can be used only for local playback, not for streaming)
localfile - 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 peer
line - used with toremotepeer if there are multiple calls in progress to specify the call (usually set to -1 for the current call if any)
Returns:
true on success, false on failure

API_PlayBuff

public boolean API_PlayBuff(byte[] buff,
                            int len,
                            int samplerate)
Play a PCM sound buffer locally (on the local audio player device) .

Parameters:
buff - PCM audio data (16 bit mono)
len - length of the data to be played from buff (usually buff.size())
Returns:
true on success, false on failure

API_PlayBuff

public boolean API_PlayBuff(byte[] buff,
                            int len)
Play a PCM sound buffer locally (on the local audio player device) .

Parameters:
buff - PCM audio data (16 bit mono. def: 8000Hz)
len - length of the data to be played from buff (usually buff.size())
Returns:
true on success, false on failure

API_PlayBuff

public boolean API_PlayBuff(byte[] buff)
Play a PCM sound buffer locally (on the local audio player device) .

Parameters:
buff - PCM audio data (16 bit mono. def: 8000Hz)
Returns:
true on success, false on failure

API_PlayBuff

public boolean API_PlayBuff()
Stop local audio playback

Returns:
true on success, false on failure

API_PlayBuff

public boolean API_PlayBuff(boolean start,
                            byte[] buff,
                            int len,
                            boolean isring,
                            String audiodevice,
                            int samplerate,
                            int reset)
Play a PCM sound buffer locally (on the local audio player device) .

Parameters:
start - true to start or false to stop the playback
buff - PCM audio data (16 bit mono)
len - length of the data to be played from buff (usually buff.size())
isring - set to true if this is a ring tone
audiodevice - output audio device. empty means default
reset - -1: auto (1 if small, 0 if big and no otherr changes), 0: no (append), 1: reset, but skip if we already have a non-reset (for tones), 2: yes, reset, 3: reset and new player. (Note: it might not flush the internal audio buffer if any)
Returns:
true on success, false on failure

API_PlayBuffOld

public boolean API_PlayBuffOld(boolean start,
                               byte[] buff,
                               int len,
                               boolean isring,
                               String audiodevice)

API_PlayTone

public boolean API_PlayTone(int tone)

TerminateAllAudioPlayers

public void TerminateAllAudioPlayers()

TerminateAllAudioPlayers

public void TerminateAllAudioPlayers(boolean onlyifring)

TerminateAllAudioPlayers

public void TerminateAllAudioPlayers(boolean onlyifring,
                                     AudioPlayer except)

API_PlaySound

public boolean API_PlaySound(int start,
                             String file,
                             int loop,
                             boolean async)

API_PlaySound

public boolean API_PlaySound(int start,
                             String file,
                             int loop,
                             boolean async,
                             boolean localfile)

API_PlaySound

public boolean API_PlaySound(int start,
                             String file,
                             int loop,
                             boolean async,
                             boolean localfile,
                             boolean toremotepeer,
                             int line)

PlayRingTone

public void PlayRingTone(int play,
                         int calledfrom)

PlayRingTone

public void PlayRingTone(int play)

PlayRingTone

public void PlayRingTone(boolean play,
                         int calledfrom)

PlayRingTone

public void PlayRingTone(boolean play,
                         int calledfrom,
                         boolean outgoingcall)

PlayRingToneInner

public void PlayRingToneInner(boolean play,
                              int calledfrom,
                              boolean outgoingcall)

PlayRingToneInner2

public boolean PlayRingToneInner2(boolean play,
                                  int calledfrom,
                                  boolean outgoingcall,
                                  String ringwav,
                                  String ringtonefile)

API_StreamSoundStream

public boolean API_StreamSoundStream(int start,
                                     int line,
                                     java.io.InputStream inputstream)
Audio streaming from InputStream.

Parameters:
start - 1 for start or 0 to stop the playback, -1 to pre-cache
line - channel number
inputstream - audio data stream
Returns:
true on success, false on failure

SaveDebugStream

public void SaveDebugStream()

API_StreamSoundBuff

public boolean API_StreamSoundBuff(int start,
                                   int line,
                                   byte[] buff,
                                   int len)
Audio streaming from buffer.

Parameters:
start - 1 for start or continue the playback, 0 to stop the playback
line - channel number
buff - audio data buffer
len - audio data size in bytes
Returns:
true on success, false on failure

API_StreamSoundBuff

public boolean API_StreamSoundBuff(int line,
                                   byte[] buff,
                                   int len)

API_StreamSoundBuff

public boolean API_StreamSoundBuff(byte[] buff,
                                   int len)

API_StreamSoundBuff

public boolean API_StreamSoundBuff(byte[] buff)

API_StreamSoundBuff

public boolean API_StreamSoundBuff(int start,
                                   int line,
                                   byte[] buff,
                                   int len,
                                   int samplerate)

API_StreamSoundBuff

public boolean API_StreamSoundBuff(int start,
                                   int line,
                                   byte[] buff,
                                   int len,
                                   int samplerate,
                                   boolean from_ai)

API_PlaySoundInternal

public boolean API_PlaySoundInternal(int start,
                                     String file,
                                     int loop,
                                     boolean async,
                                     boolean localfile,
                                     boolean toremotepeer,
                                     int line,
                                     String audiodevice,
                                     boolean isring)