![]() |
PortSIP VoIP SDK Manual for iOS
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) | - PortSIPSDK::setPresenceMode: |
Indicate that SDK uses the P2P mode for presence or presence agent mode. More... | |
(int) | - PortSIPSDK::setDefaultSubscriptionTime: |
Set the default expiration time to be used when creating a subscription. More... | |
(int) | - PortSIPSDK::setDefaultPublicationTime: |
Set the default expiration time to be used when creating a publication. More... | |
(long) | - PortSIPSDK::presenceSubscribe:subject: |
Send a SUBSCRIBE message for subscribing the contact's presence status. More... | |
(int) | - PortSIPSDK::presenceTerminateSubscribe: |
Terminate the given presence subscription. More... | |
(int) | - PortSIPSDK::presenceAcceptSubscribe: |
Accept the presence SUBSCRIBE request which is received from contact. More... | |
(int) | - PortSIPSDK::presenceRejectSubscribe: |
Reject a presence SUBSCRIBE request which is received from contact. More... | |
(int) | - PortSIPSDK::setPresenceStatus:statusText: |
Send a NOTIFY message to contact to notify that presence status is online/offline/changed. More... | |
(long) | - PortSIPSDK::sendSubscription:eventName: |
Send a SUBSCRIBE message to remote side. More... | |
(int) | - PortSIPSDK::terminateSubscription: |
Terminate the given subscription. More... | |
- (int) setPresenceMode: | (int) | mode |
Indicate that SDK uses the P2P mode for presence or presence agent mode.
mode | 0 - P2P mode; 1 - Presence Agent mode, default is P2P mode. |
- (int) setDefaultSubscriptionTime: | (int) | secs |
Set the default expiration time to be used when creating a subscription.
secs | The default expiration time of subscription. |
- (int) setDefaultPublicationTime: | (int) | secs |
Set the default expiration time to be used when creating a publication.
secs | The default expiration time of publication. |
- (long) presenceSubscribe: | (NSString *) | contact | |
subject: | (NSString *) | subject | |
Send a SUBSCRIBE message for subscribing the contact's presence status.
contact | The target contact. It must be like 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 in UTF-8 format. You should use UTF-8 to decode it. |
- (int) presenceTerminateSubscribe: | (long) | subscribeId |
Terminate the given presence subscription.
subscribeId | The ID of the subscription. |
- (int) presenceAcceptSubscribe: | (long) | subscribeId |
Accept the presence SUBSCRIBE request which is received from contact.
subscribeId | Subscription ID. When receiving a SUBSCRIBE request from contact, the event onPresenceRecvSubscribe will be triggered. The event will include the subscription ID. |
- (int) presenceRejectSubscribe: | (long) | subscribeId |
Reject a presence SUBSCRIBE request which is 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) setPresenceStatus: | (long) | subscribeId | |
statusText: | (NSString *) | 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) sendSubscription: | (NSString *) | to | |
eventName: | (NSString *) | eventName | |
Send a SUBSCRIBE message to remote side.
to | The subscribe user. |
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 is the one to be monitored. Once being monitored, when extension 100 hold a call or is ringing, the onDialogStateUpdated callback will be triggered.
- (int) terminateSubscription: | (long) | subscribeId |
Terminate the given subscription.
subscribeId | The ID of the subscription. |