Home

PortSIP VoIP SDK Manual for iOS

image

Contents

1. Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int playAudioFileToRemote long sessionld filename NSString filename fileSamplesPerSec int fileSamplesPerSec loop BOOL loop Play an wave file to remote party Parameters sessionld Session ID of the call filename The file full path name such as test wav fileSamplesPerSec The wave file sample in seconds should be 8000 or 16000 or 32000 loop Set to false to stop play audio file when it is end Set to true to play it as repeat Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code 53 int stopPlayAudioFileToRemote long sessionld Stop play wave file to remote side Parameters sessionld Session ID of the call Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int playAudioFileToRemoteAsBackground long sessionld filename NSString filename fileSamplesPerSec int fileSamplesPerSec Play an wave file to remote party as conversation background sound Parameters sessionId Session ID of the call filename The file full path name such as test wav fileSamplesPerSec The wave file sample in seconds should be 8000 or 16000 or 32000 Returns If th
2. void onInviteConnected long sessionld optional This event will be triggered when UAC sent UAS received ACK the call is connected Some functions hold updateCall etc can called only after the call connected otherwise the functions will return error Parameters sessionld The session ID of the call void onInviteBeginingForward char forwardTo optional If the enableCallForward method is called and a call is incoming the call will be forwarded automatically and trigger this event Parameters forwardTo The forward target SIP URI void onInviteClosed long sessionld optional This event is triggered once remote side close the call Parameters sessionld The session ID of the call void onRemoteHold long sessionld optional If the remote side has placed the call on hold this event triggered Parameters sessionld The session ID of the call void onRemoteUnHold long sessionld audioCodecs char audioCodecs videoCodecs char videoCodecs existsAudio BOOL existsAudio existsVideo BOOL existsVideo optional If the remote side was un hold the call this event triggered Parameters sessionld The session ID of the call 11 audioCodecs The matched audio codecs it s separated by if have more than one codec videoCodecs The matched video codecs it s separated by if ha
3. Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int muteSession long sessionld mutelncomingAudio BOOL mutelncomingAudio muteOutgoingAudio BOOL muteOutgoingAudio mutelncomingVideo BOOL mutelncomingVideo muteOutgoingVideo BOOL muteOutgoingVideo Mute the specified session audio or video Parameters sessionld The session ID of the call 44 mutelncomingAudi Set it to true to mute incoming audio stredam can t hearing remote side o audio muteOutgoingAud Set it to true to mute outgoing audio stredam the remote side can t hearing io audio mutelncomingVide Set it to true to mute incoming video stredam can t see remote side video o muteOutgoingVide Set it to true to mute outgoing video stredam the remote side can t see o video Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int forwardCall long sessionid forwardTo NSString forwardTo Forward call to another one when received the incoming call Parameters sessionld The session ID of the call forwardTo Target of the forward it can be sip number sipserver com or number only Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int sendDtmf long
4. int presenceOnline statusText Send a NOTIFY message to contact to notify that presence status is online changed int presenceOffline Send a NOTIFY message to contact to notify that presence status is offline BOOL startKeepAwake Keep VoIP awake in the background If you want your application can receive the incoming call when it run in background you should call this function in applicationDidEnterBackground BOOL stopKeepAwake Keep VoIP awake in the background Call this function in applicationWillEnterForeground once your application come back to foreground Properties id lt PortSIPEventDelegate gt delegate Detailed Description PortSIP VoIP SDK functions class Author Copyright c 2006 2014 PortSIP Solutions Inc All rights reserved Version 11 2 2 See also http www PortSIP com PortSIP SDK functions class description 74 The documentation for this class was generated from the following file PortSIPSDK h 75 PortSIPVideoRenderView Class Reference PortSIP VoIP SDK Video Render View class import lt PortSIPVideoRenderView h gt Inherits UlView Instance Methods void initVideoRender Initialize the Video Render view shoud Initialize render before use void releaseVideoRender release the Video Render void getVideoRenderView Don t use this Just call by SDK void updateVideoRenderFrame
5. subMimeType messageData unsigned char messageData messageDataLength int messageDataLength This event will be triggered when received a MESSAGE message in dialog Parameters sessionld The session ID of the call mimeType The message mime type subMimeType The message sub mime type messageData The received message body it s can be text or binary data messageDataLeng The length of messageData th void onRecvOutOfDialogMessage char fromDisplayName from char from toDisplayName char toDisplayName to char to mimeType char mimeType subMimeType char subMimeType messageData unsigned char messageData messageDataLength int messageDataLength This event will be triggered when received a MESSAGE message out of dialog for example pager message Parameters fromDisplayName The display name of sender from The message sender toDisplayName The display name of receiver to The receiver mimeType The message mime type subMimeType The message sub mime type messageData The received message body it s can be text or binary data messageDataLeng The length of messageData th void onSendMessageSuccess long sessionld messageld long messageld If the message was sent succeeded in dialog this event will be triggered Parameters sessionId The session ID of the call messageld The message ID it s eq
6. sendCumulativeLost recvFractionLost recvCum ulativeLost 60 getAudioRtpStatistics averageJitterMs maxJitter Ms discardedPackets 60 getNetworkStatistics currentBufferSize preferre dBufferSize currentPacketLossRate currentDisca rdRate currentExpandRate currentPreemptiveR ate currentAccelerateRate 59 getVideoRtpStatistics bytesSent packetsSent by tesReceived packetsReceived 60 SDK Callback events 9 SDK functions 23 Send audio and video stream functions 49 enableSendPcmStreamToRemote state streamS amplesPerSec 49 enableSendVideoStreamToRemote state 50 sendPcmStreamToRemote data 49 sendVideoStreamToRemote data width height 50 Send OPTIONS INFO MESSAGE functions 62 sendinfo mimeType subMimeType infoContent s 63 sendMessage mimeType subMimeType messag e messageLength 63 sendOptions sdp 63 sendOutOfDialogMessage mimeType subMime Type message messageLength 64 sendDtmf dtmfMethod code dtmfDration playDtmfT one Call functions 46 sendinfo mimeType subMimeType infoContents Send OPTIONS INFO MESSAGE functions 63 sendMessage mimeType subMimeType message me ssageLength Send OPTIONS INFO MESSAGE functions 63 sendOptions sdp Send OPTIONS INFO MESSAGE functions 63 sendOutOfDialogMessage mimeType subMimeType message messageLength Send OPTIONS INFO MESSAGE functions 64 sendPcmStreamToRemote data Send audio and video stream functions 49 sendVideo sendState Audio and video functions
7. codecType Audio codec type defined in the PortSIPTypes file payloadType The new RTP payload type that you want to set Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setVideoCodecPayloadType VIDEOCODEC TYPE codecType payloadType int payloadType Set the RTP payload type for dynamic Video codec Parameters codecType Video codec type defined in the PortSIPTypes file payloadType The new RTP payload type that you want to set Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setAudioCodecParameter AUDIOCODEC TYPE codecType parameter NSString parameter Set the codec parameter for audio codec Parameters codecType Audio codec type defined in the PortSIPTypes file parameter The parameter in string format Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks Example myVoIPsdk setAudioCodecParameter AUDIOCODEC AMR parameter mode set 0 octet align 1 robust sorting 0 int setVideoCodecParameter VIDEOCODEC_TYPE codecType parameter NSString parameter Set the codec parameter for video codec 28 Parameters codecType Video codec type defined in the PortSIPTypes file parameter The parameter in
8. onRegisterSuccess statusCode void PortSIPEventDelegate onRegisterFailure statusCode Detailed Description Register events Function Documentation void onRegisterSuccess char statusText statusCode int statusCode When successfully register to server this event will be triggered Parameters statusText The status text statusCode The status code void onRegisterFailure char status Text statusCode int statusCode If register to SIP server is fail this event will be triggered Parameters statusText The status text statusCode The status code Call events Functions void PortSIPEventDelegate onInvitelncoming callerDisplayName caller calleeDisplayName callee audioCodecs vi deoCodecs existsAudio existsVideo void lt PortSIPEventDelegate gt onInviteTrying void PortSIPEventDelegate onInviteSessionProgress audioCodecs videoCodecs existsEarlyMedia existsAudio exis tsVideo void PortSIPEventDelegate onInviteRinging statusText statusCode void lt PortSIPEventDelegate gt o0nInviteAnswered callerDisplayName caller calleeDisplayName callee audioCodecs v ideoCodecs existsAudio existsVideo void lt PortSIPEventDelegate gt onInviteFailure reason code void lt PortSIPEventDelegate gt onInviteUpdated audioCodecs videoCodecs existsAudi
9. and want to get SIP message header value use getExtensionHeaderValue to do it NSString headerValue myVoIPSdk getExtensionHeaderValue message headerName name int addExtensionHeader NSString headerName headerValue NSString headerValue Add the extension header custom header into every outgoing SIP message Parameters headerName The custom header name which will be appears in every outgoing SIP message headerValue The custom header value Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int clearAddExtensionHeaders Clear the added extension headers custom headers Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Remarks Example we have added two custom headers into every outgoing SIP message and want remove them myVoIPSdk addExtensionHeader Blling headerValue usd100 00 myVoIPSdk addExtensionHeader ServiceId headerValue 8873456 myVoIPSdk clearAddextensionHeaders 36 int modifyHeaderValue NSString headerName headerValue NSString headerValue Modify the special SIP header value for every outgoing SIP message Parameters headerName The SIP header name which will be modify it s value headerValue The heaver value want to modify Returns If the function succeeds the return value
10. change the Video Render size Detailed Description PortSIP VoIP SDK Video Render View class Author Copyright c 2006 2015 PortSIP Solutions Inc All rights reserved Version 11 2 2 See also http www PortSIP com PortSIP VoIP SDK Video Render View class description Method Documentation void updateVideoRenderFrame CGRect frameRect change the Video Render size Remarks Example NSRect rect videoRenderView frame rect size width 20 rect size height 20 videoRenderView frame rect videoRenderView setNeedsDisplay YES NSRect renderRect videoRenderView bounds 76 videoRenderView updateVideoRenderFrame renderRect The documentation for this class was generated from the following file PortSIPVideoRenderView h 77 Index lt PortSIPEventDelegate gt 68 acceptRefer referSignaling Refer functions 48 Access SIP message header functions 36 addExtensionHeader headerValue 37 clearAddExtensionHeaders 37 clearModifyHeaders 38 getExtensionHeaderValue headerName 37 modifyHeaderValue headerValue 38 addAudioCodec Audio and video codecs functions 28 addExtensionHeader headerValue Access SIP message header functions 37 Additional setting functions 30 addSupportedMimeType mimeType subMimeT ype 36 detectMwi 34 disableCallForward 33 disableSessionTimer 34 enable3GppTags 32 enableCallbackSendingSignaling 32 enableCallForward forwardTo 33 enable
11. char reason code int code This callback will be triggered once remote side called rejectRefer to reject the REFER Parameters sessionld The session ID of the call reason Reject reason code Reject code void onTransferTrying long sessionid When the refer call is processing this event trigged Parameters sessionld The session ID of the call void onTransferRinging long sessionld When the refer call is ringing this event trigged Parameters sessionld The session ID of the call void onACTVTransferSuccess long sessionld When the refer call is succeeds this event will be triggered The ACTV means Active For example A established the call with B A transfer B to C C accepted the refer call A received this event Parameters sessionld The session ID of the call void onACTVTransferFailure long sessionld reason char reason code int code When the refer call is fails this event will be triggered The ACTV means Active For example A established the call with B A transfer B to C C rejected this refer call A will received this event Parameters sessionld The session ID of the call reason The error reason code The error code Signaling events Functions void PortSIPEventDelegate onReceivedSignaling message void lt PortSIPEventDelegate gt onSend
12. enableCallForward BOOL forBusyOnly forwardTo NSString forwardTo Enable call forward Parameters forBusyOnly If set this parameter as true the SDK will forward all incoming calls when currently it s busy If set this as false the SDK forward all inconing calls anyway forwardTo The call forward target it s must likes sip xxxx sip portsip com Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int disableCallForward Disable the call forward the SDK is not forward any incoming call after this function is called Returns If the function succeeds the return value is O If the function fails the return value is a specific error code 32 int enableSessionTimer int timerSeconds refreshMode SESSION REFRESH MODE refreshMode Allows to periodically refresh Session Initiation Protocol SIP sessions by sending repeated INVITE requests Parameters timerSeconds The value of the refresh interval in seconds Minimum requires 90 seconds refreshMode Allow set the session refresh by UAC or UAS SESSION REFERESH UAC or SESSION REFERESH UAS Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks The repeated INVITE requests or re INVITEs are sent during an active call leg to allow user agents UA or proxies to determine the st
13. sessionld dtmfMethod DTMF METHOD dtmfMethod code int code dtmfDration int dtmfDuration playDtmfTone BOOL playDtmfTone Send DTMF tone Parameters sessionld The session ID of the call dtmfMethod Support send DTMF tone with two methods DTMF_RFC2833 and DTMF_INFO The DTMF_RFC2833 is recommend code The DTMF tone 0 16 o o o oO Description The DTMF tone O The DTMF tone 1 The DTMF tone 2 The DTMF tone 3 The DTMF tone 4 The DTMF tone 5 The DTMF tone 6 The DTMF tone 7 The DTMF tone 8 o o j U1 3 0M n IO The DTMF tone 9 LA o The DTMF tone The DTMF tone e N The DTMF tone A 45 13 The DTMF tone B 14 The DTMF tone C 15 The DTMF tone D 16 The DTMF tone FLASH Parameters dtmfDuration The DTMF tone samples recommend 160 playDtmfTone Set to true the SDK play local DTMF tone sound during send DTMF Returns Refer functions If the function succeeds the return value is O If the function fails the return value is a specific error code Functions int PortSIPSDK refer referTo Refer the currently call to another one int PortSIPSDK attendedRefer replaceSessionld referTo Make an attended refer long PortSIPSDK acceptRefer referSignaling Accept the REFER request a new call will be make if c
14. void onRemoteUnHold audioCodecs videoCodecs existsAudio existsVideo void onReceivedRefer referld to from referSipMessage void onReferAccepted void onReferRejected reason code void onTransferTrying void onTransferRinging void onACTVTransferSuccess void onACTVTransferFailure reason code void onReceivedSignaling message void onSendingSignaling message void onWaitingVoiceMessage urgentNewMessageCount urgentOldMessageCount newMessageCount oldMessageC ount void onWaitingFaxMessage urgentNewMessageCount urgentOldMessageCount newMessageCount oldMessageCo unt void onRecvDtmfTone tone void onRecvOptions void onRecvinfo void onPresenceRecvSubscribe fromDisplayName from subject void onPresenceOnline from stateText void onPresenceOffline from void onRecvMessage mimeType subMimeType messageData messageDataLength 67 void onRecvOutOfDialogMessage from toDisplayName to mimeType subMimeType messageData messageDataLen gth void onSendMessageSuccess messageld void onSendMessageFailure messageld reason code void onSendOutOfDialogMessageSuccess fromDisplayName from toDisplayName to void onSendOutOfDialogMessageFailure fromDisplayName from toDisplayName to reason code void onPlayAudioFileFinished fileName void onPlayVideoFileFinished v
15. 168 1 108 it will be using for send and receive SIP message and RTP packet If pass this IP as the IPv6 format then the SDK using IPv6 If you want the SDK choose correct network interface IP automatically please pass the 0 0 0 0 for IPv4 or for IPv6 localSIPPort The SIP message transport listener port for example 5060 userDomain User domain this parameter is optional that allow pass a empty string if you are not use domain sipServer SIP proxy server IP or domain for example xx xxx xx x or sip xxx com sipServerPort Port of the SIP proxy server for example 5060 stunServer Stun server use for NAT traversal it s optional and can be pass empty string to disable STUN stunServerPort STUN server port it will be ignored if the outboundServer is empty outboundServer Outbound proxy server for example sip domain com it s optional that allow pass a empty string if not use outbound server outboundServerPo Outbound proxy server port it will be ignored if the outboundServer is rt empty Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int registerServer int expires retryTimes int retryTimes Register to SIP proxy server login to server Parameters expires Registration refresh Interval in seconds maximum is 3600 it will be inserted into SIP REGISTER message headers retryTimes The retry times if failed to r
16. D LA o The DTMF tone FLASH 15 INFO OPTIONS message events Functions void lt PortSIPEventDelegate gt onRecvOptions void PortSIPEventDelegate onRecvInfo Detailed Description Function Documentation void onRecvOptions char optionsMessage This event will be triggered when received the OPTIONS message Parameters optionsMessage The received whole OPTIONS message in text format void onRecvinfo char infoMessage This event will be triggered when received the INFO message Parameters infoMessage The received whole INFO message in text format Presence events Functions void PortSIPEventDelegate onPresenceRecvSubscribe fromDisplayName from subject void PortSIPEventDelegate onPresenceOnline from stateText void PortSIPEventDelegate onPresenceOffline from Detailed Description Function Documentation void onPresenceRecvSubscribe long subscribeld fromDisplayName char fromDisplayName from char from subject char subject This event will be triggered when received the SUBSCRIBE request from a contact 16 Parameters subscribeld The id of SUBSCRIBE request fromDisplayName The display name of contact from The contact who send the SUBSCRIBE request subject The subject of the SUBSCRIBE request void on
17. MESSAGE message events 19 onRecvOptions INFO OPTIONS message events 17 onRecvOutOfDialogMessage from toDisplayName to mimeType subMimeType messageData messageDat aLength MESSAGE message events 19 onReferAccepted Refer events 13 onReferRejected reason code Refer events 13 onRegisterFailure statusCode Register events 9 onRegisterSuccess statusCode Register events 9 onRemoteHold Call events 12 onRemoteUnHold audioCodecs videoCodecs existsA udio existsVideo Call events 12 onSendingRTPPacket isAudio RTPPacket packetSize RTP callback events 21 onSendingSignaling message Signaling events 15 onSendMessageFailure messageld reason code MESSAGE message events 19 onSendMessageSuccess messageld MESSAGE message events 19 onSendOutOfDialogMessageFailure fromDisplayNam e from toDisplayName to reason code MESSAGE message events 20 onSendOutOfDialogMessageSuccess fromDisplayNa me from toDisplayName to MESSAGE message events 20 onTransferRinging Refer events 14 onTransferTrying Refer events 14 onVideoRawCallback videoCallbackMode width heig ht data dataLength Audio and video stream callback events 22 onWaitingFaxMessage urgentNewMessageCount ur gentOldMessageCount newMessageCount oldMessa geCount MWI events 15 onWaitingVoiceMessage urgentNewMessageCount urgentOldMessageCount newMessageCount oldMes sageCount MWI events 15 Play audio and video file finished events 20 onPlayAudioFileFi
18. OS Eclipse Java for Android the sample project source code is provided not include SDK source code The sample projects demonstrate how to create a SIP application base on our SDK powerful easy and quick Contents The download sample package contains almost all of PortSIP SDK documentation Dynamic Static libraries sources headers datasheet and everything else a SDK user might need SDK User Manual The starting point for the documentation of PortSIP VoIP SDK is the SDK User Manual page which gives a brief description of each API functions Web Site Some general interest or often changing PortSIP SDK information lives only on the PortSIP web site The release contains links to the site so while browsing it you ll see occasional broken links if you aren t connected to the Internet But everything needed to use the PortSIP VolP SDK is contained within the release Background Read the Overview to help you understand what PortSIP is about and to help in educating your organization about PortSIP Support Please send email to Our support if you need any helps Machine Requirements Development using the PortSIP VoIP IMS SDK for iOS requires an Intel based Macintosh running Snow Leopard OS X 10 8 or higher Apple s iOS SDK If you are not yet a registered Apple developer to be able to develop applications for the iOS you do need to become a registered Apple developer After registered Apple grants you free acce
19. Remove all enabled audio codecs void PortSIPSDK clearVideoCodec Remove all enabled video codecs int PortSIPSDK setAudioCodecParameter parameter Set the codec parameter for audio codec int PortSIPSDK setVideoCodecParameter parameter Set the codec parameter for video codec Detailed Description Function Documentation int addAudioCodec AUDIOCODEC_TYPE codecType Enable an audio codec it will be appears in SDP Parameters codecType Audio codec type Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int addVideoCodec VIDEOCODEC_TYPE codecType Enable a video codec it will be appears in SDP Parameters codecType Video codec type Returns If the function succeeds the return value is O If the function fails the return value is a specific error code BOOL isAudioCodecEmpty Detect enabled audio codecs is empty or not Returns If no audio codec was enabled the return value is true otherwise is false BOOL isVideoCodecEmpty Detect enabled video codecs is empty or not Returns If no video codec was enabled the return value is true otherwise is false 27 int setAudioCodecPayloadType AUDIOCODEC_TYPE codecType payloadType int payloadType Set the RTP payload type for dynamic audio codec Parameters
20. The session ID of the call void onInviteSessionProgress long sessionld audioCodecs char audioCodecs videoCodecs char videoCodecs existsEarlyMedia BOOL existsEarlyMedia existsAudio BOOL existsAudio existsVideo BOOL existsVideo optional Once the caller received the 183 session progress message this event will be triggered Parameters sessionld The session ID of the call audioCodecs The matched audio codecs it s separated by if have more than one codec videoCodecs The matched video codecs it s separated by if have more than one codec existsEarlyMedia If it s true means the call has early media existsAudio If it s true means this call include the audio existsVideo If it s true means this call include the video void onInviteRinging long sessionid statusText char status Text statusCode int statusCode optional If the out going call was ringing this event triggered Parameters sessionld The session ID of the call statusText The status text statusCode The status code void onInviteAnswered long sessionld callerDisplayName char callerDisplayName caller char caller calleeDisplayName char calleeDisplayName callee char callee audioCodecs char audioCodecs videoCodecs char videoCodecs existsAudio BOOL existsAudio existsVideo BOOL existsVideo optional If the remote party wa
21. application can receive the incoming call when it run in background you should call this function in applicationDidEnterBackground Returns If the function succeeds the return value is true If the function fails the return value is false 65 BOOL stopKeepAwake Keep VoIP awake in the background Call this function in applicationWillEnterForeground once your application come back to foreground Returns If the function succeeds the return value is true If the function fails the return value is false 66 Class Documentation PortSIPEventDelegate Protocol Reference PortSIP SDK Callback events Delegate import lt PortSIPEventDelegate h gt Inherits lt NSObject gt Instance Methods void onRegisterSuccess statusCode void onRegisterFailure statusCode void oninvitelncoming callerDisplayName caller calleeDisplayName callee audioCodecs videoCodecs existsAudio ex istsVideo void onInviteTrying void onInviteSessionProgress audioCodecs videoCodecs existsEarlyMedia existsAudio existsVideo void onInviteRinging statusText statusCode void oninviteAnswered callerDisplayName caller calleeDisplayName callee audioCodecs videoCodecs existsAudio e xistsVideo void onInviteFailure reason code void onInviteUpdated audioCodecs videoCodecs existsAudio existsVideo void onInviteConnected void onInviteBeginingForward void onInviteClosed void onRemoteHold
22. contact subject NSString subject Send a SUBSCRIBE message for presence to a contact Parameters contact The target contact it must likes sip contactO01 sip portsip com subject This subject text will be insert into the SUBSCRIBE message For example Hello I m Jason The subject maybe is UTF8 format you should use UTF8 to decode it Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int presenceAcceptSubscribe long subscribeld Accept the presence SUBSCRIBE request which received from contact Parameters subscribeld Subscribe id when received a SUBSCRIBE request from contact the event onPresenceRecvSubscribe will be triggered the event inclues the subscribe id Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int presenceRejectSubscribe long subscribeld Reject a presence SUBSCRIBE request which received from contact Parameters subscribeld Subscribe id when received a SUBSCRIBE request from contact the event onPresenceRecvSubscribe will be triggered the event inclues the subscribe id Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int presenceOnline long subscribeld statusText NSString statusText Send a NOTIFY mes
23. function e width The width of video image 21 height The height of video image data The memory of video stream it s YUV420 format YV12 dataLength The data size Note Don t call any SDK API functions in this event directly If you want to call the API functions or other code which will spend long time you should post a message to another thread and execute SDK API functions or other code in another thread SDK functions Modules Initialize and register functions NIC and local IP functions Audio and video codecs functions Additional setting functions Access SIP message header functions Audio and video functions Call functions Refer functions Send audio and video stream functions RTP packets Audio stream and video stream callback functions Record functions Play audio and video file to remoe functions Conference functions RTP and RTCP QOS functions RTP statistics functions Audio effect functions Send OPTIONS INFO MESSAGE functions Presence functions Keep awake functions Detailed Description SDK functions Initialize and register functions Functions int PortSIPSDK initialize loglevel logPath maxLine agent audioDeviceLayer videoDeviceLayer Initialize the SDK void PortSIPSDK unlnitialize Un initialize the SDK and release resources int PortSIPSDK setUser displayName authName passw
24. number Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int enableReliableProvisional BOOL enable Enable disable PRACK Parameters enable enable Set to true to enable the SDK support PRACK default the PRACK is 30 disabled Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int enable3GppTags BOOL enable Enable disable the 3Gpp tags include ims icsi mmtel and g 3gpp smsip Parameters enable enable Set to true to enable the SDK support 3Gpp tags Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code void enableCallbackSendingSignaling BOOL enable Enable disable callback the sending SIP messages Parameters enable enable Set as true to enable callback the sent SIP messages false to disable Once enabled the onSendingSignaling event will be fired once the SDK sending a SIP message int setSrtpPolicy SRTP POLICY srtpPolicy Set the SRTP policy Parameters srtpPolicy The SRTP policy Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setRtpPortRange int minimumRtpAudioPort maximumRt
25. onSendingRtpPacket callbacks 6 Does the SDK support native 64 bits Yes the SDK support both 32bit and 64 bits Module Index Modules Here is a list of all modules SDK Gall DaCK E EE 8 E 8 Call events RETEREVENtS 15 5 ere i Let EE ena eter ot ee nt elie 12 Signaling eventsz ines nidad da e dra ta en rte des 13 MWI vents 5 OS 14 PIU ITI cH EE 15 INFO OPTIONS message events iie ER SR RENS REP ERE EN UR E ERREUR HEAR ERE RR t 16 Pres nce ENER CDD MESSAGE message events Play audio and video file finished events 19 RTP callback events iia ae ERR eh e eges ama taa 20 Audio and video stream callback events 21 SDKTf hctions A reet ate dete osi et ett Ift rias 22 Initialize and register TO DEED i ote dee ee gehen et bio Ese 22 NIC and local IP functions Audio and video codecs FUNCTIONS eege NEESS de Ee Eaa Fe epa er nae 26 Additional setting functions icere eese eroe eee REPRE RSEN UR EFEFE cbasouaatadat E REA ERU ose PE Peg etos 29 Access SIP me ssage header FUNCTIONS re e he ER tee e eee eee EAE ee dev 35 Audio and video Uncle Call FUNCION SI cirio EET Refer functions oette Send audio and video stream functions RTP packets Audio stream and video stream callback functioOns coccooocnncncnonononnnnnonccnnananonnns 49 Record FUNCTIONS a areri c 51 Play audio and video file to remoe functions esses eene rtr s 52 Conferetice FUNCION cercos eene eege e de
26. return value is O If the function fails the return value is a specific error code int updateCall long sessionld enableAudio BOOL enableAudio enableVideo BOOL enableVideo Use the re INVITE to update the established call 43 Parameters sessionId The session ID of call enableAudio Set to true to allow the audio in update call false for disable audio in update call enableVideo Set to true to allow the video in update call false for disable video in update call Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks Example usage Example 1 A called B with the audio only B answered A there has an audio conversation between A B Now A want to see B video A use these functions to do it myVoIPSdk clearVideoCodec myVoIPSdk addVideoCodec VIDEOCODEC H264 myVoIPSdk updateCall sessionld enableAudio true enableVideo true Example 2 Remove video stream from currently conversation myVoIPSdk updateCall sessionId enableAudio true enableVideo false int hold long sessionId To place a call on hold Parameters sessionld The session ID of call Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int unHold long sessionId Take off hold Parameters sessionld The session ID of call
27. sessionld codecType AUDIOCODEC_TYPE codecType bitrateKbps int bitrateKbps Set the audio bit rate Parameters sessionId The session ID of the call codecType Audio codec type bitrateKbps The video bit rate in KBPS Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setVideoBitrate int bitrateKbps Set the video bit rate Parameters bitrateKbps The video bit rate in KBPS Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setVideoFrameRate int frameRate Set the video frame rate Parameters frameRate The frame rate value minimum is 5 maximum is 30 The bigger value will give you better video quality but require more bandwidth Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks Usually you do not need to call this function set the frame rate the SDK using default frame rate int sendVideo long sessionld sendState BOOL sendState Send the video to remote side Parameters sessionld The session ID of the call sendState Set to true to send the video false to stop send Returns If the function succeeds the return value is O If the function fails the return value is a specific erro
28. side in dialog Parameters sessionld The session ID of the call mimeType The mime type of MESSAGE message subMimeType The sub mime type of MESSAGE message message The contents which send with MESSAGE message allow binary data messageLength The message size Returns If the function succeeds the return value is a message ID allows track the message send state in onSendMessageSuccess and onSendMessageFailure If the function fails the return value is a specific error code less than O Remarks Example 1 send a plain text message Note to send other languages text please use the UTF8 to encode the message before send 62 myVoIPsdk sendMessage sessionId mimeType text subMimeType plain message data messageLength dataLen Example 2 send a binary message myVoIPsdk sendMessage sessionId mimeType application subMimeType vnd 3gpp sms message data messageLength dataLen long sendOutOfDialogMessage NSString to mimeType NSString mimeType subMimeType NSString subMimeType message NSData message messageLength int messageLength Send a out of dialog MESSAGE message to remote side Parameters to The message receiver Likes sip receiver portsip com mimeType The mime type of MESSAGE message subMimeType The sub mime type of MESSAGE message message The contents which send with MESSAGE message allow binary data messageLength The messa
29. speaker it s unavailable for Android and iOS int setLoudspeakerStatus Set the audio device that will use for audio call void getDynamicVolumeLevel microphoneVolume Obtain the dynamic microphone volume level from current call long call sendSdp videoCall Make a call int rejectCall code rejectCall Reject the incoming call int hangUp hangUp Hang up the call int answerCall videoCall 71 answerCall Answer the incoming call int updateCall enableAudio enableVideo Use the re INVITE to update the established call int hold To place a call on hold int unHold Take off hold int muteSession mutelncomingAudio muteOutgoingAudio mutelncomingVideo muteOutgoingVideo Mute the specified session audio or video int forwardCall forwardTo Forward call to another one when received the incoming call int sendDtmf dtmfMethod code dtmfDration playDtmfTone Send DTMF tone int refer referTo Refer the currently call to another one int attendedRefer replaceSessionld referTo Make an attended refer long acceptRefer referSignaling Accept the REFER request a new call will be make if called this function usuall called after onReceivedRefer callback event int rejectRefer Reject the REFER request int enablesendPcmStreamToRemote state streamSamplesPerSec Enable the SDK send PCM stream data to remote s
30. string format Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks Example myVoIPsdk setVideoCodecParameter VIDEOCODEC H264 parameter profile level id 420033 packetization mode 0 Additional setting functions Functions int PortSIPSDK setDisplayName Set user display name int PortSIPSDK getVersion minorVersion Get the current version number of the SDK int PortSIPSDK enableReliableProvisional Enable disable PRACK int PortSIPSDK enable3GppTags Enable disable the 3Gpp tags include ims icsi mmtel and g 3gpp smsip void PortSIPSDK enableCallbackSendingSignaling Enable disable callback the sending SIP messages int PortSIPSDK setSrtpPolicy Set the SRTP policy int PortSIPSDK setRtpPortRange maximumRtpAudioPort minimumRtpVideoPort maximumRtpVideoPort Set the RTP ports range for audio and video streaming int PortSIPSDK setRtcpPortRange maximumRtcpAudioPort minimumRtcpVideoPort maximumRtcpVideoPort Set the RTCP ports range for audio and video streaming int PortSIPSDK enableCallForward forwardTo Enable call forward int PortSIPSDK disableCallForward Disable the call forward the SDK is not forward any incoming call after this function is called int PortSIPSDK enableSessionTimer refreshMode Allows t
31. the RTP statisics of audio channel int getAudioRtcpStatistics bytesSent packetsSent bytesReceived packetsReceived sendFractionLost sendCumulati veLost recvFractionLost recvCumulativeLost Obtain the RTCP statisics of audio channel int getVideoRtpStatistics bytesSent packetsSent bytesReceived packetsReceived Obtain the RTP statisics of video void enableVAD Enable disable Voice Activity Detection VAD void enableAEC Enable disable AEC Acoustic Echo Cancellation void enableCNG 73 Enable disable Comfort Noise Generator CNG void enableAGC Enable disable Automatic Gain Control AGC void enableANS Enable disable Audio Noise Suppression ANS int sendOptions sdp Send OPTIONS message int sendlnfo mimeType subMimeType infoContents Send a INFO message to remote side in dialog long sendMessage mimeType subMimeType message messageLength Send a MESSAGE message to remote side in dialog long sendOutOfDialogMessage mimeType subMimeType message messagelength Send a out of dialog MESSAGE message to remote side int presenceSubscribeContact subject Send a SUBSCRIBE message for presence to a contact int presenceAcceptSubscribe Accept the presence SUBSCRIBE request which received from contact int presenceRejectSubscribe Reject a presence SUBSCRIBE request which received from contact
32. triggered once received a RTP packet Parameters sessionId The session ID of the call isAudio If the received RTP packet is of audio this parameter is true otherwise false RTPPacket The memory of whole RTP packet packetSize The size of received RTP Packet Note Don t call any SDK API functions in this event directly If you want to call the API functions or other code which will spend long time you should post a message to another thread and execute SDK API functions or other code in another thread void onSendingRTPPacket long sessionid isAudio BOOL isAudio RTPPacket unsigned char RTPPacket packetSize int packetSize If called setRTPCallback function to enabled the RTP callback this event will be triggered once sending a RTP packet Parameters sessionId The session ID of the call isAudio If the received RTP packet is of audio this parameter is true otherwise false RTPPacket The memory of whole RTP packet packetSize The size of received RTP Packet 20 Note Don t call any SDK API functions in this event directly If you want to call the API functions or other code which will spend long time you should post a message to another thread and execute SDK API functions or other code in another thread Audio and video stream callback events Functions void lt PortSIPEventDelegate gt onAudioRawCallback audioCallbackMode data dataLength samplingF
33. 00 OK message as ptime and maxptime attribute 34 int addSupportedMimeType NSString methodName mimeType NSString mimeType subMimeType NSString subMimeType Set the SDK receive the SIP message that include special mime type Parameters methodName Method name of the SIP message likes INVITE OPTION INFO MESSAGE UPDATE ACK etc More details please read the RFC3261 mimeType The mime type of SIP message subMimeType The sub mime type of SIP message Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks Default the PortSIP VolP SDK support these media types mime types that in the below incoming SIP messages message sipfrag in NOTIFY message application simple message summary in NOTIFY message text plain in MESSAGE message application dtmf relay in INFO message application media control xml in INFO message The SDK allows received SIP message that included above mime types Now if remote side send a INFO SIP message this message Content Type header value is text plain the SDK will reject this INFO message because text plain of INFO message does not included in the default support list Then how to let the SDK receive the SIP INFO message that included text plain mime type We should use addSupportedMimyType to do it myVoIPSdk addSupportedMimeType INFO mimeType text subMimeType plai
34. 40 sendVideoStreamToRemote data width height Send audio and video stream functions 50 82 setAudioBitrate codecType bitrateKbps Audio and video functions 40 setAudioCodecParameter parameter Audio and video codecs functions 29 setAudioCodecPayloadType payloadType Audio and video codecs functions 29 setAudioQos DSCPValue priority RTP and RTCP QOS functions 58 setAudioRtcpBandwidth BitsRR BitsRS KBitsAS RTP and RTCP QOS functions 57 setAudioSamples maxPtime Additional setting functions 35 setConferenceVideoWindow Conference functions 56 setDisplayName Additional setting functions 31 setDoNotDisturb Additional setting functions 34 setKeepAliveTime Additional setting functions 35 setLicenseKey Initialize and register functions 26 setLocalVideoWindow Audio and video functions 41 setLoudspeakerStatus Audio and video functions 42 setRemoteVideoWindow remoteVideoWindow Audio and video functions 41 setRtcpPortRange maximumRtcpAudioPort minimu mRtcpVideoPort maximumRtcpVideoPort Additional setting functions 33 setRtpCallback RTP packets Audio stream and video stream callback functions 51 setRtpKeepAlive keepAlivePayloadType deltaTransm itTimeMS Additional setting functions 35 setRtpPortRange maximumRtpAudioPort minimumR tpVideoPort maximumRtpVideoPort Additional setting functions 32 setSrtpPolicy Additional setting functions 32 setUser displayName authName password locallP lo
35. BitsRS KBitsAS Set the audio RTCP bandwidth parameters as the RFC3556 int PortSIPSDK setVideoRtcpBandwidth BitsRR BitsRS KBitsAS Set the video RTCP bandwidth parameters as the RFC3556 int PortSIPSDK setAudioQos DSCPValue priority Set the DSCP differentiated services code point value of QoS Quality of Service for audio channel int PortSIPSDK setVideoQos DSCPValue Set the DSCP differentiated services code point value of QoS Quality of Service for video channel Detailed Description Function Documentation int setAudioRtcpBandwidth long sessionld BitsRR int BitsRR BitsRS int KBitsAS int KBitsAS Set the audio RTCP bandwidth parameters as the RFC3556 BitsRS Parameters sessionld The session ID of call conversation BitsRR The bits for the RR parameter BitsRS The bits for the RS parameter KBitsAS The Kbits for the AS parameter Returns If the function succeeds the return value is O If the function fails the return value is a specific error code 56 int setVideoRtcpBandwidth long sessionld BitsRR int BitsRR BitsRS int BitsRS KBitsAS int KBitsAS Set the video RTCP bandwidth parameters as the RFC3556 Parameters sessionId The session ID of call conversation BitsRR The bits for the RR parameter BitsRS The bits for the RS parameter KBitsAS The Kbits for the AS parameter Returns I
36. CheckMwi 34 enableReliableProvisional 31 enableSessionTimer refreshMode 34 getVersion minorVersion 31 setAudioSamples maxPtime 35 setDisplayName 31 setDoNotDisturb 34 setKeepAliveTime 35 setRtcpPortRange maximumRtcpAudioPort mini mumhRtcpVideoPort maximumRtcpVideoPort 33 setRtpKeepAlive keepAlivePayloadType deltaTr ansmitTimeMS 35 setRtpPortRange maximumRtpAudioPort minim umRtpVideoPort maximumRtpVideoPort 32 setSrtpPolicy 32 addSupportedMimeType mimeType subMimeType Additional setting functions 36 addVideoCodec Audio and video codecs functions 28 answerCall videoCall Call functions 44 attendedRefer replaceSessionld referTo Refer functions 48 Audio and video codecs functions 27 addAudioCodec 28 addVideoCodec 28 isAudioCodecEmpty 28 isVideoCodecEmpty 28 setAudioCodecParameter parameter 29 setAudioCodecPayloadType payloadType 29 setVideoCodecParameter parameter 29 setVideoCodecPayloadType payloadType 29 Audio and video functions 38 displayLocalVideo 41 getDynamicVolumeLevel microphoneVolume 42 muteMicrophone 42 muteSpeaker 42 sendVideo sendState 40 setAudioBitrate codecType bitrateKbps 40 setLocalVideoWindow 41 setLoudspeakerStatus 42 setRemoteVideoWindow remoteVideoWindow 41 setVideoBitrate 40 setVideoDeviceld 39 setVideoFrameRate 40 setVideoNackStatus 41 setVideoOrientation 41 setVideoResolution 39 Audio and video stream callback events 22 onA
37. DA WMO SN SER end 7 Initialize sdk Example MEPOrtSLPSDK Eor ESI PSDR alloc anit mPortSIPSDK delegate self 8 More details please read the Sample project source code 4 How to test the P2P call without SIP server 1 Download and extract the SDK sample project zip file compile and run the P2PSample project 2 Run the P2Psample on two devices for example run it on device A and device B A IP address is 192 1681 1 0 BEST PEcdd5essse sm iS do dla 3 Click the Initialize button on A and B If the default port 5060 in using the P2PSample will said Initialize failure In case please click the Uninitialize button and change the local port click the Initialize button again 4 The log box will appears Initialized if the SDK initialize succeeded 5 MakeNcall trom A CO B Enter eip 222002 les nl ll and cbe ke E EEN eene A enter sip Lle loo 168 1 10 Note If changed the local sip port to other port for example the A using local port 5080 and the B using local port 6021 make call from A to B enter sip 222 192 168 1 11 6021 and dial Make call sola cA enter eip MIO MERGE NEIN S508 5 Does the SDK is thread safe Yes the SDK is thread safe you can call all the API functions don t need to consider the multiple threads Note the SDK allows call API functions in callback events directly except the onAudioRawCallback onVideoRawCallback onReceivedRtpPacket
38. E E EEE E ET 52 Conference Tee EE RTP and RTCP QOS functions RTP statistics functions Audio effect functions esses Send OPTIONS INFO MESSAGE functions Presence f nctiors sees uenerit ree eere re e eve o e wa dae eh ee ea ence Coes ee v E Ce e ue a e e V va eds EES aert DE RIED ere ee Bee Class DOCUMENTATION e deeg lactante ted e HAE Ee ERO e ERR AER Ree PortSIPEventDelegate ir ec reete e eee Ye eo Eu Ced e yere e EE eegen LORE SID A E A A R Welcome to the PortSIP VoIP SDK Create your SIP based application for multiple platforms iOS Android Windows Mac OS Linux base on our SDK The award winning PortSIP VoIP SDK is a powerful and highly versatile set of tools to dramatically accelerate SIP application development It includes a suite of stacks SDKs Sample projects Each one enables developers to combine all the necessary components to create an ideal development environment for every application s specific needs The PortSIP VoIP SDK complies with IETF and 3GPP standards and is IMS compliant 3GPP 3GPP2 TISPAN and PacketCable 2 0 These high performance SDKs provide unified API layers for full user control and flexibility Changes in this release This release is a major upgrade see Release Notes for more information Getting Started You can download the PortSIP VoIP SDK Sample projects at our Website the samples include for VC CH VB NET Delphi XE XCode for OS and Mac
39. P messages audioDeviceLayer Specifies which audio device layer should be using O Use the OS default device 1 Virtual device Virtual device usually use this for the device which no sound device installed videoDeviceLayer Specifies which video device layer should be using O Use the OS default device 1 Use Virtual device usually use this for the device which no camera installed Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setUser NSString userName displayName NSString displayName authName NSString authName password NSString password locallP NSString J ocallP localSIPPort int localSIPPort userDomain NSString userDomain SIPServer NSString 23 sipServer SIPServerPort int sipServerPort STUNServer NSString stun Server STUNServerPort int stunServerPort outboundServer NSString outboundServer outboundServerPort int outboundServerPort Set user account info Parameters userName Account User name of the SIP usually provided by an IP Telephony service provider displayName The display name of user you can set it as your like such as James Kend It s optional authName Authorization user name usually equals the username password The password of user it s optional locallP The local computer IP address to bind for example 192
40. PSDK getNICNums Get the Network Interface Card numbers NSString PortSIPSDK getLocallpAddress Get the local IP address by Network Interface Card index Detailed Description 25 Function Documentation int getNICNums Get the Network Interface Card numbers Returns If the function succeeds the return value is NIC numbers gt O If the function fails the return value is a specific error code NSString getLocallpAddress int index Get the local IP address by Network Interface Card index Parameters index The IP address index for example the PC has two NICs we want to obtain the second NIC IP then set this parameter 1 The first NIC IP index is O Returns The buffer that to receives the IP Audio and video codecs functions Functions int PortSIPSDK addAudioCodec Enable an audio codec it will be appears in SDP int PortSIPSDK addVideoCodec Enable a video codec it will be appears in SDP BOOL PortSIPSDK isAudioCodecEmpty Detect enabled audio codecs is empty or not BOOL PortSIPSDK isVideoCodecEmpty Detect enabled video codecs is empty or not int PortSIPSDK setAudioCodecPayloadType payloadType Set the RTP payload type for dynamic audio codec int PortSIPSDK setVideoCodecPayloadType payloadType Set the RTP payload type for dynamic Video codec O void PortSIPSDK clearAudioCodec
41. PortSIP VoIP SDK Manual for iOS Version 11 2 2 9 28 15 Table of Contents Welcome tothe PortSIP VOIP SDK iia ENEE EEN ENEE EE ENEE dE 2 Module Index RT anecdota AAA EENS dE 5 E NO 6 RAE 7 Module Documentation 5 reete Rete a e le cere ere Se Pee deest ESA tesa e aras Me ERRe ea aa 8 SDK Callback Events 25e nhe ir he ee tru n aute iue dla TES S 8 REBISTEROVEMES itis A ee EES eege Ee Ee A EE 8 Call OVE Tits mE 9 R fer events iun ce verde SE ERE AT Ree NY ERR ERE YN e A Eed Signaling events MWI events DTMF events eseese INFO OPTIONS message events ARA EE MESSAGE message eVents ees eee cede eet epus a ee e ea AER EA enee Play audio and video file finished events 19 RIP CallbaGk EE 20 Audio and video stream callback events 21 SDK FUNCIONS Me MIEL Initialize and register funcio erase leg let Bee RI An Leg EE Audio and video codecs FUNCTIONS ccceessssccecececeesesaececececseseaaeeeceeeceeseseeaeceesceseesseaeseeececeesssaesessesesessaaeaeeeeseeee Additional setting functions Access SIP message header functions a A RT Call dun o ebe EES aio redada be RETENCIONES E Ee Send audio and video stream FUNCTIONS c ccccccccceessssscecececeesesaeeececsceeseeaeaeceesceseeseeaeseeececeeseeaeseeecsceeseaaeaeeeeseeeea 48 RTP packets Audio stream and video stream callback FUNCTIONS nennen 49 R cord function EE 51 Play audio and video file to remoe functions aens aeea Eer E EE EEE
42. PresenceOnline char fromDisplayName from char from stateText char stateText When the contact is online or changed presence status this event will be triggered Parameters fromDisplayName The display name of contact from The contact who send the SUBSCRIBE request stateText The presence status text void onPresenceOffline char fromDisplayName from char from When the contact is went offline then this event will be triggered Parameters fromDisplayName The display name of contact from The contact who send the SUBSCRIBE request MESSAGE message events Functions void lt PortS PEventDelegate gt onRecvMessage mimeType subMimeType messageData messageDataLength O void PortSIPEventDelegate onRecvOutOfDialogMessage from toDisplayName to mimeType subMimeType mess ageData messageDataLength void PortSIPEventDelegate onSendMessageSuccess messageld void lt PortSIPEventDelegate gt onSendMessageFailure messageld reason code void PortSIPEventDelegate onSendOutOfDialogMessageSuccess fromDisplayName from toDisplayName to void PortSIPEventDelegate onSendOutOfDialogMessageFailure fromDisplayName from toDisplayName to reaso n code Detailed Description 17 Function Documentation void onRecvMessage long sessionld mimeType char mimeType subMimeType char
43. ads video blindtransfer rar use the Windows Media Player to play the AVI file after extracted it will shows how to do the transfer long acceptRefer long referld referSignaling NSString referSignaling Accept the REFER request a new call will be make if called this function usuall called after onReceivedRefer callback event Parameters referld The ID of REFER request that comes from onReceivedRefer callback event referSignaling The SIP message of REFER request that comes from onReceivedRefer callback event Returns If the function succeeds the return value is a session ID greater than O to the new call for REFER otherwise is a specific error code less than 0 int rejectRefer long referld Reject the REFER request Parameters referld The ID of REFER request that comes from onReceivedRefer callback event Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code 47 Send audio and video stream functions Functions int PortSIPSDK enableSendPcmStreamToRemote state streamSamplesPerSec Enable the SDK send PCM stream data to remote side from another source to instread of microphone int PortSIPSDK sendPcmStreamToRemote data Send the audio stream in PCM format from another source to instead of audio device capture microphone int PortSIPSDK enableSendVideoStreamToRemote st
44. age int PortSIPSDK displayLocalVideo Start stop to display the local video image int PortSIPSDK setVideoNackStatus Enable disable the NACK feature RFC4585 which help to improve the video quatliy void PortSIPSDK muteMicrophone Mute the device microphone it s unavailable for Android and iOS void PortSIPSDK muteSpeaker Mute the device speaker it s unavailable for Android and iOS int PortSIPSDK setLoudspeakerStatus Set the audio device that will use for audio call void PortSIPSDK getDynamicVolumeLevel microphoneVolume Obtain the dynamic microphone volume level from current call Detailed Description Function Documentation int setVideoDeviceld int deviceld Set the video device that will use for video call Parameters deviceld Device ID index for video device camera Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setVideoResolution VIDEO RESOLUTION resolution Set the video capture resolution Parameters resolution Video resolution defined in PortSIPType file Note Some cameras don t support SVGA and XVGA 720P please read your camera manual Returns If the function succeeds the return value is O If the function fails the return value is a specific error code 38 int setAudioBitrate long
45. ageCount Old message count void onWaitingFaxMessage char messageAccount urgentNewMessageCount int urgentNewMessageCount urgentOldMessageCount int urgentOldMessageCount newMessageCount int newMessageCount oldMessageCount int oldMessageCount If has the waiting fax message MWlI then this event will be triggered Parameters messageAccount Fax message account urgentNewMessag Urgent new message count eCount 14 urgentOldMessage Urgent old message count Count newMessageCount New message count oldMessageCount Old message count DTMF events Functions void PortSIPEventDelegate onRecvDtmfTone tone Detailed Description Function Documentation void onRecvDtmfTone long sessionld tone int tone This event will be triggered when received a DTMF tone from remote side Parameters sessionld The session ID of the call tone Dtmf tone o o o D Description The DTMF tone O The DTMF tone 1 The DTMF tone 2 The DTMF tone 3 The DTMF tone 4 The DTMF tone 5 The DTMF tone 6 The DTMF tone 7 The DTMF tone 8 o Oo U1 3 CON El ten The DTMF tone 9 KA o The DTMF tone Eb LA The DTMF tone t LA N The DTMF tone A e LA The DTMF tone B KA AB The DTMF tone C LA Ui The DTMF tone
46. alled this function usuall called after onReceivedRefer callback event int PortSIPSDK rejectRefer Reject the REFER request Detailed Description Function Documentation int refer long sessionld referTo NSString referTo Refer the currently call to another one Parameters sessionld The session ID of the call referTo Target of the refer it can be sip number sipserver com or number only 46 Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks myVoIPSdk refer sessionId referTo sip testuserl2 sip portsip com You can download the demo AVI at http www portsip com downloads video blindtransfer rar use the Windows Media Player to play the AVI file after extracted it will shows how to do the transfer int attendedRefer long sessionld replaceSessionld long replaceSessionld referTo NSString referTo Make an attended refer Parameters sessionId The session ID of the call replaceSessionld Session ID of the replace call referTo Target of the refer it can be sip number sipserver com or number only Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks Please read the sample project source code to got more details Or download the demo AVI at http www portsip com downlo
47. alog long PortSIPSDK sendMessage mimeType subMimeType message messageLength Send a MESSAGE message to remote side in dialog long PortSIPSDK sendOutOfDialogMessage mimeType subMimeType message messageLength Send a out of dialog MESSAGE message to remote side Detailed Description 61 Function Documentation int sendOptions NSString to sdp NSString sdp Send OPTIONS message Parameters to The receiver of OPTIONS message sdp The SDP of OPTIONS message it s optional if don t want send the SDP with OPTIONS message Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int sendInfo long sessionld mimeType NSString mimeType subMimeType NSString subMimeType infoContents NSString infoContents Send a INFO message to remote side in dialog Parameters sessionld The session ID of call mimeType The mime type of INFO message subMimeType The sub mime type of INFO message infoContents The contents that send with INFO message Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code long sendMessage long sessionld mimeType NSString mimeType subMimeType NSString subMimeType message NSData message messageLength int messageLength Send a MESSAGE message to remote
48. arks Usually set a timer to call this function to refresh the volume level indicator 41 Call functions sendSdp videoCall int PortSIPSDK answerCall videoCall int PortSIPSDK updateCall enableAudio enableVideo Use the re INVITE to update the established call PortSIPSDK muteSession mutelncomingAudio muteOutgoingAudio mutelncomingVideo muteOutgoingVideo Mute the specified session audio or video int PortSIPSDK forwardCall forwardTo one when received the incoming call Functions long PortSIPSDK call Make a call int PortSIPSDK rejectCall code rejectCall Reject the incoming call int PortSIPSDK hangUp hangUp Hang up the call e answerCall Answer the incoming call e int PortSIPSDK hold To place a call on hold int PortSIPSDK unHold Take off hold int e Forward call to another e int PortSIPSDK sendDtmf dtmfMethod code dtmfDration playDtmfTone Send DTMF tone Detailed Description Function Documentation long call NSString callee sendSdp BOOL sendSdp videoCall BOOL videoCall Make a call Parameters callee The callee it can be name only or full SIP URI for example user001 or sip user001 sip iptel org or sip user002 9 sip yourdomain com 5068 sendSdp If set to false then the outgoing call doesn t include the SDP in INVITE message videoCall If set the true and
49. at least one video codec was added then the outgoing call 42 include the video codec into SDP Returns If the function succeeds the return value is the session ID of the call greater than 0 If the function fails the return value is a specific error code Note the function success just means the outgoing call is processing you need to detect the call final state in onInviteTrying onInviteRinging onInviteFailure callback events int rejectCall long sessionld code int code rejectCall Reject the incoming call Parameters sessionld The sessionld of the call code Reject code for example 486 480 etc Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int hangUp long sessionld hangUp Hang up the call Parameters sessionld Session ID of the call Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int answerCall long sessionld videoCall BOOL videoCall answerCall Answer the incoming call Parameters sessionld The session ID of call videoCall If the incoming call is a video call and the video codec is matched set to true to answer the video call If set to false the answer call doesn t include video codec answer anyway Returns If the function succeeds the
50. ate Enable the SDK send video stream data to remote side from another source to instead of camera int PortSIPSDK sendVideoStreamToRemote data width height Send the video stream to remote Detailed Description Function Documentation int enableSendPcmStreamToRemote long sessionld state BOOL state streamSamplesPerSec int streamSamplesPerSec Enable the SDK send PCM stream data to remote side from another source to instread of microphone Parameters sessionld The session ID of call state Set to true to enable the send stream false to disable streamSamplesPer The PCM stream data sample in seconds for example 8000 or 16000 Sec Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks MUST called this function first if want to send the PCM stream data to another side int sendPcmStreamToRemote long sessionld data NSData data Send the audio stream in PCM format from another source to instead of audio device capture microphone Parameters sessionld Session ID of the call conversation data The PCM audio stream data must is 16bit mono 48 Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks Usually we should use it like below myVoIPSdk enableSendPcmStreamToRemote sessionId s
51. atus of a SIP session Without this keepalive mechanism proxies that remember incoming and outgoing requests stateful proxies may continue to retain call state needlessly If a UA fails to send a BYE message at the end of a session or if the BYE message is lost because of network problems a stateful proxy does not know that the session has ended The re INVITES ensure that active sessions stay active and completed sessions are terminated int disableSessionTimer Disable the session timer Returns If the function succeeds the return value is O If the function fails the return value is a specific error code void setDoNotDisturb BOOL state Enable the Do not disturb to enable disable Parameters state If set to true the SDK reject all incoming calls anyway int detectMwi Use to obtain the MWI status Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int enableCheckMwi BOOL state Allows enable disable the check MWI Message Waiting Indication 33 Parameters state If set as true will check MWI automatically once successfully registered to a SIP proxy server Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setRtpKeepAlive BOOL state keepAlivePayloadType int keepAlivePayloadType deltaTransmitTim
52. calSIPPort userDomain SIPServer SIPServerPort STU NServer STUNServerPort outboundServer outbound ServerPort Initialize and register functions 24 setVideoBitrate Audio and video functions 40 setVideoCodecParameter parameter Audio and video codecs functions 29 setVideoCodecPayloadType payloadType Audio and video codecs functions 29 setVideoDeviceld Audio and video functions 39 setVideoFrameRate Audio and video functions 40 setVideoNackStatus Audio and video functions 41 setVideoOrientation Audio and video functions 41 setVideoQos DSCPValue RTP and RTCP QOS functions 58 setVideoResolution Audio and video functions 39 setVideoRtcpBandwidth BitsRR BitsRS KBitsAS RTP and RTCP QOS functions 58 Signaling events 14 onReceivedSignaling message 14 onSendingSignaling message 15 startKeepAwake Keep awake functions 66 startRecord recordFilePath recordFileName appendT imeStamp audioFileFormat audioRecordMode aviFil eCodecType videoRecordMode Record functions 52 stopKeepAwake Keep awake functions 67 stopPlayAudioFileToRemote Play audio and video file to remoe functions 55 stopPlayAudioFileToRemoteAsBackground Play audio and video file to remoe functions 55 stopPlayVideoFileToRemote Play audio and video file to remoe functions 54 stopRecord Record functions 53 unHold Call functions 45 unRegisterServer Initialize and register functions 26 updateCall enableAudio enableVideo Call f
53. ce Activity Detection VAD void PortSIPSDK enableAEC Enable disable AEC Acoustic Echo Cancellation void PortSIPSDK enableCNG Enable disable Comfort Noise Generator CNG void PortSIPSDK enableAGC Enable disable Automatic Gain Control AGC void PortSIPSDK enableANS Enable disable Audio Noise Suppression ANS Detailed Description Function Documentation void enableVAD BOOL state Enable disable Voice Activity Detection VAD Parameters state Set to true to enable VAD false to disable void enableAEC EC_MODES state Enable disable AEC Acoustic Echo Cancellation 60 Parameters state AEC type default is EC_NONE void enableCNG BOOL state Enable disable Comfort Noise Generator CNG Parameters state state Set to true to enable CNG false to disable void enableAGC AGC_MODES state Enable disable Automatic Gain Control AGC Parameters state AGC type default is AGC_NONE void enableANS NS_MODES state Enable disable Audio Noise Suppression ANS Parameters state NS type default is NS_NONE Send OPTIONS INFO MESSAGE functions Functions int PortSIPSDK sendOptions sdp Send OPTIONS message int PortSIPSDK sendlnfo mimeType subMimeType infoContents Send a INFO message to remote side in di
54. ce ta Lus dde dread e OR dee eevee 54 REI RTCP QOS nee LEE 56 RIP Statistics UC NA Be ecco ire de E inue 58 Audio effect functions meieri oiriin ener rie ee nana e range decas ruga eee ana a ga ema er ge eee e died 60 Send OPTIONS INFO MESSAGE functions cccccceessscecsessececeseeeceesaececeessececsseeceeaaeeecsesseeeeseeeeees 61 Presence le 63 Keep awake TUCU ONS ics iin t a a eo donna E ir e tei e muto oi 65 Hierarchical Index Class Hierarchy This inheritance list is sorted roughly but not completely alphabetically lt NSObject gt lt PortSIPEventDelegate gt PortSIPSDK UlView Eeiegch Ia Te Te Oe DEE 76 Class Index Class List Here are the classes structs unions and interfaces with brief descriptions lt PortSIPEventDelegate gt PortSIP SDK Callback events Delegate seen PortSIPSDK PortSIP VoIP SDK functions dass PortSIPVideoRenderView PortSIP VoIP SDK Video Render View class sees Module Documentation SDK Callback events O o E o o Register events Call events Refer events Signaling events MWI events DTMF events INFO OPTIONS message events Presence events MESSAGE message events Play audio and video file finished events RTP callback events Audio and video stream callback events Detailed Description SDK Callback events Register events Functions void PortSIPEventDelegate
55. cense key must called before setUser function int getNICNums Get the Network Interface Card numbers NSString getLocallpAddress Get the local IP address by Network Interface Card index int addAudioCodec Enable an audio codec it will be appears in SDP int addVideoCodec Enable a video codec it will be appears in SDP BOOL isAudioCodecEmpty Detect enabled audio codecs is empty or not BOOL isVideoCodecEmpty Detect enabled video codecs is empty or not int setAudioCodecPayloadType payloadType Set the RTP payload type for dynamic audio codec int setVideoCodecPayloadType payloadType Set the RTP payload type for dynamic Video codec void clearAudioCodec Remove all enabled audio codecs void clearVideoCodec Remove all enabled video codecs int setAudioCodecParameter parameter 69 Set the codec parameter for audio codec int setVideoCodecParameter parameter Set the codec parameter for video codec int setDisplayName Set user display name int getVersion minorVersion Get the current version number of the SDK int enableReliableProvisional Enable disable PRACK int enable3GppTags Enable disable the 3Gpp tags include ims icsi mmtel and g 3gpp smsip void enableCallbackSendingSignaling Enable disable callback the sending SIP messages int setSrtpPolicy Set the SRTP policy int s
56. ch help to improve the video quatliy 40 Parameters state state Set to true to enable Returns If the function succeeds the return value is O If the function fails the return value is a specific error code void muteMicrophone BOOL mute Mute the device microphone it s unavailable for Android and iOS Parameters mute If the value is set to true the microphone is muted set to false to un mute it void muteSpeaker BOOL mute Mute the device speaker it s unavailable for Android and iOS Parameters mute If the value is set to true the speaker is muted set to false to un mute it int setLoudspeakerStatus BOOL enable Set the audio device that will use for audio call Parameters enable Set to true the SDK use loudspeaker for audio call this just available for mobile platform only Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks Just allow switch between earphone and Loudspeaker void getDynamicVolumeLevel int speakerVolume microphoneVolume int microphoneVolume Obtain the dynamic microphone volume level from current call Parameters speakerVolume Return the dynamic speaker volume by this parameter the range is O 9 microphoneVolum Return the dynamic microphone volume by this parameter the range is O 9 e Rem
57. ch using to display the conference video indow videoResolution The conference video resolution displayLocalVideol Display the local video on video window or not nConference Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setConferenceVideoWindow PortSIPVideoRenderView conferenceVideoWindow Set the window for a conference that using to display the received remote video image Parameters conferenceVideoW The PortSIPVideoRenderView which using to display the conference video indow Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int joinToConference long sessionid Join a session into exist conference if the call is in hold please un hold first Parameters sessionld Session ID of the call Returns If the function succeeds the return value is O If the function fails the return value is a specific error code 55 int removeFromConference long sessionld Remove a session from an exist conference Parameters sessionld Session ID of the call Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code RTP and RTCP QOS functions Functions int PortSIPSDK setAudioRtcpBandwidth BitsRR
58. dioDevic eLayer videoDeviceLayer Initialize and register functions 24 isAudioCodecEmpty Audio and video codecs functions 28 isVideoCodecEmpty Audio and video codecs functions 28 joinToConference Conference functions 56 Keep awake functions 66 startKeepAwake 66 stopKeepAwake 67 MESSAGE message events 18 onRecvMessage mimeType subMimeType mess ageData messageDataLength 19 onRecvOutOfDialogMessage from toDisplayNa me to mimeType subMimeType messageData messageDataLength 19 onSendMessageFailure messageld reason code 19 onSendMessageSuccess messageld 19 onSendOutOfDialogMessageFailure fromDispla yName from toDisplayName to reason code 20 onSendOutOfDialogMessageSuccess fromDispla yName from toDisplayName to 20 modifyHeaderValue headerValue Access SIP message header functions 38 muteMicrophone Audio and video functions 42 muteSession mutelncomingAudio muteOutgoingAud io mutelncomingVideo muteOutgoingVideo Call functions 45 muteSpeaker Audio and video functions 42 MWI events 15 onWaitingFaxMessage urgentNewMessageCou nt urgentOldMessageCount newMessageCount oldMessageCount 15 onWaitingVoiceMessage urgentNewMessageCo unt urgentOldMessageCount newMessageCoun t oldMessageCount 15 NIC and local IP functions 26 getLocallpAddress 27 getNICNums 27 onACTVTransferFailure reason code Refer events 14 onACTVTransferSuccess Refer events 14 onAudioRawCallback audioCallbackMode data dataL en
59. e devices must be running iOS7 or higher We strongly recommend that you test your applications on actual devices to ensure that they work as expected and perform well Testing on the simulator alone does not provide a good measure of how the application will perform on the physical device Frequently Asked Questions 1 Where can download the PortSIP VoIP SDK for test All sample projects of the PortSIP VoIP SDK can be download to test at http www PortSIP com downloads html http www PortSIP com voipsdk html 2 How to compile the sample project Download the sample projects from PortSIP website Extract the zip file Open the project by your xcode Compile the sample project directly the trial version SDK allows 2 3 minutes conversation 4A YN FA 3 Create a new project base on PortSIP VolP SDK 1 Download the Sample project and evaluation SDK and extract it to a directory Run the Xcode and create a new iOS Project Drag and drop PortSIPLib framework from Finder to XCode gt Frameworks Add depend Frameworks Build Phases gt Link Binary With Libraries add libstdc 6 tbd libresolv tbd VideoToolbox framework 5 Add the code in h file to import the SDK example import lt PortSIPLib PortSIPSDK h gt 2 3 4 6 Inherit the interface PortSIPEventDelegate to process the callback events Example interface AppDelegate UlResponder lt UIApplicationDelegate PortSIPEventDelegate gt POKES I
60. e function succeeds the return value is 0 If the function fails the return value is a specific error code int stopPlayAudioFileToRemoteAsBackground long sessionld Stop play an wave file to remote party as conversation background sound Parameters sessionld Session ID of the call Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Conference functions Functions int PortSIPSDK createConference videoResolution displayLocalVideo Create a conference It s failures if the exists conference isn t destroy yet void PortSIPSDK destroyConference Destroy the exist conference int PortSIPSDK setConferenceVideoWindow Set the window for a conference that using to display the received remote video image int PortSIPSDK joinToConference Join a session into exist conference if the call is in hold please un hold first 54 int PortSIPSDK removeFromConference Remove a session from an exist conference Detailed Description Function Documentation int createConference PortSIPVideoRenderView conferenceVideoWindow videoResolution VIDEO RESOLUTION videoResolution displayLocalVideo BOOL displayLocalVideolnConference Create a conference It s failures if the exists conference isn t destroy yet Parameters conferenceVideoW The PortSIPVideoRenderView whi
61. eMS int deltaTransmitTimeMS Enable or disable send RTP keep alive packet during the call is established Parameters state Set to true allow send the keep alive packet during the conversation keepAlivePayloadT The payload type of the keep alive RTP packet usually set to 126 ype deltaTransmitTime The keep alive RTP packet send interval in millisecond usually recommend MS 15000 300000 Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setKeepAliveTime int keepAliveTime Enable or disable send SIP keep alive packet Parameters keepAliveTime This is the SIP keep alive time interval in seconds set to O to disable the SIP keep alive it s in seconds recommend 30 or 50 Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setAudioSamples int ptime maxPtime int maxPtime Set the audio capture sample Parameters ptime It s should be a multiple of 10 and between 10 60 included 10 and 60 maxPtime For the maxptime attribute should be a multiple of 10 and between 10 60 included 10 and 60 Can t less than ptime Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks which will be appears in the SDP of INVITE and 2
62. eaderValue 70 Add the extension header custom header into every outgoing SIP message int clearAddExtensionHeaders Clear the added extension headers custom headers int modifyHeaderValue headerValue Modify the special SIP header value for every outgoing SIP message int clearModifyHeaders Clear the modify headers value no longer modify every outgoing SIP message header values int setVideoDeviceld Set the video device that will use for video call int setVideoResolution Set the video capture resolution int setAudioBitrate codecType bitrateKbps Set the audio bit rate int setVideoBitrate Set the video bit rate int setVideoFrameRate Set the video frame rate int sendVideo sendState Send the video to remote side int setVideoOrientation Changing the orientation of the video void setLocalVideoWindow Set the the window that using to display the local video image int setRemoteVideoWindow remoteVideoWindow Set the window for a session that using to display the received remote video image int displayLocalVideo Start stop to display the local video image int setVideoNackStatus Enable disable the NACK feature RFC4585 which help to improve the video quatliy void muteMicrophone Mute the device microphone it s unavailable for Android and iOS void muteSpeaker Mute the device
63. efresh the registration set to lt O the retry will be disabled and onRegisterFailure callback triggered when retry failure Returns If the function succeeds the return value is O If the function fails the return value is a specific error code if register to server succeeded then onRegisterSuccess will be triggered otherwise onRegisterFailure triggered 24 int refreshRegisterServer int expires Request a manual refresh of the registration Parameters expires Registration refresh Interval in seconds maximum is 3600 it will be inserted into SIP REGISTER message headers If O then default to using original Returns If the function succeeds the return value is O If the function fails the return value is a specific error code if register to server succeeded then onRegisterSuccess will be triggered otherwise onRegisterFailure triggered int unRegisterServer Un register from the SIP proxy server Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setLicenseKey NSString key Set the license key must called before setUser function Parameters key The SDK license key please purchase from PortSIP Returns If the function succeeds the return value is O If the function fails the return value is a specific error code NIC and local IP functions Functions int PortSI
64. ence functions 55 createConference videoResolution displayLocal Video 56 joinToConference 56 removeFromConference 57 setConferenceVideoWindow 56 createConference videoResolution displayLocalVideo Conference functions 56 detectMwi Additional setting functions 34 disableCallForward Additional setting functions 33 disableSessionTimer Additional setting functions 34 displayLocalVideo Audio and video functions 41 DTMF events 16 onRecvDtmfTone tone 16 enable3GppTags Additional setting functions 32 enableAEC Audio effect functions 61 enableAGC Audio effect functions 62 enableANS Audio effect functions 62 enableAudioStreamCallback enable callbackMode RTP packets Audio stream and video stream callback functions 51 enableCallbackSendingSignaling Additional setting functions 32 enableCallForward forwardTo Additional setting functions 33 enableCheckMwi Additional setting functions 34 enableCNG Audio effect functions 62 enableReliableProvisional Additional setting functions 31 enableSendPcmStreamToRemote state streamSampl esPerSec Send audio and video stream functions 49 enableSendVideoStreamToRemote state Send audio and video stream functions 50 enableSessionTimer refreshMode Additional setting functions 34 enableVAD Audio effect functions 61 enableVideoStreamCallback callbackMode RTP packets Audio stream and video stream callback functions 52 forwardCall forwardT
65. entPacketLoss Loss rate network late in percent Rate currentDiscardRat Late loss rate in percent e currentExpandRat Fraction of original stream of synthesized speech inserted through e expansion currentPreemptive Fraction of synthesized speech inserted through pre emptive expansion Rate 58 currentAccelerate fraction of data removed through acceleration through acceleration Rate Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int getAudioRtpStatistics long sessionld averageJitterMs int averageJitterMs maxditterMs int maxJitterMs discardedPackets int discardedPackets Obtain the RTP statisics of audio channel Parameters sessionld The session ID of call conversation averageJitterMs Short time average jitter in milliseconds maxlJitterMs Maximum short time jitter in milliseconds discardedPackets The number of discarded packets on a channel during the call Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int getAudioRtcpStatistics long sessionld bytesSent int bytesSent packetsSent int packetsSent bytesReceived int bytesReceived packetsReceived int packetsReceived sendFractionLost int sendFractionLost sendCumulativeLost int sendCumulativeLost recvFracti
66. etRtpPortRange maximumRtpAudioPort minimumRtpVideoPort maximumRtpVideoPort Set the RTP ports range for audio and video streaming int setRtcpPortRange maximumRtcpAudioPort minimumRtcpVideoPort maximumRtcpVideoPort Set the RTCP ports range for audio and video streaming int enableCallForward forwardTo Enable call forward int disableCallForward Disable the call forward the SDK is not forward any incoming call after this function is called int enableSessionTimer refreshMode Allows to periodically refresh Session Initiation Protocol SIP sessions by sending repeated INVITE requests int disableSessionTimer Disable the session timer void setDoNotDisturb Enable the Do not disturb to enable disable int detectMwi Use to obtain the MWI status int enableCheckMwi Allows enable disable the check MWI Message Waiting Indication int setRtpKeepAlive keepAlivePayloadType deltaTransmitTimeMS Enable or disable send RTP keep alive packet during the call is established int setKeepAliveTime Enable or disable send SIP keep alive packet int setAudioSamples maxPtime Set the audio capture sample int addSupportedMimeType mimeType subMimeType Set the SDK receive the SIP message that include special mime type NSString getExtensionHeaderValue headerName Access the SIP header of SIP message int addExtensionHeader h
67. f the function succeeds the return value is O If the function fails the return value is a specific error code int setAudioQos BOOL enable DSCPValue int DSCPValue priority int priority Set the DSCP differentiated services code point value of QoS Quality of Service for audio channel Parameters enable Set to true to enable audio QoS DSCPValue The six bit DSCP value Valid range is 0 63 As defined in RFC 2472 the DSCP value is the high order 6 bits of the IP version 4 IPv4 TOS field and the IP version 6 IPv6 Traffic Class field priority The 802 1p priority PCP field in a 802 1Q VLAN tag Values 0 7 set the priority value 1 leaves the priority setting unchanged Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setVideoQos BOOL enable DSCPValue int DSCPValue Set the DSCP differentiated services code point value of QoS Quality of Service for video channel Parameters enable Set as true to enable QoS false to disable DSCPValue The six bit DSCP value Valid range is 0 63 As defined in RFC 2472 the DSCP value is the high order 6 bits of the IP version 4 IPv4 TOS field and the IP version 6 IPv6 Traffic Class field Returns If the function succeeds the return value is O If the function fails the return value is a specific error code 57 RTP statistics functions Func
68. ge size Returns If the function succeeds the return value is a message ID allows track the message send state in onSendOutOfMessageSuccess and onSendOutOfMessageFailure If the function fails the return value is a specific error code less than 0 Remarks Example 1 send a plain text message Note to send other languages text please use the UTF8 to encode the message before send myVoIPsdk sendOutOfDialogMessage sip userl sip portsip com mimeType f text subMimeType e plain message data messageLength dataLen Example 2 send a binary message myVoIPsdk sendOutOfDialogMessage sip userl sip portsip com mimeType ft application subMimeType vnd 3gpp sms message data messageLength dataLen Presence functions Functions int PortSIPSDK presenceSubscribeContact subject Send a SUBSCRIBE message for presence to a contact int PortSIPSDK presenceAcceptSubscribe Accept the presence SUBSCRIBE request which received from contact int PortSIPSDK presenceRejectSubscribe Reject a presence SUBSCRIBE request which received from contact int PortSIPSDK presenceOnline statusText Send a NOTIFY message to contact to notify that presence status is online changed int PortSIPSDK presenceOffline Send a NOTIFY message to contact to notify that presence status is offline 63 Detailed Description Function Documentation int presenceSubscribeContact NSString
69. gth samplingFreqHz Audio and video stream callback events 22 oninviteAnswered callerDisplayName caller calleeDis playName callee audioCodecs videoCodecs existsAu dio existsVideo Call events 11 oninviteBeginingForward Call events 12 oninviteClosed Call events 12 oninviteConnected Call events 12 oninviteFailure reason code Call events 11 oninvitelncoming callerDisplayName caller calleeDis playName callee audioCodecs videoCodecs existsAu dio existsVideo Call events 10 onInviteRinging statusText statusCode Call events 11 onInviteSessionProgress audioCodecs videoCodecs e xistsEarlyMedia existsAudio existsVideo Call events 11 oninviteTrying Call events 11 oninviteUpdated audioCodecs videoCodecs existsAu dio existsVideo Call events 12 onPlayAudioFileFinished fileName Play audio and video file finished events 20 onPlayVideoFileFinished Play audio and video file finished events 21 onPresenceOffline from Presence events 18 onPresenceOnline from stateText 80 Presence events 18 onPresenceRecvSubscribe fromDisplayName from su bject Presence events 17 onReceivedRefer referld to from referSipMessage Refer events 13 onReceivedRTPPacket isAudio RTPPacket packetSize RTP callback events 21 onReceivedSignaling message Signaling events 14 onRecvDtmfTone tone DTMF events 16 onRecvinfo INFO OPTIONS message events 17 onRecvMessage mimeType subMimeType messageD ata messageDataLength
70. h NSString recordFilePath recordFileName NSString recordFileName appendTimeStamp BOOL appendTimeStamp audioFileFormat AUDIO FILE FORMAT audioFileFormat audioRecordMode RECORD MODE audioRecordMode aviFileCodecType VIDEOCODEC TYPE aviFileCodecType videoRecordMode RECORD MODE videoRecordMode 51 Start record the call Parameters sessionId The session ID of call conversation recordFilePath The file path to save record file it s must exists recordFileName The file name of record file for example audiorecord wav or videorecord avi appendTimeStamp Set to true to append the timestamp to the recording file name audioFileFormat The audio record file format audioRecordMode The audio record mode aviFileCodecType The codec which using for compress the video data to save into video record file videoRecordMode Allow set video record mode support record received video send video both received and send Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int stopRecord long sessionid Stop record Parameters sessionld The session ID of call conversation Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Play audio and video file to remoe functions Functions int PortSIPSDK pla
71. ide from another source to instread of microphone int sendPcmStreamToRemote data Send the audio stream in PCM format from another source to instead of audio device capture microphone int enableSendVideoStreamToRemote state Enable the SDK send video stream data to remote side from another source to instead of camera int sendVideoStreamToRemote data width height Send the video stream to remote int setRtpCallback Set the RTP callbacks to allow access the sending and received RTP packets int enableAudioStreamCallback enable callbackMode Enable disable the audio stream callback int enableVideoStreamCallback callbackMode Enable disable the video stream callback int startRecord recordFilePath recordFileName appendTimeStamp audioFileFormat audioRecordMode aviFileCod ecType videoRecordMode Start record the call int stopRecord Stop record int playVideoFileToRemote aviFile loop playAudio Play an AVI file to remote party 72 int stopPlayVideoFileToRemote Stop play video file to remote side int playAudioFileToRemote filename fileSamplesPerSec loop Play an wave file to remote party int stopPlayAudioFileToRemote Stop play wave file to remote side int playAudioFileToRemoteAsBackground filename fileSamplesPerSec Play an wave file to remote party as conversation background sound int stopPlayAudioFileToRemo
72. ingSignaling message Detailed Description Function Documentation void onReceivedSignaling long sessionld message char message This event will be triggered when received a SIP message Parameters sessionld The session ID of the call message The SIP message which is received 13 void onSendingSignaling long sessionld message char message This event will be triggered when sent a SIP message Parameters sessionld The session ID of the call message The SIP message which is sent MWI events Functions void PortSIPEventDelegate onWaitingVoiceMessage urgentNewMessageCount urgentOldMessageCount newM essageCount oldMessageCount void PortSIPEventDelegate onWaitingFaxMessage urgentNewMessageCount urgentOldMessageCount newMess ageCount oldMessageCount Detailed Description Function Documentation void onWaitingVoiceMessage char messageAccount urgentNewMessageCount int urgentNewMessageCount urgentOldMessageCount int urgentOldMessageCount newMessageCount int newMessageCount oldMessageCount int oldMessageCount If has the waiting voice message MWI then this event will be triggered Parameters messageAccount Voice message account urgentNewMessag Urgent new message count eCount urgentOldMessage Urgent old message count Count newMessageCount New message count oldMess
73. is O If the function fails the return value is a specific error code int clearModifyHeaders Clear the modify headers value no longer modify every outgoing SIP message header values Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks Example modified two headers value for every outging SIP message and then clear it nyVoIPSdk modifyHeaderValue Expires headerValue 1000 myVoIPSdk modifyHeaderValue User Agent headerValue MyTest Softphone 1 0 myVoIPSdk cleaModifyHeaders Audio and video functions Functions int PortSIPSDK setVideoDeviceld Set the video device that will use for video call int PortSIPSDK setVideoResolution Set the video capture resolution int PortSIPSDK setAudioBitrate codecType bitrateKbps Set the audio bit rate int PortSIPSDK setVideoBitrate Set the video bit rate int PortSIPSDK setVideoFrameRate Set the video frame rate int PortSIPSDK sendVideo sendState Send the video to remote side int PortSIPSDK setVideoOrientation Changing the orientation of the video void PortSIPSDK setLocalVideoWindow 37 Set the the window that using to display the local video image int PortSIPSDK setRemoteVideoWindow remoteVideoWindow Set the window for a session that using to display the received remote video im
74. m that mixed including all channels AUDIOSTREAM_REMOTE_PER_CHANNEL Callback the received audio stream for one channel base on the given sessionld Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Remarks the onAudioRawCallback event will be triggered if the callback is enabled 50 int enableVideoStreamCallback long sessionld callbackMode VIDEOSTREAM CALLBACK MODE callbackMode Enable disable the video stream callback Parameters sessionld The session ID of call callbackMode The video stream callback mode Mode Description VIDEOSTREAM_NONE Disable video stream callback VIDEOSTREAM_LOCAL Local video stream callback VIDEOSTREAM_REMOTE Remote video stream callback VIDEOSTREAM_BOTH Both of local and remote video stream callback Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks the onVideoRawCallback event will be triggered if the callback is enabled Record functions Functions int PortSIPSDK startRecord recordFilePath recordFileName appendTimeStamp audioFileFormat audioRecordMod e aviFileCodecType videoRecordMode Start record the call int PortSIPSDK stopRecord Stop record Detailed Description Function Documentation int startRecord long sessionld recordFilePat
75. n If want to receive the NOTIFY message with application media_control xml then myVoIPSdk addSupportedMimeType NOTIFY mimeType G application subMimeType G8 media _control xml1 About the mime type details please visit this website http www iana org assignments media types Access SIP message header functions Functions NSString PortSIPSDK getExtensionHeaderValue headerName Access the SIP header of SIP message int PortSIPSDK addExtensionHeader headerValue Add the extension header custom header into every outgoing SIP message int PortSIPSDK clearAddExtensionHeaders Clear the added extension headers custom headers int PortSIPSDK modifyHeaderValue headerValue Modify the special SIP header value for every outgoing SIP message int PortSIPSDK clearModifyHeaders Clear the modify headers value no longer modify every outgoing SIP message header values 35 Detailed Description Function Documentation NSString getExtensionHeaderValue NSString sipMessage headerName NSString headerName Access the SIP header of SIP message Parameters sipMessage The SIP message headerName Which header want to access of the SIP message Returns If the function succeeds the return value is headerValue If the function fails the return value is nil Remarks When got a SIP message in the onReceivedSignaling callback event
76. nished fileName 20 onPlayVideoFileFinished 21 Play audio and video file to remoe functions 53 playAudioFileToRemote filename fileSamplesPe rSec loop 54 playAudioFileToRemoteAsBackground filename fileSamplesPerSec 55 playVideoFileToRemote aviFile loop playAudio 54 stopPlayAudioFileToRemote 55 stopPlayAudioFileToRemoteAsBackground 55 stopPlayVideoFileToRemote 54 playAudioFileToRemote filename fileSamplesPerSec loop Play audio and video file to remoe functions 54 playAudioFileToRemoteAsBackground filename fileS amplesPerSec Play audio and video file to remoe functions 55 playVideoFileToRemote aviFile loop playAudio Play audio and video file to remoe functions 54 PortSIPSDK 70 PortSIPVideoRenderView 77 updateVideoRenderFrame 77 Presence events 17 onPresenceOffline from 18 onPresenceOnline from stateText 18 onPresenceRecvSubscribe fromDisplayName fr om subject 17 Presence functions 64 presenceAcceptSubscribe 65 presenceOffline 66 presenceOnline statusText 65 presenceRejectSubscribe 65 presenceSubscribeContact subject 65 presenceAcceptSubscribe Presence functions 65 presenceOffline Presence functions 66 presenceOnline statusText Presence functions 65 81 presenceRejectSubscribe Presence functions 65 presenceSubscribeContact subject Presence functions 65 Record functions 52 startRecord recordFilePath recordFileName app endTimeStamp audioFileFormat a
77. o Call functions 46 getAudioRtcpStatistics bytesSent packetsSent bytesR eceived packetsReceived sendFractionLost sendCum ulativeLost recvFractionLost recvCumulativeLost RTP statistics functions 60 getAudioRtpStatistics averageJitterMs maxJitterMs d iscardedPackets RTP statistics functions 60 getDynamicVolumeLevel microphoneVolume Audio and video functions 42 getExtensionHeaderValue headerName Access SIP message header functions 37 getLocallpAddress NIC and local IP functions 27 getNetworkStatistics currentBufferSize preferredBuf ferSize currentPacketLossRate currentDiscardRate c urrentExpandRate currentPreemptiveRate currentAc celerateRate RTP statistics functions 59 getNICNums NIC and local IP functions 27 getVersion minorVersion Additional setting functions 31 79 getVideoRtpStatistics bytesSent packetsSent bytesR eceived packetsReceived RTP statistics functions 60 hangUp Call functions 44 hold Call functions 45 INFO OPTIONS message events 17 onRecvinfo 17 onRecvOptions 17 Initialize and register functions 23 initialize loglevel logPath maxLine agent audioD eviceLayer videoDeviceLayer 24 refreshRegisterServer 26 registerServer retryTimes 25 setLicenseKey 26 setUser displayName authName password local IP localSIPPort userDomain SIPServer SIPServer Port STUNServer STUNServerPort outboundSer ver outboundServerPort 24 unRegisterServer 26 initialize loglevel logPath maxLine agent au
78. o existsVideo void lt PortSIPEventDelegate gt onInviteConnected void lt PortSIPEventDelegate gt onInviteBeginingForward void lt PortSIPEventDelegate gt onInviteClosed void lt PortSIPEventDelegate gt onRemoteHold void lt PortSIPEventDelegate gt onRemoteUnHold audioCodecs videoCodecs existsAudio existsVideo Detailed Description Function Documentation void onInvitelncoming long sessionld callerDisplayName char callerDisplayName caller char caller calleeDisplayName char calleeDisplayName callee char callee audioCodecs char audioCodecs videoCodecs char videoCodecs existsAudio BOOL existsAudio existsVideo BOOL existsVideo When the call is coming this event was triggered Parameters sessionld The session ID of the call callerDisplayName The display name of caller caller The caller calleeDisplayName The display name of callee callee The callee audioCodecs The matched audio codecs it s separated by if have more than one codec videoCodecs The matched video codecs it s separated by if have more than one codec existsAudio If it s true means this call include the audio existsVideo If it s true means this call include the video void onInviteTrying long sessionld optional If the outgoing call was processing this event triggered Parameters sessionld
79. o periodically refresh Session Initiation Protocol SIP sessions by sending repeated INVITE requests int PortSIPSDK disableSessionTimer Disable the session timer void PortSIPSDK setDoNotDisturb Enable the Do not disturb to enable disable int PortSIPSDK detectMwi Use to obtain the MWI status int PortSIPSDK enableCheckMwi 29 Allows enable disable the check MWI Message Waiting Indication int PortSIPSDK setRtpKeepAlive keepAlivePayloadType deltaTransmitTimeMS Enable or disable send RTP keep alive packet during the call is established int PortSIPSDK setKeepAliveTime Enable or disable send SIP keep alive packet int PortSIPSDK setAudioSamples maxPtime Set the audio capture sample int PortSIPSDK addSupportedMimeType mimeType subMimeType Set the SDK receive the SIP message that include special mime type Detailed Description Function Documentation int setDisplayName NSString displayName Set user display name Parameters displayName The display name Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int getVersion int majorVersion minorVersion int minorVersion Get the current version number of the SDK Parameters majorVersion Return the major version number minorVersion Return the minor version
80. oid onReceivedRTPPacket isAudio RTPPacket packetSize void onSendingRTPPacket isAudio RTPPacket packetSize void onAudioRawCallback audioCallbackMode data dataLength samplingFreqHz void onVideoRawCallback videoCallbackMode width height data dataLength Detailed Description PortSIP SDK Callback events Delegate Author Copyright c 2006 2014 PortSIP Solutions Inc All rights reserved Version 11 2 See also http www PortSIP com PortSIP SDK Callback events Delegate description The documentation for this protocol was generated from the following file PortSiPEventDelegate h 68 PortSIPSDK Class Reference PortSIP VoIP SDK functions class import lt PortSIPSDK h gt Inherits lt NSObject gt Instance Methods int initialize loglevel logPath maxLine agent audioDeviceLayer videoDeviceLayer Initialize the SDK void unlnitialize Un initialize the SDK and release resources int setUser displayName authName password locallP localSIPPort userDomain SIPServer SIPServerPort STUNServ er STUNServerPort outboundServer outboundServerPort Set user account info int registerServer retryTimes Register to SIP proxy server login to server int refreshRegisterServer Request a manual refresh of the registration int unRegisterServer Un register from the SIP proxy server int setLicenseKey Set the li
81. onLost int recvFractionLost recvCumulativeLost int recvCumulativeLost Obtain the RTCP statisics of audio channel Parameters sessionId The session ID of call conversation bytesSent The number of sent bytes packetsSent The number of sent packets bytesReceived The number of received bytes packetsReceived The number of received packets sendFractionLost Fraction of sent lost in percent sendCumulativeLo The number of sent cumulative lost packet st recvFractionLost Fraction of received lost in percent recvCumulativeLos The number of received cumulative lost packets t Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int getVideoRtpStatistics long sessionld bytesSent int bytesSent packetsSent int packetsSent bytesReceived int bytesReceived packetsReceived int packetsReceived Obtain the RTP statisics of video 59 Parameters sessionId The session ID of call conversation bytesSent The number of sent bytes packetsSent The number of sent packets bytesReceived The number of received bytes packetsReceived The number of received packets Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Audio effect functions Functions void PortSIPSDK enableVAD Enable disable Voi
82. ord locallP localSIPPort userDomain SIPServer SIPServerPo rt STUNServer STUNServerPort outboundServer outboundServerPort 22 Set user account info int PortSIPSDK registerServer retryTimes Register to SIP proxy server login to server int PortSIPSDK refreshRegisterServer Request a manual refresh of the registration int PortSIPSDK unRegisterServer Un register from the SIP proxy server int PortSIPSDK setLicenseKey Set the license key must called before setUser function Detailed Description Initialize and register functions Function Documentation int initialize TRANSPORT TYPE transport loglevel PORTSIP LOG LEVEL logPath NSString audioDeviceLayer int audioDeviceLayer videoDeviceLayer int videoDeviceLayer Initialize the SDK logLevel logFilePath maxLine int maxCallLines agent NSString sipAgent Parameters transport Transport for SIP signaling TRANSPORT PERS is the PortSIP private transport for anti the SIP blocking it must using with the PERS logLevel Set the application log level the SDK generate the PortSIP Log datatime log file if the log enabled logFilePath The log file path the path folder MUST is exists maxCallLines In theory support unlimited lines just depends on the device capability for SIP client recommend less than 1 100 sipAgent The User Agent header to insert in SI
83. pAudioPort int maximumRtpAudioPort minimumRtpVideoPort int minimumRtpVideoPort maximumRtpVideoPort int maximumRtpVideoPort Set the RTP ports range for audio and video streaming Parameters minimumRtpAudio Port The minimum RTP port for audio stream maximumRtpAudi oPort The maximum RTP port for audio stream minimumRtpVideo Port The minimum RTP port for video stream 31 maximumRtpVide The maximum RTP port for video stream oPort Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks The port range max min maxCallLines should more than 4 int setRtcpPortRange int minimumRtcpAudioPort maximumRtcpAudioPort int maximumRtcpAudioPort minimumRtcpVideoPort int minimumRtcpVideoPort maximumRtcpVideoPort int maximumRtcpVideoPort Set the RTCP ports range for audio and video streaming Parameters minimumRtcpAudi The minimum RTCP port for audio stream oPort maximumRtcpAudi The maximum RTCP port for audio stream oPort minimumRtcpVide The minimum RTCP port for video stream oPort maximumRtcpVide The maximum RTCP port for video stream oPort Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Remarks The port range max min maxCallLines should more than 4 int
84. r from The message sender toDisplayName The display name of message receiver to The message receiver reason The failure reason code The failure code Play audio and video file finished events Functions void PortSIPEventDelegate onPlayAudioFileFinished fileName void PortSIPEventDelegate onPlayVideoFileFinished Detailed Description Function Documentation void onPlayAudioFileFinished long sessionld fileName char fileName If called playAudioFileToRemote function with no loop mode this event will be triggered once the file play finished Parameters sessionld The session ID of the call fileName The play file name 19 void onPlayVideoFileFinished long sessionld If called playVideoFileToRemote function with no loop mode this event will be triggered once the file play finished Parameters sessionld The session ID of the call RTP callback events Functions void lt PortSIPEventDelegate gt onReceivedRTPPacket isAudio RTPPacket packetSize void lt PortSIPEventDelegate gt onSendingRTPPacket isAudio RTPPacket packetSize Detailed Description Function Documentation void onReceivedRTPPacket long sessionld isAudio BOOL isAudio RTPPacket unsigned char RTPPacket packetSize int packetSize If called setRTPCallback function to enabled the RTP callback this event will be
85. r code 39 int setVideoOrientation int rotation Changing the orientation of the video Parameters rotation The video rotation that you want to set 0 90 180 270 Returns If the function succeeds the return value is O If the function fails the return value is a specific error code void setLocalVideoWindow PortSIPVideoRenderView localVideoWindow Set the the window that using to display the local video image Parameters localVideoWindow The PortSIPVideoRenderView to display local video image from camera int setRemoteVideoWindow long sessionld remoteVideoWindow PortSIPVideoRenderView remoteVideoWindow Set the window for a session that using to display the received remote video image Parameters sessionld The session ID of the call remoteVideoWind The PortSIPVideoRenderView to display received remote video image ow Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int displayLocalVideo BOOL state Start stop to display the local video image Parameters state state Set to true to display local video iamge Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int setVideoNackStatus BOOL state Enable disable the NACK feature RFC4585 whi
86. reqHz void lt PortSIPEventDelegate gt onVideoRawCallback videoCallbackMode width height data dataLength Detailed Description Function Documentation void onAudioRawCallback long sessionid audioCallbackMode int audioCallbackMode data unsigned char data dataLength int dataLength samplingFreqHz int samplingFreqHz This event will be triggered once received the audio packets if called enableAudioStreamCallback function Parameters sessionId The session ID of the call audioCallbackMod TThe type which pasdded in enableAudioStreamCallback function e data The memory of audio stream it s PCM format dataLength The data size samplingFreqHz The audio stream sample in HZ for example it s 8000 or 16000 Note Don t call any SDK API functions in this event directly If you want to call the API functions or other code which will spend long time you should post a message to another thread and execute SDK API functions or other code in another thread void onVideoRawCallback long sessionid videoCallbackMode int videoCallbackMode width int width height int height data unsigned char data dataLength int dataLength This event will be triggered once received the video packets if called enableVideoStreamCallback function Parameters sessionld The session ID of the call videoCallbackMod The type which pasdded in enableVideoStreamCallback
87. s answered the call this event triggered Parameters sessionld The session ID of the call callerDisplayName The display name of caller caller The caller calleeDisplayName The display name of callee callee The callee audioCodecs The matched audio codecs it s separated by if have more than one codec videoCodecs The matched video codecs it s separated by if have more than one codec existsAudio If it s true means this call include the audio existsVideo If it s true means this call include the video void onInviteFailure long sessionld reason char reason code int code optional If the outgoing call is fails this event triggered 10 Parameters sessionld The session ID of the call reason The failure reason code The failure code void onInviteUpdated long sessionld audioCodecs char audioCodecs videoCodecs char videoCodecs existsAudio BOOL existsAudio existsVideo BOOL existsVideo optional This event will be triggered when remote party updated this call Parameters sessionld The session ID of the call audioCodecs The matched audio codecs it s separated by if have more than one codec videoCodecs The matched video codecs it s separated by if have more than one codec existsAudio If it s true means this call include the audio existsVideo If it s true means this call include the video
88. sage to contact to notify that presence status is online changed 64 Parameters subscribeld Subscribe id when received a SUBSCRIBE request from contact the event onPresenceRecvSubscribe will be triggered the event inclues the subscribe id statusText The state text of presende online for example I m here Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int presenceOffline long subscribeld Send a NOTIFY message to contact to notify that presence status is offline Parameters subscribeld Subscribe id when received a SUBSCRIBE request from contact the event onPresenceRecvSubscribe will be triggered the event inclues the subscribe id Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Keep awake functions Functions BOOL PortSIPSDK startKeepAwake Keep VoIP awake in the background If you want your application can receive the incoming call when it run in background you should call this function in applicationDidEnterBackground BOOL PortSIPSDK stopKeepAwake Keep VoIP awake in the background Call this function in applicationWillEnterForeground once your application come back to foreground Detailed Description Function Documentation BOOL startKeepAwake Keep VoIP awake in the background If you want your
89. ss to a select set of technical resources tools and information for developing with iOS Mac OS X and Safa You can open registration page and enroll Once registered you can then go to the iOS Dev Center login and download the iOS SDK The SDK contains documentation frameworks tools and a simulator to help develop iOS applications XCode the developer toolset for iOS application development is included in the download as well so you do not need to purchase any developer tools to build iOS applications that is included in the enrollment fee You will need to use a minimum of iOS SDK 9 for developing iPhone and iPod Touch applications At the time of writing this document iOS SDK 9 was the most recent version available and supported Note Beta and GM seed versions of the iOS SDK are not generally not supported unless noted otherwise Regardless of the iOS SDK you use for development you can still target your application for devices running an older iOS version by configuring your Xcode project s iOS Deployment Target build setting Be sure to add runtime checks where appropriate to ensure that you use only those iOS features available on the target platform device If your application attempts to use iOS features not available on the device your application may crash Device Requirements Applications built with PortSIP VoIP IMS SDK for iOS can be run on iPhone 3GS or higher iPod touch 4 or higher and iPad 2 or higher devices Thes
90. tRtpCallback Set the RTP callbacks to allow access the sending and received RTP packets int PortSIPSDK enableAudioStreamCallback enable callbackMode 49 Enable disable the audio stream callback int PortSIPSDK enableVideoStreamCallback callbackMode Enable disable the video stream callback Detailed Description Function Documentation int setRtpCallback BOOL enable Set the RTP callbacks to allow access the sending and received RTP packets Parameters enable Set to true to enable the RTP callback for received and sending RTP packets the onSendingRtpPacket and onReceivedRtpPacket events will be triggered Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int enableAudioStreamCallback long sessionld enable BOOL enable callbackMode AUDIOSTREAM CALLBACK MODE callbackMode Enable disable the audio stream callback Parameters sessionld The session ID of call enable Set to true to enable audio stream callback false to stop the callback callbackMode The audio stream callback mode Type Description AUDIOSTREAM_LOCAL_MIX Callback the audio stream from microphone for all channels AUDIOSTREAM_LOCAL_PER_CHANNEL Callback the audio stream from microphone for one channel base on the given sessionld AUDIOSTREAM_REMOTE_MIX Callback the received audio strea
91. tate YES streamSamplesPerSec 16000 myVoIPSdk sendPcmStreamToRemote sessionId data data int enableSendVideoStreamToRemote long sessionld state BOOL state Enable the SDK send video stream data to remote side from another source to instead of camera Parameters sessionld The session ID of call state Set to true to enable the send stream false to disable Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int sendVideoStreamToRemote long sessionld data NSData data width int width height int height Send the video stream to remote Parameters sessionld Session ID of the call conversation data The video video stream data must is 420 format width The video image width height The video image height Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Remarks Send the video stream in i420 from another source to instead of video device capture camera Before called this function you MUST call the enableSendVideoStreamToRemote function Usually we should use it like below myVoIPSdk enableSendVideoStreamToRemote sessionId state YES myVoIPSdk sendVideoStreamToRemote sessionId data data width 352 height 288 RTP packets Audio stream and video stream callback functions Functions int PortSIPSDK se
92. teAsBackground Stop play an wave file to remote party as conversation background sound int createConference videoResolution displayLocalVideo Create a conference It s failures if the exists conference isn t destroy yet void destroyConference Destroy the exist conference int setConferenceVideoWindow Set the window for a conference that using to display the received remote video image int joinToConference Join a session into exist conference if the call is in hold please un hold first int removeFromConference Remove a session from an exist conference int setAudioRtcpBandwidth BitsRR BitsRS KBitsAS Set the audio RTCP bandwidth parameters as the RFC3556 int setVideoRtcpBandwidth BitsRR BitsRS KBitsAS Set the video RTCP bandwidth parameters as the RFC3556 int setAudioQos DSCPValue priority Set the DSCP differentiated services code point value of QoS Quality of Service for audio channel int setVideoQos DSCPValue Set the DSCP differentiated services code point value of QoS Quality of Service for video channel int getNetworkStatistics currentBufferSize preferredBufferSize currentPacketLossRate currentDiscardRate current ExpandRate currentPreemptiveRate currentAccelerateRate Get the in call statistics The statistics are reset after the query int getAudioRtpStatistics averageJitterMs maxJitterMs discardedPackets Obtain
93. tions int PortSIPSDK getNetworkStatistics currentBufferSize preferredBufferSize currentPacketLossRate currentDiscard Rate currentExpandRate currentPreemptiveRate currentAccelerateRate Get the in call statistics The statistics are reset after the query int PortSIPSDK getAudioRtpStatistics averageJitterMs maxJitterMs discardedPackets Obtain the RTP statisics of audio channel int PortSIPSDK getAudioRtcpStatistics bytesSent packetsSent bytesReceived packetsReceived sendFractionLost s endCumulativeLost recvFractionLost recvCumulativeLost Obtain the RTCP statisics of audio channel int PortSIPSDK getVideoRtpStatistics bytesSent packetsSent bytesReceived packetsReceived Obtain the RTP statisics of video Detailed Description Function Documentation int getNetworkStatistics long sessionid currentBufferSize int currentBufferSize preferredBufferSize int preferredBufferSize currentPacketLossRate int currentPacketLossRate currentDiscardRate int currentDiscardRate currentExpandRate int currentExpandRate currentPreemptiveRate int currentPreemptiveRate currentAccelerateRate int currentAccelerateRate Get the in call statistics The statistics are reset after the query Parameters sessionld The session ID of call conversation currentBufferSize Current jitter buffer size in ms preferredBufferSiz Preferred buffer size in ms e curr
94. uals the return value of sendMessage function void onSendMessageFailure long sessionld messageld long messageld reason char reason code int code If the message was sent failure out of dialog this event will be triggered Parameters sessionld The session ID of the call messageld The message ID it s equals the return value of sendMessage function reason The failure reason code Failure code 18 void onSendOutOfDialogMessageSuccess long messageld fromDisplayName char fromDisplayName from char from toDisplayName char toDisplayName to char to If the message was sent succeeded out of dialog this event will be triggered Parameters messageld The message ID it s equals the return value of SendOutOfDialogMessage function fromDisplayName The display name of message sender from The message sender toDisplayName The display name of message receiver to The message receiver void onSendOutOfDialogMessageFailure long messageld fromDisplayName char fromDisplayName from char fromtoDisplayName char toDisplayName to char to reason char reason code int code If the message was sent failure out of dialog this event will be triggered Parameters messageld The message ID it s equals the return value of SendOutOfDialogMessage function fromDisplayName The display name of message sende
95. udioRawCallback audioCallbackMode data dataLength samplingFreqHz 22 onVideoRawCallback videoCallbackMode width height data dataLength 22 Audio effect functions 61 enableAEC 61 enableAGC 62 enableANS 62 enableCNG 62 enableVAD 61 Call events 10 onInviteAnswered callerDisplayName caller call eeDisplayName callee audioCodecs videoCodec s existsAudio existsVideo 11 oninviteBeginingForward 12 oninviteClosed 12 oninviteConnected 12 oninviteFailure reason code 11 onInvitelncoming callerDisplayName caller calle eDisplayName callee audioCodecs videoCodecs existsAudio existsVideo 10 onInviteRinging statusText statusCode 11 78 oninviteSessionProgress audioCodecs videoCod ecs existsEarlyMedia existsAudio existsVideo 11 oninviteTrying 11 oninviteUpdated audioCodecs videoCodecs exis tsAudio existsVideo 12 onRemoteHold 12 onRemoteUnHold audioCodecs videoCodecs exi stsAudio existsVideo 12 Call functions 43 answerCall videoCall 44 call sendSdp videoCall 43 forwardCall forwardTo 46 hangUp 44 hold 45 muteSession mutelncomingAudio muteOutgoin gAudio mutelncomingVideo muteOutgoingVide o 45 rejectCall code 44 sendDtmf dtmfMethod code dtmfDration playD tmfTone 46 unHold 45 updateCall enableAudio enableVideo 44 call sendSdp videoCall Call functions 43 clearAddExtensionHeaders Access SIP message header functions 37 clearModifyHeaders Access SIP message header functions 38 Confer
96. udioRecordM ode aviFileCodecType videoRecordMode 52 stopRecord 53 Refer events 13 onACTVTransferFailure reason code 14 onACTVTransferSuccess 14 onReceivedRefer referld to from referSipMessa ge 13 onReferAccepted 13 onReferRejected reason code 13 onTransferRinging 14 onTransferTrying 14 Refer functions 47 acceptRefer referSignaling 48 attendedRefer replaceSessionld referTo 48 refer referTo 47 rejectRefer 48 refer referTo Refer functions 47 refreshRegisterServer Initialize and register functions 26 Register events 9 onRegisterFailure statusCode 9 onRegisterSuccess statusCode 9 registerServer retryTimes Initialize and register functions 25 rejectCall code Call functions 44 rejectRefer Refer functions 48 removeFromConference Conference functions 57 RTP and RTCP QOS functions 57 setAudioQos DSCPValue priority 58 setAudioRtcpBandwidth BitsRR BitsRS KBitsAS 57 setVideoQos DSCPValue 58 setVideoRtcpBandwidth BitsRR BitsRS KBitsAS 58 RTP callback events 21 onReceivedRTPPacket isAudio RTPPacket packe tSize 21 onSendingRTPPacket isAudio RTPPacket packet Size 21 RTP packets Audio stream and video stream callback functions 50 enableAudioStreamCallback enable callbackMo de 51 enableVideoStreamCallback callbackMode 52 setRtpCallback 51 RTP statistics functions 59 getAudioRtcpStatistics bytesSent packetsSent b ytesReceived packetsReceived sendFractionLost
97. unctions 44 updateVideoRenderFrame PortSIPVideoRenderView 77 83
98. ve more than one codec existsAudio If it s true means this call include the audio existsVideo If it s true means this call include the video Refer events Functions void lt PortSIPEventDelegate gt onReceivedRefer referld to from referSipMessage void lt PortSIPEventDelegate gt onReferAccepted void lt PortSIPEventDelegate gt onReferRejected reason code void lt PortSIPEventDelegate gt onTransferTrying void lt PortSIPEventDelegate gt onTransferRinging void lt PortSIPEventDelegate gt onACTVTransferSuccess void lt PortSIPEventDelegate gt onACTVTransferFailure reason code Detailed Description Function Documentation void onReceivedRefer long sessionld referld long referld to char to from char from referSipMessage char referSipMessage This event will be triggered once received a REFER message Parameters sessionld The session ID of the call referld The ID of the REFER message pass it to acceptRefer or rejectRefer to The refer target from The sender of REFER message referSipMessage The SIP message of REFER pass it to acceptRefer function void onReferAccepted long sessionld This callback will be triggered once remote side called acceptRefer to accept the REFER Parameters sessionld The session ID of the call void onReferRejected long sessionid reason
99. yVideoFileToRemote aviFile loop playAudio Play an AVI file to remote party int PortSIPSDK stopPlayVideoFileToRemote Stop play video file to remote side int PortSIPSDK playAudioFileToRemote filename fileSamplesPerSec loop Play an wave file to remote party int PortSIPSDK stopPlayAudioFileToRemote Stop play wave file to remote side int PortSIPSDK playAudioFileToRemoteAsBackground filename fileSamplesPerSec Play an wave file to remote party as conversation background sound int PortSIPSDK stopPlayAudioFileToRemoteAsBackground Stop play an wave file to remote party as conversation background sound 52 Detailed Description Function Documentation int playVideoFileToRemote long sessionld aviFile NSString aviFile loop BOOL loop playAudio BOOL playAudio Play an AVI file to remote party Parameters sessionId Session ID of the call aviFile The file full path name such as test avi loop Set to false to stop play video file when it is end Set to true to play it as repeat playAudio If set to true then play audio and video together set to false just play video only Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int stopPlayVideoFileToRemote long sessionld Stop play video file to remote side Parameters sessionld Session ID of the call

Download Pdf Manuals

image

Related Search

Related Contents

Bedienungsanleitung  SPIDER Controller - Blackhawk Enterprises  Installationsanleitung BCALMXP v50r3  Référentiel Infrastructure Règlement S 0 Généralités    ATV-563DL 取扱説明書  le service en ligne de demande d`homologation d`une rupture  Journal n°1 - RAM - Communauté de Communes  

Copyright © All rights reserved.
Failed to retrieve file