public class SipStack
extends java.lang.Object
AJVoIP SIP Stack public interface. This SipStack class contains all the available API functions.
Home page: https://www.mizu-voip.com/Software/SIPSDK/AndroidSIPSDK.aspx
Documentation:
https://www.mizu-voip.com/Portals/0/Files/AndroidSIPSDK.pdf
Example usage:
https://www.mizu-voip.com/Portals/0/Files/AJVoIPTest.zip
We recommend to use the documentation as a reference as it is much better structured and more up to date.
The AJVoIP parameters are not listed here. See the documentation for the complete list of available settings ("Parameters" chapter).
Modifier and Type | Field and Description |
---|---|
Common |
common
Internal common object instance.
|
webphone |
phone
Internal phone object instance.
|
Constructor and Description |
---|
SipStack()
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 doesn't do much things. |
Modifier and Type | Method and Description |
---|---|
boolean |
Accept(int line)
Connect incoming call.
|
boolean |
AcceptStrict(int line)
Connect incoming call.
Will accept the call only if the line strictly match an incoming channel number. |
boolean |
AcceptVideo(int fragmentResId,
FragmentActivity fragmentinstance)
Connect incoming video call.
If video interface is not loaded yet, then will initiate it now and call back. If incoming call is not with video, then it might result in simple audio call. |
boolean |
AddContact(java.lang.String params)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean |
AddLog(int level,
java.lang.String text)
Add to sip stack log.
|
boolean |
AddLog(java.lang.String text)
Add to sip stack log.
|
boolean |
AddToBlacklist(java.lang.String str)
Add user to blacklist
Block incoming communication from these users (users/numbers/IP addresses separated by comma |
boolean |
AddToWhitelist(java.lang.String str)
Add user to whitelist
|
boolean |
AddVideo(int line,
int type,
int direction)
Deprecated.
|
boolean |
Call(int line,
java.lang.String number)
Initiate call to a number or sip username.
If the number parameter is empty, then will redial the last number. Note: you should pass only the peer number, extension or username to this function and not the full SIP URI (the SIP stack will construct the full SIP URI with the serveraddress already set) |
boolean |
Call(int line,
java.lang.String number,
boolean async)
Initiate call to a number or sip username.
If the number parameter is empty, then will redial the last number. Note: you should pass only the peer number, extension or username to this function and not the full SIP URI (the SIP stack will construct the full SIP URI with the serveraddress already set) |
boolean |
Call(int line,
java.lang.String number,
int type)
Initiate call to a number or sip username.
If the number parameter is empty, then will redial the last number. Note: you should pass only the peer number, extension or username to this function and not the full SIP URI (the SIP stack will construct the full SIP URI with the serveraddress already set) |
boolean |
CallEx(int line,
java.lang.String number,
int type)
Deprecated.
|
int |
CallIDToLine(java.lang.String callid)
Get the line number for a SIP Call-ID.
|
boolean |
CanBluetooth()
Query bluetooth setting.
|
boolean |
CapabilityRequest() |
boolean |
CapabilityRequest(java.lang.String server,
java.lang.String username)
Request server or server capabilities with SIP OPTIONS.
Rarely needed if any. |
boolean |
CheckBLF(java.lang.String userlist)
To subscribe to other extensions call state, you can set the blfuserlist parameter or use the API_CheckBLF(userlist) to subscribe to other extension(s) state changes (users separated by comma).
User(s) passed by the userlist parameters will be added to the existing blfuserlist. |
void |
CheckConnection()
Verify connection state and reregister if required.
Should be called from app activated and screen turned on events for the quickest possible reregistration if previous registration failed (for example due to dosing or OS paused) |
boolean |
CheckPresence(java.lang.String userlist)
Call this function to save softswitch resources, you should carefully select the contacts.
(Send only the contacts which are actually used and called numbers. |
boolean |
CheckVoicemail() |
boolean |
CheckVoicemail(int line)
Will (re)subscribe for voicemail notifications.
|
boolean |
ClearCredentials()
Clear existing user account details.
|
void |
ClearSettings()
Clear all settings (including stored settings)
|
boolean |
Conf(int line)
Add line to conference
|
boolean |
Conf(int line,
java.lang.String number)
Add people to conference or initiate conference call.
If peer is empty than will mix the currently running calls (if there is more than one call) Otherwise it will call the new peer (usually a phone number or a SIP user name) and once connected will join with the current session. |
boolean |
Conf(java.lang.String number)
Create conference call by adding number to the current call.
If peer is empty than will mix the currently running calls (if there is more than one call) Otherwise it will call the new peer (usually a phone number or a SIP user name) and once connected will join with the current session. |
boolean |
ConfEx(int line,
java.lang.String number,
boolean add)
Add/remove people to/from conference.
|
boolean |
ConfEx(int line,
java.lang.String number,
boolean add,
int confline)
Add/remove people to/from conference.
|
boolean |
CredentialsChanged(java.lang.String newserver,
java.lang.String newusername)
Deprecated.
|
boolean |
DelContact(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean |
DelSettings(int level)
Delete settings and data.
|
boolean |
DisableBLF(java.lang.String userlist)
Remove extension(s) from BLF watch list (blfuserlist).
Note: existing BLF subscriptions might not be affected until next session. |
boolean |
Dtmf(int line,
java.lang.String dtmf)
Send DTMF message by In-Band,SIP INFO or RFC2833 method (depending on the “dtmfmode” parameter).
|
boolean |
ED137PTT(int line,
int ptt) |
boolean |
ED137PTT(int line,
int ptt,
int pttid)
ED-137 Push to talk
|
void |
Exit()
Will destroy the SIP stack.
Should not be used. |
void |
ExitEx()
Will destroy the SIP stack and also will exit the Java Virtial Machine.
Should not be used. |
boolean |
Forward(int line,
java.lang.String peer)
Forward incoming call to peer (with 302 Moved Temporarily disconnect code)
|
void |
FullStop()
Will stop the SIP stack and all services (push notifications or jobs/alarms that might have started to keep your app running as background service)
|
int |
GetAccountRegState(java.lang.String domain,
java.lang.String proxy,
java.lang.String username,
java.lang.String sipusername,
boolean pushnotify,
boolean strict)
Query account register state.
|
java.lang.String |
GetAccountRegStateString(java.lang.String domain,
java.lang.String proxy,
java.lang.String username,
java.lang.String sipusername,
boolean pushnotify,
boolean strict)
Query account register state.
|
java.lang.String |
GetAddress()
Query local address.
|
java.lang.String |
GetAltWorkdir()
Query the application alternative working directory (such as folder on external SD card).
|
java.lang.String |
GetAudioDevice(int dev)
Query the current audio device name.
|
java.lang.String |
GetAudioDeviceList(int dev)
Query the list of available audio devices.
Not supported by Android. Note: usually you don’t need to use this function. |
java.lang.String |
GetBindir()
Query the application path (folder with the app binaries or app home folder)
|
java.lang.String |
GetBlacklist()
Query the current blacklist
|
java.lang.String |
GetCallerID()
Query the peer Caller ID.
This is usually the remote party name, phone number, username or extension |
java.lang.String |
GetCallerID(int line)
Query the peer Caller ID.
This is usually the remote party name, phone number, username or extension |
java.lang.String |
GetCallerID(int line,
int type)
Deprecated.
|
Common |
GetCommonObj()
Provides access to the internal Common object instance.
Usually you don't need this kind of access. |
java.lang.String |
GetConfigHash()
Get a has value of the configuration.
Should not be used. |
java.lang.String |
GetContact(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String |
GetContactName(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String |
GetContactPhone(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String |
GetContactPresence(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String |
GetContactPresenceStr(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String |
GetContacts()
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String |
GetContactSIP(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
java.lang.String |
GetContactSpeedDial(java.lang.String name)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
int |
GetCurrentConnectedCallCount()
Query the number of simultaneous calls currently in progress.
|
java.lang.String |
GetDeviceID()
Get device identifier.
|
java.lang.String |
GetDiscReasonText(java.lang.String line)
Query the disconnect reason of the last disconnected call.
|
java.lang.String |
GetGlobalStatus()
Helper function to ask for the SIP stack state/details.
|
GUtility |
GetGUtilityObj() |
java.lang.String |
GetIncomingDisplay(int line)
Get incoming caller id (might return two lines: caller id \n caller name)
|
java.lang.String |
GetLastCallDetails()
Get details about the last finished call.
|
java.lang.String |
GetLastRecFileName()
Query recently recorded file.
|
java.lang.String |
GetLastRecInvite()
Get last received INVITE message.
|
java.lang.String |
GetLastRecSIPMessage(java.lang.String line)
Get last received SIP message.
|
java.lang.String |
GetLastSentInvite()
Get last sent INVITE message.
|
int |
GetLine()
Get the currently active line.
This should be the line which you have set previously except after incoming and outgoing calls (the SIP client will automatically switch the active line to a new free line for these if the current active line is already occupied by a call). |
java.lang.String |
GetLineDetails(int line)
Get details about a line.
|
java.lang.String |
GetLineParameter(int line,
java.lang.String param)
Get line specific parameter for a specific current/next/all line.
|
int |
GetLineStatus(int line)
Query the state of a line.
Note: this is rarely needed since you receive the status also by event notifications |
java.lang.String |
GetLineStatusText(int line)
Query the state of a line.
Note: this is rarely needed since you receive the status also by event notifications |
java.lang.String |
GetLogPath()
Query the application log file path.
|
java.lang.String |
GetLogs()
Can be used to get the logs (which are otherwise written also to standard output and to Logcat).
|
java.lang.String |
GetMAC()
Get the device MAC address if possible.
Most devices will forbid access to MAC address |
byte[] |
GetMedia() |
byte[] |
GetMedia(int timeout)
Get RTP stream.
Will return the next media (audio or video) packet as a byte buffer from the JVoIP internal queue. |
java.lang.String |
GetMySIPURI(boolean all)
Get the SIP URI on which the current endpoint can be reached such as username@server.com or username@localip:port.
|
int |
GetNetworkSpeed()
Get network connection speed.
|
SIPNotification |
GetNotification()
Return the next notification object.
|
java.lang.String |
GetNotifications() |
java.lang.String |
GetNotificationsSync() |
java.lang.String |
GetNotificationStrings()
Return the notifications as strings.
|
static SipStack |
GetObj()
Access the sipstack instance from static code.
This is safe to use only if you have one single instance. |
java.lang.String |
GetParameter(java.lang.String param)
Query parameter.
Note: some basic parameters should be set before the Start function have been called (such as “register”), however most parameters can be also changed at run-time. |
java.lang.String |
GetPresenceStatus()
Query local presence state.
|
java.lang.String |
GetProfileStatusText(java.lang.String username)
Get the profile status text for this user.
|
int |
GetPushNotifications()
Simplified query for push notification state if push was initited befere with the SetPushNotifications API.
|
int |
GetPushNotificationsEx(boolean thissessiononly)
Query the push notification state if push was initited befere with the SetPushNotifications API.
|
java.lang.String |
GetRegFailReason(boolean extended)
Query the reason of the last failed registration.
|
java.lang.String |
GetSDPField(int line,
java.lang.String field)
Return a SDP value received by JVoIP.
|
java.lang.String |
GetSIPHeader(int line,
java.lang.String hdr)
Return a sip header value received by JVoIP.
|
java.lang.String |
GetSIPMessage(int line,
int dir,
int type)
Return the last received or sent SIP signaling message as raw text.
|
java.lang.String |
GetStatus(int line)
Returns line state or global state if you pass -2 as line parameter
|
java.lang.String |
GetStatus(int line,
int strict)
Returns line state or global state if you pass -2 as line parameter
|
int |
GetStatusId(int line)
Returns line state or global state id.
Should not be used (use the API_GetStatus instead) |
java.lang.String |
GetVersion()
Get the SIP stack version number.
|
int |
GetVolume(int dev)
Get Volume level
|
int |
GetVolume(int dev,
int line)
Get Volume level by line
|
static webphone |
GetWebPhoneObj()
Provides access to the internal phone object instance.
Usually you don't need this kind of access. |
static webphone |
GetWebPhoneObj(Context contextin)
Provides access to the internal phone object instance.
Usually you don't need this kind of access. |
java.lang.String |
GetWhitelist()
Query the current whitelist
|
java.lang.String |
GetWorkdir()
Query the application working directory (data folder) Based on appcontext.getFilesDir().getPath() and Environment.getDataDirectory().getPath();
|
boolean |
Hangup()
Disconnect call.
|
boolean |
Hangup(int line)
Disconnect current call(s).
|
boolean |
Hangup(int line,
java.lang.String reason)
Disconnect current call(s).
|
boolean |
HasCallInProgress()
Query of there is any call in progress (including calls in ringing or connected state).
|
boolean |
HasCallInSpeaking()
Query of there is any connected call.
|
int |
HiddenLine()
Query hiddel endpoint channel.
Hidden calls are usually the result of barge-in calls. |
boolean |
Hold(int line,
boolean hold)
Hold current call.
|
boolean |
HoldChange(int line)
Togle hold state of the call.
|
java.lang.String |
HTTPGet(java.lang.String uri)
Send a HTTP GET request.
|
boolean |
HTTPKeepAlive()
Deprecated.
|
boolean |
HTTPPost(java.lang.String uri,
java.lang.String data)
Send a HTTP POST request.
|
java.lang.String |
HTTPReq(java.lang.String uri,
java.lang.String data)
Send a HTTP POST or GET request.
|
boolean |
HTTPReqAsync(java.lang.String uri,
java.lang.String data)
Send a HTTP POST or GET request.
|
boolean |
Ignore(int line)
Ignore incoming call.
|
boolean |
Info(int line,
java.lang.String msg)
Send custom INFO message (for DTMF use the API_Dtmf function instead).
|
boolean |
Init(Context context_in)
Initialize the SIP stack.
|
boolean |
IsBluetooth()
Check if call on bluetooth.
|
int |
IsEncrypted()
Check if the connection is encrypted.
|
boolean |
IsIdle()
Query idle state
|
int |
IsInCall()
Query of there is any call in progress.
|
boolean |
IsIncomingVideo()
Check if current incoming call is video call.
|
boolean |
IsLoudspeaker()
Query if using loudspeaker
|
int |
IsMuted(int line)
Return if the selected line is muted or not.
|
int |
IsOnHold(int line)
Query if the selected line is on hold or not
|
boolean |
IsOnline()
Query online state.
This is not the same with the register state (It can return true even if not registered) |
boolean |
IsRegistered()
Get the registered state.
|
int |
IsRegisteredEx()
Get the extended registered state.
|
boolean |
IsSpeaking()
Query of there is any connected call.
|
boolean |
IsTerminated()
Check if AJVoIP is terminated
|
java.lang.String |
LineToCallID(int line)
Get the SIP Call-ID for a line number.
Note: will return the current default line if the line number is 0 or negative. |
java.lang.String |
LoadFile(java.lang.String filename)
Load file content from local disk.
|
boolean |
LoadFileRemote(java.lang.String filename)
Load file from remote storage.
The download process is performed asynchronously. You need to call this function only once and then a few seconds later call the API_LoadFile function with the same file name. It will contain “ERROR: reason” text if the download failed. |
java.lang.String |
LoadFileRemoteSync(java.lang.String filename)
Will download the specified file from remote storage synchronously (will block until done or fails).
|
void |
MightStop()
You might call this functions if your app might terminate soon.
For example your activity is pausing/closing and from there the OS might kill your process. This will just make sure that the internal SIP stack settings are properly saved and the sipstack is prepared for an unexpected termination. Note: this function will NOT unregister or stop the SIP stack, because in some circumstances it might be better to let the app running in the background until possible to still listen for incoming calls. |
boolean |
Mute(int line,
boolean mute)
Mute current call.
|
boolean |
Mute(int line,
boolean mute,
int what)
Mute current call.
|
boolean |
MuteEx(int line,
boolean mute,
int what)
Mute current call.
Same as the Mute API. |
boolean |
MuteVideo(int state,
int direction,
int height)
Disable/enable video(stream) during a video call.
|
boolean |
NATKeepAlive(java.lang.String server)
Rarely needed if any, because the siptack will do it automatically.
|
boolean |
NeedRatingRequest()
Some servers might report call rating automatically in signaling.
|
boolean |
NewUser(java.lang.String user)
On newuser, you should ask the user if wish to accept it.
|
void |
NoUnregister()
Signal that no unregistration is needed.
For example you might call this before to stop the SIP stack if you don't wish that the server to be notified. |
boolean |
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. |
void |
OnVideoRemoved(GVideo instance)
This function should not be used.
|
SIPNotification |
ParseNotification(java.lang.String notificationstring)
Helper function to convert notification String to SIPNotification object
|
boolean |
PeerIsMizu(int line)
Check if peer is Mizutech software.
|
boolean |
PlayFile(java.lang.String filename)
Play any sound file locally.
|
boolean |
PlayFile(java.lang.String filename,
boolean start)
Play any sound file locally.
|
boolean |
PlaySound(int start,
int resourceid,
int loop)
Play any sound from resource file.
|
boolean |
PlaySound(int start,
java.lang.String file,
boolean localfile,
boolean toremotepeer,
int line)
Play any sound file.
At least wave files are supported in the following format: PCM SIGNED 8000.0 Hz (8 kHz) 16 bit mono (2 bytes/frame) in little-endian (128 kbits). This function can be used to play audio locally, but also for remote streaming. For remote playback, make sure to force a narrowband codec if your file is narrowband and wideband codec (speex, opus) if your file is wideband (16 kHz, 16 bit mono in little-endian). The file must be found locally. |
java.lang.String |
Poll()
Deprecated.
|
java.lang.String |
PollNotificationStrings()
Return the notifications as strings.
|
boolean |
PushContactlist(java.lang.String userlist)
User for presence.
Call this to pass all the usernames and phonenumbers from your external contact list if any. This is necessary, because for existing contacts JVoIP can accept the requests automatically, while for other it might ask for user permission |
boolean |
RecFiles_Clear()
Delete old recorded files.
|
boolean |
RecFiles_Del()
Delete local recorded files.
|
boolean |
RecFiles_Upload()
Upload pending recorded files (if ftp/http URI was set)
|
boolean |
Record(int record)
Deprecated.
|
boolean |
Register()
Set parameters for authentication and register to the SIP server.
Will connect to the SIP server. |
boolean |
Register(java.lang.String server,
java.lang.String username,
java.lang.String password,
boolean async)
Set parameters for authentication and register to the SIP server.
Will connect to the SIP server. |
boolean |
Register(java.lang.String server,
java.lang.String username,
java.lang.String password,
java.lang.String authusername,
java.lang.String displayname,
boolean async)
Set parameters for authentication and register to the SIP server.
Will connect to the SIP server. |
boolean |
Registered()
Get the registered state.
|
boolean |
RegisterEx(java.lang.String accounts)
You can use this function for multiple secondary accounts (up to 99) on the same or other servers.
Instead of this function you can just set the “extraregisteraccounts” parameter to the same value. |
boolean |
Reject(int line)
Reject incoming call.
You could also use the Hangup API function for this. |
boolean |
RejectEx(int line,
java.lang.String reasontext)
Reject incoming call.
You could also use the Hangup API function for this. Will reject the call only if the line strictly match an incoming channel number. |
boolean |
RemoveVideo()
Will remove the video fragment (will also disconnect video call if any).
Instead of this function, you should just hide/destroy your video container element from the user interface. |
boolean |
ReStart()
Will restart the SIP stack.
Instead of using this API, you should instead create a new instance (stop the old one, create a new instance, set parameters and start) |
boolean |
RTPHeaderExtension(int line,
int profile,
int extension)
Set RTP header extension as described at Section 5.3.1 of RFC3550.
To clear it, set the profile and the extension to 0. You can also set this with parameter (rtpextraheader, rtpextraheader_profile). |
boolean |
RTPHeaderExtension(int line,
int profile,
java.lang.String extension)
Set RTP header extension as described at Section 5.3.1 of RFC3550.
To clear it, set the profile to 0 and the extension to an empty string. You can also set this with parameter (rtpextraheader, rtpextraheader_profile). |
java.lang.String |
RTPStat(int line)
Query for media quality reports.
|
boolean |
SaveFile(java.lang.String filename,
java.lang.String content)
Will save the text file to local disk in the working directory in encrypted format (use API_SaveFileRaw to save as-is)
|
boolean |
SaveFileRaw(java.lang.String filename,
java.lang.String content)
Will save the text file to local disk in the working directory as is.
|
boolean |
SaveFileRemote(java.lang.String filename,
java.lang.String content)
Save file to remote storage (preconfigured ftp or http server )
|
void |
SaveSettings()
Might be called before quit to make sure that the settings are saved properly (but before stop we recommend to use call the API_MightStop API instead).
Should not be used. |
boolean |
SendChat(int line,
java.lang.String number,
java.lang.String message)
Send a instant message (simplified version)
|
boolean |
SendChat(int line,
java.lang.String number,
java.lang.String group,
java.lang.String message)
Group messaging.
|
boolean |
SendChat(int line,
java.lang.String number,
java.lang.String group,
java.lang.String message,
int msgid)
Send a instant message.
|
boolean |
SendChat(java.lang.String number,
java.lang.String message)
Send a instant message (simplified version)
|
boolean |
SendChatIsComposing(int line,
java.lang.String number)
Send IM typing notification.
|
boolean |
SendSIP(java.lang.String msg)
Deprecated.
|
boolean |
SendSIPMessage(int line,
java.lang.String msg) |
boolean |
SendSIPMessage(int line,
java.lang.String msg,
java.lang.String body) |
boolean |
SendSIPMessage(int line,
java.lang.String msg,
java.lang.String body,
java.lang.String account) |
boolean |
SendSIPMessage(int line,
java.lang.String msg,
java.lang.String body,
java.lang.String account,
java.lang.String target)
Send custom SIP signaling message.
|
boolean |
SendSMS(int line,
java.lang.String number,
java.lang.String message)
Send a SMS message if softswitch has SMS delivery capabilities (Otherwise might try to deliver as IM).
The message is delivered as a standard SIP MESSAGE with X-Sms: Yes header. |
boolean |
SendSMS(int line,
java.lang.String number,
java.lang.String group,
java.lang.String message,
int msgid)
Send a SMS message if softswitch has SMS delivery capabilities (Otherwise might try to deliver as IM).
The message is delivered as a standard SIP MESSAGE with X-Sms: Yes header. |
boolean |
SendUSSD(int line,
java.lang.String method,
java.lang.String ussd)
Send USSD message (After the IMS 3GPP TS 24.390 standard)
|
boolean |
ServerIsMizu()
Check if SIP server is Mizutech softswitch.
|
boolean |
SetAudioDevice(int dev,
java.lang.String devicename)
Select an audio device.
Not supported by Android. |
boolean |
SetAudioDevice(int dev,
java.lang.String devicename,
int immediate)
Select an audio device.
|
boolean |
SetBlacklist(java.lang.String str)
Set whole blacklist.
|
void |
SetBluetooth(boolean on)
Set audio via Bluetooth.
|
boolean |
SetContact(java.lang.String name,
java.lang.String params)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean |
SetContactName(java.lang.String name,
java.lang.String param)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean |
SetContactPhone(java.lang.String name,
java.lang.String param)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean |
SetContacts(java.lang.String contacts)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean |
SetContactSIP(java.lang.String name,
java.lang.String param)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean |
SetContactSpeedDial(java.lang.String name,
java.lang.String param)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean |
SetContactStatus(java.lang.String name,
java.lang.String param)
Helper function for contact manipulation in case if you wish contact management to be handled by the SIP stack.
If necessary then you might manage the contacts by implementing your own contacts module after your needs instead of using this contact management API. |
boolean |
SetCredentials()
Deprecated.
|
boolean |
SetCredentials(java.lang.String server,
java.lang.String username,
java.lang.String password)
Set parameters for authentication.
|
boolean |
SetCredentials(java.lang.String server,
java.lang.String username,
java.lang.String password,
java.lang.String authusername,
java.lang.String displayname)
Set parameters for authentication.
|
boolean |
SetCredentialsMD5(java.lang.String server,
java.lang.String username,
java.lang.String md5,
java.lang.String realm)
Set parameters for authentication.
|
boolean |
SetIdle(boolean idle)
You might use this API to further extend the battery life (above the usual phone power state changes).
The sipstack internally has an idle state which can be useful to decrease CPU and RAM usage by using less resources, slowing down all operations, running threads in low priority and increases internal timer intervals. |
boolean |
SetLine(int line)
Will set the current channel.
Use only if you present line selection for the users. |
boolean |
SetLineEx(java.lang.String line)
Will set the current channel.
Use only if you present line selection for the users. |
boolean |
SetLineParameter(int line,
java.lang.String param,
java.lang.String value,
int permanent)
Set parameter for a specific current/next/all line.
|
boolean |
SetLogLevel(int level)
Set loglevel at runtime.
|
boolean |
SetNotificationListener(SIPNotificationListener listener)
Subscribe to notification events
|
boolean |
SetParameter(java.lang.String param,
boolean value)
Configure the SIP stack by passing any parameter.
|
boolean |
SetParameter(java.lang.String param,
int value)
Configure the SIP stack by passing any parameter.
|
boolean |
SetParameter(java.lang.String param,
long value)
Configure the SIP stack by passing any parameter.
|
boolean |
SetParameter(java.lang.String param,
java.lang.String value)
Configure the SIP stack by passing any parameter.
|
boolean |
SetParameters(java.lang.String parameters)
Configure the SIP stack with a list of parameters.
|
boolean |
SetPresenceStatus(java.lang.String status)
Use the API_SetPresenceStatus(statustring) function call to change the user online status.
This function will start to send NOTIFY requests to subscribed parties. |
boolean |
SetPushNotifications(int pushnotifications,
java.lang.String clientid,
java.lang.String packagename,
java.lang.String gateway)
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. |
boolean |
SetSDPField(int line,
java.lang.String field,
int type)
Set a custom SDP field (a line in the SDP body) that will be sent with all messages.
Can be used if you have some special requirement regarding the SDP. Multiple fields can be separated by CRLF (\r\n). You can also set this with parameter (customsdpfield, customsdpmediafield). |
boolean |
SetSIPHeader(int line,
java.lang.String hdr)
Set a custom sip header (a line in the SIP signaling) that will be sent with all messages.
Can be used for various integration purposes (for example for sending the http session id). Multiple headers can be separated by CRLF (\r\n). You can also set this with parameter (customsipheader). |
boolean |
SetSpeakerMode(boolean loud)
Set speaker mode
|
boolean |
SetSSID(java.lang.String ssidval)
Should not be used.
|
boolean |
SetSSLContext(javax.net.ssl.SSLContext sc)
Set custom SSLContext for new TLS connections.
|
boolean |
SetUUI(int line,
java.lang.String value,
int fortarget)
Set a custom UUI (User-to-User Call Control Information as described in RFC 7433).
|
boolean |
SetVideoDevice(java.lang.String devicename)
Select video device.
|
boolean |
SetVideoDisplaySize(int type,
int width,
int height)
Use this function to control the video display size (both for remote and local video).
|
boolean |
SetVolume(int dev,
int volume)
Set volume for the selected device.
|
boolean |
SetVolume(int dev,
int volume,
int line)
Set volume for the selected device om the specified line.
|
boolean |
SetVolumeIn(int val)
Deprecated.
|
boolean |
SetVolumeOut(int val)
Deprecated.
|
boolean |
SetWhitelist(java.lang.String str)
Set whole whitelist
Allow incoming SIP requests only from these users (users/numbers separated by comma). |
int |
ShouldReset()
Check if the sipstack should be restarted.
|
boolean |
ShouldResetBeforeCall()
This function might be called before calls and you should quickly restart the sipstack if returns true (the continue to make the call).
|
boolean |
Start()
Will start the SIP engine (starting the internal main thread).
|
boolean |
StartRing(int line)
Will start local ringtone.
Rarely needed if any. |
boolean |
StartStack()
Deprecated.
|
void |
Stop()
Will stop the SIP stack.
|
void |
Stop(boolean fast)
Will stop the SIP stack.
|
boolean |
StopRing(int line)
Will stop pending ring tone.
Rarely needed if any. |
boolean |
StreamSoundBuff(int start,
int line,
byte[] buff,
int len)
Audio streaming from buffer.
|
boolean |
StreamSoundStream(int start,
int line,
java.io.InputStream inputstream)
Audio streaming from InputStream.
|
boolean |
Test()
Test API availability.
|
java.lang.String |
TestEcho(java.lang.String echo)
Test API availability.
|
boolean |
Transfer(int line,
java.lang.String number)
Transfer current call to peer which is usually a phone number or a SIP username.
|
boolean |
Unregister()
Will stop all endpoints (hangup current calls if any and unregister)
|
boolean |
Unregister(int waitfor)
Will stop all endpoints (hangup current calls if any and unregister)
|
boolean |
Unsubscribe()
You might use the API_UnSubscribe() API to unsubscribe all endpoints (this includes presence, voicemail and BLF subscribes).
|
java.lang.String |
VAD()
Query for global voice activity statistics.
|
java.lang.String |
VAD(int line)
Query line for received voice activity statistics.
|
boolean |
VideoCall(java.lang.String destination,
int fragmentResId,
FragmentActivity fragmentinstance) |
boolean |
VoiceRecord() |
boolean |
VoiceRecord(int startstop) |
boolean |
VoiceRecord(int startstop,
int now) |
boolean |
VoiceRecord(int startstop,
int now,
java.lang.String filename)
Will start/stop a voice recording session
This function should be used only if you would like to control the recording duration. If all conversations have to be recorded, then just set the “voicerecording” parameter after your needs. |
boolean |
VoiceRecord(int startstop,
int now,
java.lang.String filename,
int line)
Will start/stop a voice recording session.
Same as the API_VoiceRecord above but with an extra line parameter which you can use to record call only for a specific line. This function should be used only if you would like to control the recording duration. If all conversations have to be recorded, then just set the “voicerecording” parameter after your needs. |
boolean |
VoiceRecord(java.lang.String filename) |
boolean |
WaitFor()
Wait for sipstack to finish after Stop
Should not be used. |
boolean |
WaitFor(int maxmsec)
Wait for sipstack to finish after Stop
Should not be used. |
public webphone phone
public Common common
public SipStack()
public boolean Init(Context context_in)
context_in:
- your application or activity Contextpublic boolean Start()
@Deprecated public boolean StartStack()
public Common GetCommonObj()
public static SipStack GetObj()
public static webphone GetWebPhoneObj()
public static webphone GetWebPhoneObj(Context contextin)
contextin
- your app/activity Contextpublic boolean ReStart()
public void FullStop()
public void Stop()
public void Stop(boolean fast)
fast
- set to false if you can't wait a bit for graceful shutdown, or set to true for immediate shutdown.public void Exit()
public void ExitEx()
public boolean WaitFor()
public boolean WaitFor(int maxmsec)
public void MightStop()
public void SaveSettings()
public void ClearSettings()
public java.lang.String GetVersion()
public java.lang.String GetStatus(int line)
line
- channel numberpublic int GetStatusId(int line)
line
- channel numberpublic java.lang.String GetStatus(int line, int strict)
line
- channel numberstrict
- If set to 1, then it will return “Unknown” if no such line is activated. If set to 0, then it will return the default active line if the line doesn’t exists.public boolean VoiceRecord(int startstop, int now, java.lang.String filename)
startstop
- 0 to stop, 1 to start locally, 2 to start remote, 3 start to record both locally and to remote, 4 start to record as it is set by the “voicerecording” parameternow
- used if the startstop is set to 0. 0 means that the recorded file will be saved and/or uploaded at the end of the conversation only. 2 means that the file will be saved immediatelyfilename
- file name used for storing the recorded voice (if empty string, than will use a default file name)public boolean VoiceRecord(int startstop, int now, java.lang.String filename, int line)
startstop
- 0 to stop, 1 to start locally, 2 to start remote, 3 start to record both locally and to remote, 4 start to record as it is set by the “voicerecording” parameternow
- used if the startstop is set to 0. 0 means that the recorded file will be saved and/or uploaded at the end of the conversation only. 2 means that the file will be saved immediatelyfilename
- file name used for storing the recorded voice (if empty string, than will use a default file name)line
- set to -2 for all or other to specify current linepublic boolean VoiceRecord(int startstop, int now)
public boolean VoiceRecord(int startstop)
public boolean VoiceRecord(java.lang.String filename)
public boolean VoiceRecord()
public boolean SetCredentialsMD5(java.lang.String server, java.lang.String username, java.lang.String md5, java.lang.String realm)
server
- SIP server address (domain or IP:port)username
- SIP usernamemd5
- md5 checksum for username:realm:passwordrealm
- This parameter is optional (can be set as an empty string) but it is recommended for easy error detection. If present and the server realm don’t match with this one, an error message will be displayedpublic boolean SetCredentials(java.lang.String server, java.lang.String username, java.lang.String password)
server
- SIP server address (domain or IP:port)username
- SIP usernamepassword
- SIP passwordpublic boolean SetCredentials(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String authusername, java.lang.String displayname)
server
- SIP server address (domain or IP:port)username
- SIP usernamepassword
- SIP passwordauthusername
- SIP auth username (if different from username)displayname
- user full name (can be empty)@Deprecated public boolean SetCredentials()
public boolean RegisterEx(java.lang.String accounts)
accounts
- must have the following format: server,usr,pwd,ival;server2,usr2,pwd2, ival;public boolean Register(java.lang.String server, java.lang.String username, java.lang.String password, boolean async)
server
- SIP server address (domain or IP:port)username
- SIP usernamepassword
- SIP passwordasync
- false if register have to be dow from this thread. true if from separate thread. It is recommended to set to true.public boolean Register(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String authusername, java.lang.String displayname, boolean async)
server
- SIP server address (domain or IP:port)username
- SIP usernamepassword
- SIP passwordauthusername
- SIP auth username (if different from username)displayname
- user full name (can be empty)async
- false if register have to be dow from this thread. true if from separate thread. It is recommended to set to true.public boolean Register()
public boolean Unregister()
public boolean Unregister(int waitfor)
waitfor
- -1 (auto), 0 (do not wait) or 1 (wait for unregister to complete before to return).public void CheckConnection()
@Deprecated public boolean HTTPKeepAlive()
public boolean StopRing(int line)
line
- channel numberpublic boolean StartRing(int line)
line
- channel numberpublic boolean NATKeepAlive(java.lang.String server)
server
- target server addressspublic boolean CapabilityRequest(java.lang.String server, java.lang.String username)
server
- peer or server SIP signaling address (IP:port or domain)username
- user name to be sent in the SIP requestpublic boolean CapabilityRequest()
public java.lang.String LineToCallID(int line)
line
- channel numberpublic int CallIDToLine(java.lang.String callid)
callid
- SIP Call-ID stringpublic boolean SetLine(int line)
line
- channel numberpublic boolean SetLineEx(java.lang.String line)
line
- channel number, SIP Call-ID or peer username/numberpublic int GetLine()
public boolean Call(int line, java.lang.String number)
line
- channel numbernumber
- destinationnumber, SIP username or SIP URI to callpublic boolean Call(int line, java.lang.String number, int type)
line
- channel numbernumber
- destinationnumber, SIP username or SIP URI to calltype
- call type: -1: default, 0: audio, 1: video, 2: screensharingpublic boolean Call(int line, java.lang.String number, boolean async)
line
- channel numbernumber
- destination number, SIP username or SIP URI to callasync
- ignored (always asyncron)@Deprecated public boolean CallEx(int line, java.lang.String number, int type)
line
- channel numbernumber
- destinationnumber, SIP username or SIP URI to calltype
- call typepublic boolean RemoveVideo()
public void OnVideoRemoved(GVideo instance)
public boolean VideoCall(java.lang.String destination, int fragmentResId, FragmentActivity fragmentinstance)
public boolean SetVideoDisplaySize(int type, int width, int height)
type
- 1=for remote video container, 2=for local video containerwidth
- width in pixelsheight
- height in pixels; this parameter can be 0, and the height will be set depending on the video's aspect ratiopublic boolean MuteVideo(int state, int direction, int height)
state
- Pass true for the state to mute the video or false to un-mute.direction
- 0: mute in and out, 1: mute remote, 2: mute local@Deprecated public boolean AddVideo(int line, int type, int direction)
public byte[] GetMedia(int timeout)
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.public byte[] GetMedia()
public boolean Accept(int line)
line
- channel numberpublic boolean AcceptStrict(int line)
line
- channel numberpublic boolean AcceptVideo(int fragmentResId, FragmentActivity fragmentinstance)
fragmentResId
- the Integer resource ID of the FrameLayout in which the webphone fragment will be loadedfragmentinstance
- instance of the Activity in which the video module will be presented in. The video module consists of an android Fragment and the FragmentActivity will be its parent.public boolean Reject(int line)
line
- channel numberpublic boolean RejectEx(int line, java.lang.String reasontext)
line
- channel numberpublic boolean Hangup()
public boolean Hangup(int line)
line
- channel numberpublic boolean Hangup(int line, java.lang.String reason)
line
- channel numberreason
- disconnect reason textpublic boolean Transfer(int line, java.lang.String number)
line
- channel numbernumber
- destination number (transfer-to)public boolean Conf(java.lang.String number)
public boolean Conf(int line, java.lang.String number)
line
- channel number (to be created/added)number
- destination number, username or SIP URIpublic boolean Conf(int line)
line
- channel number (to be created/added)public boolean ConfEx(int line, java.lang.String number, boolean add)
line
- channel number (to be created/added or removed)number
- destination number, username or SIP URIadd
- set to true to add this number or false to removepublic boolean ConfEx(int line, java.lang.String number, boolean add, int confline)
line
- channel number (to be created/added or removed)number
- destination number, username or SIP URIadd
- set to true to add this number or false to removeconfline
- existing line in conference in which this new conference party will be addedpublic boolean Mute(int line, boolean mute, int what)
line
- channel number (-2 for all or -1 for current line)mute
- Set the mute parameter to true for mute or false to un-mute.what
- The direction can have the following values: 0: mute in and out, 1: mute out (speakers), 2: mute in (microphone), 3: mute in and out (same as 0), 4: mute default (set by the “defmute” parameter, which is “mute microphone only” by default)public boolean Mute(int line, boolean mute)
line
- channel number (-2 for all or -1 for current line)mute
- Set the mute parameter to true for mute or false to un-mute.public boolean MuteEx(int line, boolean mute, int what)
line
- channel number (-2 for all or -1 for current line)mute
- Set the mute parameter to true for mute or false to un-mute.what
- The direction can have the following values: 0: mute in and out, 1: mute out (speakers), 2: mute in (microphone), 3: mute in and out (same as 0), 4: mute default (set by the “defmute” parameter, which is “mute microphone only” by default)public int IsMuted(int line)
line
- channel numberpublic int IsOnHold(int line)
line
- channel numberpublic boolean Ignore(int line)
line
- channel numberpublic boolean Forward(int line, java.lang.String peer)
line
- channel numberpublic boolean Hold(int line, boolean hold)
line
- channel numberhold
- true for hold and false to reload.public boolean HoldChange(int line)
line
- channel numberpublic boolean Dtmf(int line, java.lang.String dtmf)
line
- channel numberdtmf
- one or more dtmf digits. Use the space char to insert delays between the digits.public boolean Info(int line, java.lang.String msg)
line
- channel numbermsg
- the message to to sendpublic boolean SendUSSD(int line, java.lang.String method, java.lang.String ussd)
line
- channel numbermethod
- INVITE, INFO, BYE (if INVITE, then a new session will be created. otherwise will use the session suggested by the line parameter)ussd
- the USSD string or the whole XMLpublic boolean SendChat(java.lang.String number, java.lang.String message)
number
- phone number or SIP username/extension numbermessage
- text (chat body content)public boolean SendChat(int line, java.lang.String number, java.lang.String message)
line
- channel numbernumber
- phone number or SIP username/extension numbermessage
- text (chat body content)public boolean SendChat(int line, java.lang.String number, java.lang.String group, java.lang.String message, int msgid)
line
- channel numbernumber
- phone number or SIP username/extension numbergroup
- optional group name parameter. Used only for group chat, otherwise it can be an empty string.message
- text (chat body content)msgid
- optional id. You can pass any (unique or auto incrementing) positive number to match the CHATREPORT notifications.public boolean SendChat(int line, java.lang.String number, java.lang.String group, java.lang.String message)
line
- channel numbernumber
- phone number or SIP username/extension numbergroup
- groupname (members separated by | )message
- text (chat body content)public boolean SendSMS(int line, java.lang.String number, java.lang.String message)
line
- channel numbernumber
- target mobile phone numbermessage
- text (SMS text)public boolean SendSMS(int line, java.lang.String number, java.lang.String group, java.lang.String message, int msgid)
line
- channel numbernumber
- target mobile phone numbergroup
- optional group name parameter. Used only for group SMS, otherwise it can be an empty string.message
- text (SMS text)msgid
- optional id. You can pass any (unique or auto incrementing) positive number to match the CHATREPORT notifications.public boolean SendChatIsComposing(int line, java.lang.String number)
line
- channel numbernumber
- phone number or SIP username/extension number@Deprecated public boolean SetVolumeIn(int val)
val
- volume level 0-100%public boolean SetVolumeOut(int val)
val
- volume level 0-100%public boolean SetVolume(int dev, int volume)
dev
- specify the device: 0 for the recording (microphone) audio device, 1 for the playback (speaker) audio device, 2 for the ringback (speaker) audio devicevolume
- volume level from 0 to 100 (percent value: 0-100%)public boolean SetVolume(int dev, int volume, int line)
dev
- specify the device: 0 for the recording (microphone) audio device, 1 for the playback (speaker) audio device, 2 for the ringback (speaker) audio devicevolume
- volume level from 0 to 100 (percent value: 0-100%)line
- channel numberpublic int GetVolume(int dev)
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 devicepublic int GetVolume(int dev, int line)
dev
- specify the device to query: 0 for the recording (microphone) audio device, 1 for the playback (speaker) audio device, 2 for the ringback (speaker) audio deviceline
- channel numberpublic boolean SetLogLevel(int level)
level
- loglevel from 1-5 (0 is not recommended because it will mute also the important notifications. values higher then 5 will increase the system load)public boolean HasCallInProgress()
public boolean HasCallInSpeaking()
public int IsInCall()
public boolean IsSpeaking()
public int GetCurrentConnectedCallCount()
public boolean SetIdle(boolean idle)
idle
- true if no user activitypublic boolean IsIdle()
public boolean IsOnline()
public int GetNetworkSpeed()
public boolean NeedRatingRequest()
public java.lang.String GetRegFailReason(boolean extended)
extended
- set to true for extended reportpublic int GetAccountRegState(java.lang.String domain, java.lang.String proxy, java.lang.String username, java.lang.String sipusername, boolean pushnotify, boolean strict)
public java.lang.String GetAccountRegStateString(java.lang.String domain, java.lang.String proxy, java.lang.String username, java.lang.String sipusername, boolean pushnotify, boolean strict)
public java.lang.String GetGlobalStatus()
public boolean PeerIsMizu(int line)
public boolean ServerIsMizu()
public java.lang.String GetDiscReasonText(java.lang.String line)
line
- can be line number or SIP call-idpublic int ShouldReset()
public boolean ShouldResetBeforeCall()
public boolean CanBluetooth()
public boolean IsBluetooth()
public boolean PlaySound(int start, java.lang.String file, boolean localfile, boolean toremotepeer, int line)
start
- 1 for start or 0 to stop the playback, -1 to pre-cachefile
- file namelocalfile
- true if the file have to be read from the device file system. False if remote file (for example if the file is on the webserver)toremotepeer
- stream the playback to the connected peerline
- used with toremotepeer if there are multiple calls in progress to specify the call (usually set to -1 for the current call if any)public boolean StreamSoundStream(int start, int line, java.io.InputStream inputstream)
start
- 1 for start or 0 to stop the playback, -1 to pre-cacheline
- channel numberinputstream
- audio data streampublic boolean StreamSoundBuff(int start, int line, byte[] buff, int len)
start
- 1 for start or 0 to stop the playback, -1 to pre-cacheline
- channel numberbuff
- audio data bufferlen
- audio data size in bytespublic boolean PlaySound(int start, int resourceid, int loop)
start
- 1 for start or 0 to stop the playback, -1 to pre-cacheresourceid
- resource idloop
- specify how many times to playpublic boolean PlayFile(java.lang.String filename)
filename
- file namepublic boolean PlayFile(java.lang.String filename, boolean start)
filename
- file namestart
- true to start playing, false to stop current playbackpublic void SetBluetooth(boolean on)
on
- toggle bluetooth on (true) / off (false)public boolean IsLoudspeaker()
public boolean SetSpeakerMode(boolean loud)
loud
- set to true if you wish to set to speaker/loudspeaker. otherwise false for normal earspeaker/earpiece.public java.lang.String GetIncomingDisplay(int line)
line
- channel numberpublic boolean SetSSLContext(javax.net.ssl.SSLContext sc)
sc
- SSLContext object prepared by youpublic java.lang.String GetLogs()
public boolean SetNotificationListener(SIPNotificationListener listener)
public SIPNotification GetNotification()
public java.lang.String GetNotificationStrings()
public java.lang.String GetNotificationsSync()
public java.lang.String PollNotificationStrings()
public java.lang.String GetNotifications()
@Deprecated public java.lang.String Poll()
public SIPNotification ParseNotification(java.lang.String notificationstring)
public java.lang.String GetAddress()
public java.lang.String GetLastRecFileName()
public boolean Test()
public java.lang.String TestEcho(java.lang.String echo)
echo
- any stringpublic boolean SetParameters(java.lang.String parameters)
parameters
- You can pass a set of parameters with this function in value=key lines separated by CRLF (\r\n).public boolean SetParameter(java.lang.String param, java.lang.String value)
param
- parameter name (setting name)value
- parameter value as stringpublic boolean SetParameter(java.lang.String param, int value)
param
- parameter name (setting name)value
- parameter value as integerpublic boolean SetParameter(java.lang.String param, long value)
param
- parameter name (setting name)value
- parameter value as longpublic boolean SetParameter(java.lang.String param, boolean value)
param
- parameter name (setting name)value
- parameter value as boolpublic boolean SetLineParameter(int line, java.lang.String param, java.lang.String value, int permanent)
line
- channel number. If -2 then it will be set as global config like the API_SetParameter. If -1 then for the active line. If 0, then it will be applied for all next/new channel(s). Otherwise it will be applied for the specific line.param
- parameter name (setting key name)value
- parameter value as string (or "NULL" to clear any old preset)permanent
- 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 linepublic java.lang.String GetLineParameter(int line, java.lang.String param)
line
- channel number. If -2 then it will get the global config like the API_GetParameter. If -1 then for the active line. If 0, then it will get for all next/new channel(s). Otherwise it read from the the specific line.param
- parameter name (setting key name)public java.lang.String GetParameter(java.lang.String param)
param
- parameter name (setting name)public boolean SetSSID(java.lang.String ssidval)
public boolean DelSettings(int level)
level
- 0: nothing, 1: settings, 2: everythingpublic java.lang.String GetConfigHash()
public int IsEncrypted()
public java.lang.String GetBindir()
public java.lang.String GetWorkdir()
public java.lang.String GetAltWorkdir()
public java.lang.String GetLogPath()
public boolean RecFiles_Del()
public boolean RecFiles_Clear()
public boolean RecFiles_Upload()
public java.lang.String VAD()
public java.lang.String VAD(int line)
line
- channel numberpublic java.lang.String RTPStat(int line)
line
- channel numberpublic boolean IsRegistered()
public boolean Registered()
public int IsRegisteredEx()
public boolean SaveFile(java.lang.String filename, java.lang.String content)
filename
- file pathcontent
- file contentpublic boolean SaveFileRaw(java.lang.String filename, java.lang.String content)
filename
- file pathcontent
- file contentpublic boolean SaveFileRemote(java.lang.String filename, java.lang.String content)
filename
- file pathcontent
- file contentpublic java.lang.String LoadFile(java.lang.String filename)
filename
- file pathpublic boolean LoadFileRemote(java.lang.String filename)
filename
- file pathpublic java.lang.String LoadFileRemoteSync(java.lang.String filename)
filename
- file pathpublic java.lang.String HTTPGet(java.lang.String uri)
uri
- HTTP URIpublic boolean HTTPPost(java.lang.String uri, java.lang.String data)
public java.lang.String HTTPReq(java.lang.String uri, java.lang.String data)
uri
- HTTP URIdata
- conent to postpublic boolean HTTPReqAsync(java.lang.String uri, java.lang.String data)
uri
- HTTP URIdata
- conent to postpublic boolean ClearCredentials()
public boolean SendSIPMessage(int line, java.lang.String msg, java.lang.String body, java.lang.String account, java.lang.String target)
line
- endpoint where the message will be sent. -3: new endpoint, -2: all endpoints, -1: current active, 0: register endpoint, 1+: call channel numbermsg
- SIP message to send. It can be just the method name (OPTIONS,MESSAGE,NOTIFY,INVITE,etc), the full message header or the full message including also a body (such as SDP)body
- optional SIP message body (such as SDP, xml payload or chat text, etc). Set to "null" if body must not be sent.account
- optional local SIP account details if you wish to use other parameters then the configured one. same format like the extraregisteraccounts parametertarget
- optional target username, number of SIP URI if not specified in the msgpublic boolean SendSIPMessage(int line, java.lang.String msg, java.lang.String body, java.lang.String account)
public boolean SendSIPMessage(int line, java.lang.String msg, java.lang.String body)
public boolean SendSIPMessage(int line, java.lang.String msg)
@Deprecated public boolean SendSIP(java.lang.String msg)
msg
- SIP message to sendpublic java.lang.String GetSIPHeader(int line, java.lang.String hdr)
line
- channel numberhdr
- SIP header to requestpublic java.lang.String GetSDPField(int line, java.lang.String field)
line
- channel numberfield
- SDP field to requestpublic java.lang.String GetSIPMessage(int line, int dir, int type)
line
- channel numberdir
- 0: in (incoming/received message), 1: out (outgoing/sent message)type
- 0: any, 1: SIP request (such as INVITE, REGISTER, BYE), 2: SIP answer (such as 200 OK, 401 Unauthorized and other response codes), 3: INVITE (the last INVITE received or sent), 4: the last 200 OK (call connect, ok for register or other)public boolean SetSIPHeader(int line, java.lang.String hdr)
line
- channel numberhdr
- SIP header (line) to setpublic boolean SetSDPField(int line, java.lang.String field, int type)
line
- channel numberfield
- SDP line to settype
- 0 means gobal, 1 means mediapublic boolean RTPHeaderExtension(int line, int profile, int extension)
line
- channel number. -3 means next call.profile
- first 2 bytes in the extension header which might be used as a custom identifier or parameterextension
- the extemsion word to be sentpublic boolean RTPHeaderExtension(int line, int profile, java.lang.String extension)
line
- channel number. -3 means next call.profile
- first 2 bytes in the extension header which might be used as a custom identifier or parameterextension
- one or multiple numbers separated by semicolonpublic boolean ED137PTT(int line, int ptt, int pttid)
line
- channel numberptt
- set PTT ON/OFF (0: off (not speaking), 1: on (Normal PTT ON), 2: Coupling PTT ON, 3: Priority PTT ON, 4: Emergency PTT ON)pttid
- optional PTT-ID (otherwise if default / -1 is passed then it will be loaded from global config)public boolean ED137PTT(int line, int ptt)
public boolean SetUUI(int line, java.lang.String value, int fortarget)
line
- channel numbervalue
- UUI data (can include also parameters. Example: 56a390f3d2b7310023a2;encoding=hex;purpose=foo;content=barfortarget
- specify if the UUI have to be sent to target party with call transfer or redirect. 0: no (to peer with the User-to-User header), 1: yes (to target escaped in Contact or Refer-To URI), 2: bothpublic int GetLineStatus(int line)
line
- channel numberpublic java.lang.String GetLineStatusText(int line)
line
- channel numberpublic java.lang.String GetLastCallDetails()
public java.lang.String GetMySIPURI(boolean all)
all
- if set to true, then it will return all possible URI’s separated by comma. Otherwise it will return single main URIpublic java.lang.String GetProfileStatusText(java.lang.String username)
public boolean IsIncomingVideo()
public java.lang.String GetLastRecInvite()
public java.lang.String GetLastSentInvite()
public java.lang.String GetLastRecSIPMessage(java.lang.String line)
line
- channel numberpublic boolean AddLog(java.lang.String text)
text
- log textpublic boolean AddLog(int level, java.lang.String text)
level
- log leveltext
- log textpublic boolean PushContactlist(java.lang.String userlist)
userlist
- users separated by comma (or a single user)public java.lang.String GetPresenceStatus()
public boolean SetPresenceStatus(java.lang.String status)
status
- one of the followings strings: Online, Away, DND, Invisible , Offline (case sensitive) .public boolean CheckPresence(java.lang.String userlist)
userlist
- users separated by comma (or a single user)public boolean CheckBLF(java.lang.String userlist)
userlist
- users/extensions/phone numbers separated by comma (it can be a single entry)public boolean DisableBLF(java.lang.String userlist)
userlist
- users/extensions/phone numbers separated by comma (it can be a single entry)public boolean Unsubscribe()
public boolean NewUser(java.lang.String user)
user
- username of the user to acceptpublic boolean SetBlacklist(java.lang.String str)
str
- users/numbers separated by commapublic boolean AddToBlacklist(java.lang.String str)
str
- username, phone number, SIP URI or IP address to blockpublic java.lang.String GetBlacklist()
public boolean SetWhitelist(java.lang.String str)
str
- users/numbers separated by commapublic boolean AddToWhitelist(java.lang.String str)
str
- username, phone number or SIP URI to blockpublic java.lang.String GetWhitelist()
public boolean NumExists()
public boolean SetContact(java.lang.String name, java.lang.String params)
public boolean SetContactPhone(java.lang.String name, java.lang.String param)
public boolean SetContactSIP(java.lang.String name, java.lang.String param)
public boolean SetContactName(java.lang.String name, java.lang.String param)
public boolean SetContactSpeedDial(java.lang.String name, java.lang.String param)
public boolean SetContactStatus(java.lang.String name, java.lang.String param)
public java.lang.String GetContactPhone(java.lang.String name)
public java.lang.String GetContactSIP(java.lang.String name)
public java.lang.String GetContactName(java.lang.String name)
public java.lang.String GetContactSpeedDial(java.lang.String name)
public boolean AddContact(java.lang.String params)
public boolean DelContact(java.lang.String name)
public java.lang.String GetContact(java.lang.String name)
public java.lang.String GetContactPresence(java.lang.String name)
public java.lang.String GetContactPresenceStr(java.lang.String name)
public boolean SetContacts(java.lang.String contacts)
public java.lang.String GetContacts()
public boolean CheckVoicemail(int line)
line
- channel number. should be set to -1.public boolean CheckVoicemail()
@Deprecated public boolean Record(int record)
record
- 0=no,1=local,2=remote ftp,3=bothpublic java.lang.String GetMAC()
public java.lang.String GetAudioDeviceList(int dev)
dev
- Set to 0 to list the recording device names or set to 1 for to get the playback or ringer devices.public boolean SetAudioDevice(int dev, java.lang.String devicename)
dev
- 0: recording device (microphone), 1: playback device (speaker, headset), 2: ringer device (speaker, headset)devicename
- name of the audio device. Should be a valid audio device name (you can list them with the GetAudioDeviceList call)public boolean SetVideoDevice(java.lang.String devicename)
devicename
- name of the video devicepublic java.lang.String GetAudioDevice(int dev)
dev
- 0 for recording, 1 for playback, 2 for ringerpublic boolean SetAudioDevice(int dev, java.lang.String devicename, int immediate)
dev
- 0: recording device (microphone), 1: playback device (speaker, headset), 2: ringer device (speaker, headset)devicename
- name of the audio device. Should be a valid audio device name (you can list them with the GetAudioDeviceList call)immediate
- 0: default (after the “changeaudiodevimmediate” parameter), 1: next call only, 2: immediately for active callspublic java.lang.String GetCallerID()
public java.lang.String GetCallerID(int line)
line
- channel number@Deprecated public java.lang.String GetCallerID(int line, int type)
line
- channel numberpublic java.lang.String GetLineDetails(int line)
line
- channel numberpublic int HiddenLine()
@Deprecated public boolean CredentialsChanged(java.lang.String newserver, java.lang.String newusername)
public void NoUnregister()
public java.lang.String GetDeviceID()
public boolean IsTerminated()
public int GetPushNotifications()
public int GetPushNotificationsEx(boolean thissessiononly)
public boolean SetPushNotifications(int pushnotifications, java.lang.String clientid, java.lang.String packagename, java.lang.String gateway)
pushnotifications
- -1=auto guess, 0=disabled, 1=enabled auto, 2=enabled direct,3=enabled via gatewayclientid
- token received from FCMpackagename
- 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 notificationspublic GUtility GetGUtilityObj()