![]() |
PortSIP VoIP SDK Manual for Android
16.2
PortSIP features our newest, supported, quality-assured VoIP SDK used by Several hundred companies around the world for easy VoIP application develop and quality-assured code.
|
Functions | |
int | com.portsip.PortSipSdk.sendOptions (String to, String sdp) |
int | com.portsip.PortSipSdk.sendInfo (long sessionId, String mimeType, String subMimeType, String infoContents) |
long | com.portsip.PortSipSdk.sendMessage (long sessionId, String mimeType, String subMimeType, byte[] message, int messageLength) |
long | com.portsip.PortSipSdk.sendOutOfDialogMessage (String to, String mimeType, String subMimeType, boolean isSMS, byte[] message, int messageLength) |
long | com.portsip.PortSipSdk.setPresenceMode (int mode) |
long | com.portsip.PortSipSdk.setDefaultSubscriptionTime (int secs) |
long | com.portsip.PortSipSdk.setDefaultPublicationTime (int secs) |
long | com.portsip.PortSipSdk.presenceSubscribe (String contact, String subject) |
int | com.portsip.PortSipSdk.presenceTerminateSubscribe (long subscribeId) |
int | com.portsip.PortSipSdk.presenceAcceptSubscribe (long subscribeId) |
int | com.portsip.PortSipSdk.presenceRejectSubscribe (long subscribeId) |
int | com.portsip.PortSipSdk.setPresenceStatus (long subscribeId, String statusText) |
long | com.portsip.PortSipSdk.sendSubscription (String to, String eventName) |
Send a SUBSCRIBE message to subscribe an event. More... | |
int | com.portsip.PortSipSdk.terminateSubscription (long subscribeId) |
int com.portsip.PortSipSdk.sendOptions | ( | String | to, |
String | sdp | ||
) |
Send OPTIONS message.
to | The recipient of OPTIONS message. |
sdp | The SDP of OPTIONS message. It's optional if user does not want to send the SDP with OPTIONS message. |
int com.portsip.PortSipSdk.sendInfo | ( | long | sessionId, |
String | mimeType, | ||
String | subMimeType, | ||
String | infoContents | ||
) |
Send a INFO message to remote side in dialog.
sessionId | The session ID of call. |
mimeType | The mime type of INFO message. |
subMimeType | The sub mime type of INFO message. |
infoContents | The contents that will be sent with INFO message. |
long com.portsip.PortSipSdk.sendMessage | ( | long | sessionId, |
String | mimeType, | ||
String | subMimeType, | ||
byte [] | message, | ||
int | messageLength | ||
) |
Send a MESSAGE message to remote side in dialog.
sessionId | The session ID of call. |
mimeType | The mime type of MESSAGE message. |
subMimeType | The sub mime type of MESSAGE message. |
message | The contents that will be sent with MESSAGE message. Binary data allowed. |
messageLength | The message size. |
long com.portsip.PortSipSdk.sendOutOfDialogMessage | ( | String | to, |
String | mimeType, | ||
String | subMimeType, | ||
boolean | isSMS, | ||
byte [] | message, | ||
int | messageLength | ||
) |
Send a out of dialog MESSAGE message to remote side.
to | The message receiver. Likes sip:recei ver@ ports ip.c om |
mimeType | The mime type of MESSAGE message. |
subMimeType | The sub mime type of MESSAGE message. |
isSMS | Set to YES to specify "messagetype=SMS" in the To line, or NO to disable. |
message | The contents that will be sent with MESSAGE message. Binary data allowed. |
messageLength | The message size. |
long com.portsip.PortSipSdk.setPresenceMode | ( | int | mode | ) |
Indicate the SDK uses the P2P mode for presence or presence agent mode.
mode | 0 - P2P mode; 1 - Presence Agent mode. Default is P2P mode. |
long com.portsip.PortSipSdk.setDefaultSubscriptionTime | ( | int | secs | ) |
Set the default expiration time to be used when creating a subscription.
secs | The default expiration time of subscription. |
long com.portsip.PortSipSdk.setDefaultPublicationTime | ( | int | secs | ) |
Set the default expiration time to be used when creating a publication.
secs | The default expiration time of publication. |
long com.portsip.PortSipSdk.presenceSubscribe | ( | String | contact, |
String | subject | ||
) |
Send a SUBSCRIBE message for presence to a contact.
contact | The target contact, it must be in the format of sip:conta. ct00 1@sip .por tsip. com |
subject | This subject text will be inserted into the SUBSCRIBE message. For example: "Hello, I'm Jason". The subject maybe is in UTF8 format. You should use UTF8 to decode it. |
int com.portsip.PortSipSdk.presenceTerminateSubscribe | ( | long | subscribeId | ) |
Terminate the given presence subscription.
subscribeId | The ID of the subscription. |
int com.portsip.PortSipSdk.presenceAcceptSubscribe | ( | long | subscribeId | ) |
Accept the presence SUBSCRIBE request which received from contact.
subscribeId | Subscription ID. When receiving a SUBSCRIBE request from contact, the event onPresenceRecvSubscribe will be triggered. The event includes the subscription ID. |
int com.portsip.PortSipSdk.presenceRejectSubscribe | ( | long | subscribeId | ) |
Reject a presence SUBSCRIBE request received from contact.
subscribeId | Subscription ID. When receiving a SUBSCRIBE request from contact, the event onPresenceRecvSubscribe will be triggered. The event inclues the subscription ID. |
int com.portsip.PortSipSdk.setPresenceStatus | ( | long | subscribeId, |
String | statusText | ||
) |
Send a NOTIFY message to contact to notify that presence status is online/offline/changed.
subscribeId | Subscription ID. When receiving a SUBSCRIBE request from contact, the event onPresenceRecvSubscribe that includes the Subscription ID will be triggered. |
statusText | The state text of presence status. For example: "I'm here", offline must use "offline" |
long com.portsip.PortSipSdk.sendSubscription | ( | String | to, |
String | eventName | ||
) |
Send a SUBSCRIBE message to subscribe an event.
to | The user/extension will be subscribed. |
eventName | The event name to be subscribed. |
Example 2, to monitor a user/extension call status, You can use code: sendSubscription(mSipLib, "100", "dialog"); Extension 100 refers to the user/extension to be monitored. Once being monitored, when extension 100 hold a call or is ringing, the onDialogStateUpdated callback will be triggered.
int com.portsip.PortSipSdk.terminateSubscription | ( | long | subscribeId | ) |
Terminate the given subscription.
subscribeId | The ID of the subscription. |