Home

PortSIP VoIP SDK Manual for Windows

image

Contents

1. It s optional authName Authorization user name usually equals the username password The password of user it s optional locallIp The local computer IP address to bind for example 192 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 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 empty rt Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib registerServer Int32 expires Int32 retryTimes Register to SIP proxy server login to server Parameters expires Registration refresh Interval in seconds maximum is 3
2. 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 enable Video 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 0 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 clearVideoCodec addVideoCodec VIDEOCODEC_H264 updateCall sessionId true true Example 2 Remove video stream from currently conversation 30 updateCall sessionId true false Int32 PortSIP PortSIPLib hold Int32 sessionld 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 Int32 PortSIP PortSIPLib unHold Int32 sessionld Take off 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 Int32 PortSIP PortSIPLib muteSession Int32 sessionid Boolean mutelncomingAudio Boolean muteOutgoingAudio Boolean mutelncomingVideo Boolean muteOutgoing Vid
3. Refer events Signaling events MWI events DTMF events INFO OPTIONS message events Presence 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 Int32 PortSIP SIPCallbackEvents onRegisterSuccess Int32 callbackIndex Int32 callbackObject String statusText Int32 statusCode Int32 PortSIP SIPCallbackEvents onRegisterFailure Int32 callbackIndex Int32 callbackObject String statusText Int32 statusCode Detailed Description Register events Function Documentation Int32 PortSIP SIPCallbackEvents onRegisterSuccess Int32 callbackindex Int32 callbackObject String statusText Int32 statusCode When successfully register to server this event will be triggered Parameters callbackIndex This is a callback index which passed in when create the SDK library callbackObject This is a callback object which passed in when create the SDK library statusText The status text statusCode The status code 58 Int32 PortSIP SIPCallbackEvents onRegisterFailure Int32 callbackindex Int32 callbackObject String statusText Int32 statusCode If register to SIP server is fail this event will be triggered Parameters statusText The status text status Code The status code Call events Functions Int32 PortSIP SIPCallbackEvents onInv
4. tone Dtmf tone Q o e CD Description The DTMF tone 0 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 COND NBR PN l C The DTMF tone 8 o The DTMF tone 9 The DTMF tone The DTMF tone N The DTMF tone A 05 The DTMF tone B AR The DTMF tone C Nin The DTMF tone D The DTMF tone FLASH 66 INFO OPTIONS message events Functions Int32 PortSIP SIPCallbackEvents onRecvOptions Int32 callbackIndex Int32 callbackObject StringBuilder optionsMessage Int32 PortSIP SIPCallbackEvents onRecvInfo Int32 callbackIndex Int32 callbackObject StringBuilder infoMessage Detailed Description Function Documentation Int32 PortSIP SIPCallbackEvents onRecvOptions Int32 ca lbacklIndex Int32 callbackObject StringBuilder optionsMessage This event will be triggered when received the OPTIONS message Parameters optionsMessage The received whole OPTIONS message in text format Int32 PortSIP SIPCallbackEvents onRecvinfo Int32 callbackindex Int32 callbackObject StringBuilder infoMessage This event will be triggered when received the INFO message Parameters infoMessage The received whole INFO message in text format Presence events F
5. Detailed Description 43 Function Documentation Int32 PortSIP PortSIPLib setAudioRtcpBandwidth Int32 sessionld Int32 BitsRR Int32 BitsRS Int32 KBitsAS Set the audio 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 If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setVideoRtcpBandwidth Int32 sessionld Int32 BitsRH Int32 BitsRS Int32 KBitsAS Set the video RTCP bandwidth parameters as the RFC3556 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 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setAudioQos Boolean state Int32 DSCPValue Int32 priority Set the DSCP differentiated services code point value of QoS Quality of Service for audio channel Parameters state 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
6. Int32 PortSIP PortSIPLib enableAudioStreamCallback Int32 callbackObject Int32 sessionId Boolean enable AUDIOSTREAM_ CALLBACK MODE callbackMode Enable disable the audio stream callback 36 Int32 PortSIP PortSIPLib enableVideoStreamCallback Int32 callbackObject Int32 sessionId VIDEOSTREAM CALLBACK MODE callbackMode Enable disable the video stream callback Detailed Description Function Documentation Int32 PortSIP PortSIPLib setRtpCallback Int32 callbackObject Boolean enable Set the RTP callbacks to allow access the sending and received RTP packets Parameters callbackObject The callback object that you passed in and can access it once callback function triggered 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 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib enableAudioStreamCallback Int32 callbackObject Int32 sessionld Boolean enable AUDIOSTREAM CALLBACK MODE callbackMode Enable disable the audio stream callback Parameters callbackObject The callback object that you passed in and can access it once callback function triggered sessionId The session ID of call enable Set to true to enable audio stream callback false to stop the cal
7. EC NONE 0 EC DEFAULT 1 EC CONFERENCE 2 EC AEC 3 EC AECM 1 4 EC AECM 2 5 EC AECM 3 6 EC AECM 4 7 type of Echo Control enum AGC MODES AGC NONE 0 AGC DEFAULT AGC ADAPTIVE ANALOG AGC ADAPTIVE DIGITAL AGC FIXED DIGITAL type of Automatic Gain Control enum NS MODES NS NONE 0 NS DEFAULT NS Conference NS LOW SUPPRESSION NS MODERATE SUPPRESSION NS HIGH SUPPRESSION NS VERY HIGH SUPPRESSION type of Noise Suppression Detailed Description PortSIP The PortSIP VoIP SDK namespace Enumeration Type Documentation enum PortSIP AUDIOCODEC TYPE int Audio codec type Enumerator AUDIOCODEC G729 G729 SK HZ 8kbit s AUDIOCODEC PCMA PCMA G711 A law 8KHZ 64kbit s AUDIOCODEC PCMU PCMU G711 f 4 Iaw 8KHZ 64kbit s AUDIOCODEC GSM GSM 8KHZ 13kbit s AUDIOCODEC G722 G722 16KHZ 64kbit s AUDIOCODEC ILBC iLBC 8KHZ 30ms 13kbit s 20 ms 15kbit s AUDIOCODEC AMR Adaptive Multi Rate AMR 8KHZ 4 75 5 15 5 90 6 70 7 40 7 95 10 20 12 20 kbit s AUDIOCODEC_AMRWB Adaptive Multi Rate Wideband AMR WB 16KHZ 6 60 8 85 12 65 14 25 15 85 18 25 19 85 23 05 23 85 kbit s AUDIOCODEC SPEEX SPEEX 8KHZ 2 24 kbit s AUDIOCODEC SPEEXWB SPEEX 16KHZ 4 42 kbit s 75 AUDIOCODEC ISACWB internet Speech Audio Codec iSAC 16KHZ 32 54 kbit s AUDIOCODEC ISACSWB internet Speech Audio Codec iSAC 16KHZ 32 160 kbit s AUDIOCODEC G7221 G722 1 16KHZ 16 24 32 kbit s AUD
8. If the function succeeds the return value is the microphone volume If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setSystemInputMute Boolean enable Mute the microphone input device completely in the OS Parameters enable If set to true the input device is muted Set to false is unmuted Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Boolean PortSIP PortSIPLib getSystemInputMute Gets the mute state of the input device in the operating system Returns If return value is true the input device is muted If false the input device is not muted void PortSIP PortSIPLib audioPlayLoopbackTest Boolean enable Use to do the audio device loop back test Parameters enable Set to true start audio look back test Set to fase to stop 56 Int32 PortSIP PortSIPLib getNumOfVideoCaptureDevices Gets the number of available capture devices Returns The return value is number of video capture devices if fails the return value is a specific error code less than 0 Int32 PortSIP PortSIPLib getVideoCaptureDeviceName Int32 devicelndex StringBuilder uniqueldUTF8 Int32 uniqueldUTF8Length StringBuilder deviceNameUTFS8 Int32 deviceNameUTF amp Length Gets the name of a specific video capture device given by an index Parameters deviceIndex Device inde
9. String callee Boolean sendSdp Boolean videoCall Make a call Int32 rejectCall Int32 sessionId int code rejectCall Reject the incoming call Int32 hangUp Int32 sessionId hangUp Hang up the call Int32 answerCall Int32 sessionId Boolean videoCall answerCall Answer the incoming call Int32 updateCall Int32 sessionId bool enableAudio bool enable Video Use the re INVITE to update the established call Int32 hold Int32 sessionId To place a call on hold Int32 unHold Int32 sessionId Take off hold 84 Int32 muteSession Int32 sessionId Boolean muteIncomingAudio Boolean muteOutgoingAudio Boolean muteIncomingVideo Boolean muteOutgoingVideo Mute the specified session audio or video Int32 forwardCall Int32 sessionId String forwardTo Forward call to another one when received the incoming call Int32 sendDtmf Int32 sessionId DIMF_ METHOD dtmfMethod int code int dtmfDuration bool playDtmfTone Send DTMF tone Int32 refer Int32 sessionId String referTo Refer the currently call to another one Int32 attendedRefer Int32 sessionId Int32 replaceSessionld String referTo Make an attended refer Int32 acceptRefer Int32 referld String referSignalingMessage Accept the REFER request a new call will be make if called this function usuall called after onReceivedRefer callback event Int32 rejectRefer Int32 referId Reject the REFER request Int32 enableSendPcmStreamToRemote Int32 sessionId B
10. void PortSIP PortSIPLib destroyConference Destroy the exist conference Int32 PortSIP PortSIPLib setConferenceVideoWindow IntPtr videoWindow Set the window for a conference that using to display the received remote video image Int32 PortSIP PortSIPLib joinToConference Int32 sessionId Join a session into exist conference if the call is in hold it will be un hold automatically Int32 PortSIP PortSIPLib removeFromConference Int32 sessionId Remove a session from an exist conference Detailed Description Function Documentation Int32 PortSIP PortSIPLib createConference IntPtr conferenceVideoWindow VIDEO RESOLUTION videoResolution Boolean displayLocalVideolnConference Create a conference It s failures if the exists conference isn t destroy yet Parameters conferenceVideoW The UIView which using to display the conference video indow videoResolution The conference video resolution displayLocalVideo Display the local video on video window or not InConference Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setConferenceVideoWindow IntPtr videoWindow Set the window for a conference that using to display the received remote video image Parameters videoWindow The UIView which using to display the conference video 42 Returns If the function succeeds the retur
11. 3 AUDIOCODEC TYPE AUDIOCODEC G722 9 AUDIOCODEC TYPE AUDIOCODEC ILBC 97 AUDIOCODEC TYPE AUDIOCODEC AMR 98 AUDIOCODEC TYPE AUDIOCODEC AMRWB 99 AUDIOCODEC TYPE AUDIOCODEC SPEEX 100 AUDIOCODEC TYPE AUDIOCODEC SPEEXWB 102 AUDIOCODEC TYPE AUDIOCODEC ISACWB 103 AUDIOCODEC TYPE AUDIOCODEC ISACSWB 104 AUDIOCODEC TYPE AUDIOCODEC G7221 121 AUDIOCODEC TYPE AUDIOCODEC OPUS 105 AUDIOCODEC TYPE AUDIOCODEC DTMF 101 Audio codec type enum VIDEOCODEC TYPE int VIDEOCODEC TYPE VIDEO CODE NONE 1 VIDEOCODEC TYPE VIDEO CODEC 1420 113 VIDEOCODEC TYPE VIDEO CODEC H263 34 VIDEOCODEC TYPE VIDEO CODEC H263 1998 115 VIDEOCODEC TYPE VIDEO CODEC H264 125 VIDEOCODEC TYPE VIDEO CODEC VP 8 120 Video codec type enum VIDEO RESOLUTION int VIDEO NONE 0 VIDEO RESOLUTION VIDEO QCIF 1 VIDEO RESOLUTION VIDEO CIF 2 VIDEO RESOLUTION VIDEO YGA 3 VIDEO RESOLUTION VIDEO SVGA 4 VIDEO RESOLUTION VIDEO XVGA 5 VIDEO RESOLUTION VIDEO 720P 6 VIDEO RESOLUTION VIDEO QVGA 7 Video Resolution enum AUDIO RECORDING FILEFORMAT int AUDIO RECORDING FILEFORMAT FILEFORMAT WAVE 1 AUDIO RECORDING FILEFORMAT FILEFORMAT AMR The audio record file format enum RECORD MODE int RECORD MODE RECORD NONE 0 RECORD MODE RECORD RECYV 1 RECORD MODE RECORD SEND RECORD MODE RECORD BOTH The audio Video record mode enum CALLBACK SESSION ID int PORTSIP LOCAL MIX ID 1 PORTSIP_REMOTE_MIX_ID
12. 74 AUDIOCODEC_GSM PortSIP 74 AUDIOCODEC_ILBC PortSIP 74 AUDIOCODEC_ISACSWB PortSIP 75 AUDIOCODEC_ISACWB PortSIP 75 AUDIOCODEC_OPUS PortSIP 75 AUDIOCODEC_PCMA PortSIP 74 AUDIOCODEC_PCMU PortSIP 74 AUDIOCODEC_SPEEX PortSIP 74 AUDIOCODEC_SPEEXWB 91 PortSIP 74 AUDIOCODEC TYPE PortSIP 74 audioPlayLoopbackTest Device Manage functions 55 AUDIOSTREAM CALLBACK MODE PortSIP 76 AUDIOSTREAM LOCAL MIX PortSIP 76 AUDIOSTREAM LOCAL PER CHANNEL PortSIP 76 AUDIOSTREAM REMOTE MIX PortSIP 76 AUDIOSTREAM REMOTE PER CHANNEL PortSIP 76 call Call functions 28 Call events 58 onInviteAnswered 59 onInviteBeginingForward 60 onInviteClosed 61 onInviteConnected 60 onInviteFailure 60 onInviteIncoming 58 onInviteRinging 59 onInviteSessionProgress 59 onInviteTrying 59 onInviteUpdated 60 onRemoteHold 61 onRemoteUnHold 61 Call functions 27 answerCall 29 call 28 forwardCall 30 hangUp 29 hold 30 muteSession 30 rejectCall 28 sendDtmf 31 unHold 30 updateCall 29 clearAddExtensionHeaders Access SIP message header functions 22 clearModifyHeaders Access SIP message header functions 23 Conference functions 41 createConference 41 joinToConference 42 removeFromConference 42 setConferenceVideoWindow 41 createConference Conference functions 41 detectM wi Additional setting functions 19 Device Manage functions 52 audioPlayLoopbackTest 55 getMicVolume 55 getNumOfPlayoutDevic
13. Initialize and register functions Functions Int32 PortSIP PortSIPLib initialize TRANSPORT TYPE transportType PORTSIP LOG LEVEL logLevel String logFilePath Int32 maxCallLines String sipAgent Int32 audioDeviceLayer Int32 videoDeviceLayer Initialize the SDK void PortSIP PortSIPLib unlInitialize Un initialize the SDK and release resources Int32 PortSIP PortSIPLib setUser String userName String displayName String authName String password String locallp Int32 localSipPort String userDomain String sipServer Int32 sipServerPort String stunServer Int32 stunServerPort String outboundServer Int32 outboundServerPort Set user account info Int32 PortSIP PortSIPLib registerServer Int32 expires Int32 retryTimes Register to SIP proxy server login to server Int32 PortSIP PortSIPLib unRegisterServer Un register from the SIP proxy server Int32 PortSIP PortSIPLib setLicenseKey String key Set the license key must called before setUser function Detailed Description Initialize and register functions Function Documentation Int32 PortSIP PortSIPLib initialize TRANSPORT TYPE transportType PORTSIP LOG LEVEL ogLevel String logFilePath Int32 maxCallLines String sipAgent Int32 audioDeviceLayer Int32 videoDeviceLayer Initialize the SDK Parameters transportType Transport for SIP signaling TRANSPORT PERS is the PortSIP private transport for anti the SIP blocking it
14. Int32 KBitsAS Set the audio RTCP bandwidth parameters as the RFC3556 Int32 set VideoRtcpBandwidth Int32 sessionId Int32 BitsRR Int32 BitsRS Int32 KBitsAS Set the video RTCP bandwidth parameters as the RFC3556 Int32 setAudioQos Boolean state Int32 DSCPValue Int32 priority Set the DSCP differentiated services code point value of QoS Quality of Service for audio channel Int32 setVideoQos Boolean state Int32 DSCP Value Set the DSCP differentiated services code point value of QoS Quality of Service for video channel Int32 getNetworkStatistics Int32 sessionId out Int32 currentBufferSize out Int32 preferredBufferSize out Int32 currentPacketLossRate out Int32 currentDiscardRate out Int32 currentExpandRate out Int32 currentPreemptiveRate out Int32 currentAccelerateRate Get the in call statistics The statistics are reset after the query Int32 getAudioRtpStatistics Int32 sessionId out Int32 averageJitterMs out Int32 maxJitterMs out Int32 discardedPackets Obtain the RTP statisics of audio channel Int32 getAudioRtcpStatistics Int32 sessionId out Int32 bytesSent out Int32 packetsSent out Int32 bytesReceived out Int32 packetsReceived out Int32 sendFractionLost out Int32 sendCumulativeLost out Int32 recvFractionLost out Int32 recvCumulativeLost Obtain the RTCP statisics of audio channel Int32 getVideoRtpStatistics Int32 sessionId out Int32 bytesSent out Int32 packetsSent out Int32 bytesReceive
15. SIPCallbackEvents onRecvMessage Int32 callbackindex Int32 callbackObject Int32 sessionld String mimeType String subMimeType byte messageData Int32 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 68 messageData The received message body it s can be text or binary data messageDataLengt h The length of messageData Int32 PortSIP SIPCallbackEvents onRecvOutOfDialogMessage Int32 ca lbacklndex Int32 callbackObject String fromDisplayName String from String toDisplayName String to String mimeType String subMimeType byte messageData Int32 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 messageDataLengt The length of messageData h Int32 PortSIP SIPCallbackEvents onSendMessageSuccess Int32 callbackIndex Int32 callbackObject Int32 sessionld Int32 messageld If the message was sent succeeded in dialog
16. ede ecd iet etu tete dtes 79 Port pN Tae H NE rettet et eentenineteeteente tee Emeteenter a mte esas teeters 82 PortSIP SIPCallbackEvents eerte eene e rte remet Sano 89 MISERE 91 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 Ctt VB NET Delphi XE XCode for iOS and Mac 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 S
17. 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 addSupportedMimyT ype to do it addSupportedMimeType INFO text plain If want to receive the NOTIFY message with application media_control xml then addSupportedMimeType NOTIFY application media control xml About the mime type details please visit this website http www iana org assignments media types Access SIP message header functions Functions Int32 PortSIP PortSIPLib getExtensionHeaderValue String sipMessage String headerName StringBuilder headerValue Int32 headerValueLength Access the SIP header of SIP message Int32 PortSIP PortSIPLib addExtensionHeader String headerName String headerValue Add the extension header custom header into every outgoing SIP message Int32 PortSIP PortSIPLib clearAddExtensionHeaders Clear the added extension headers custom headers Int3
18. presence SUBSCRIBE request which received from contact Int32 PortSIP PortSIPLib presenceAcceptSubscribe Int32 subscribeld Reject a presence SUBSCRIBE request which received from contact Int32 PortSIP PortSIPLib presenceOnline Int32 subscribeld String stateText Send a NOTIFY message to contact to notify that presence status is online changed Int32 PortSIP PortSIPLib presenceOffline Int32 subscribeld Send a NOTIFY message to contact to notify that presence status is offline Detailed Description Function Documentation Int32 PortSIP PortSIPLib presenceSubscribeContact String contact String subject Send a SUBSCRIBE message for presence to a contact Parameters contact The target contact it must likes sip contact001 sip portsip com subject This subject text will be insert into the SUBSCRIBE message For example 51 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 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib presenceRejectSubscribe Int32 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
19. remote Detailed Description Function Documentation Int32 PortSIP PortSIPLib enableSendPcmStreamToRemote Int32 sessionld Boolean state Int32 streamSamplesPerSec Enable the SDK send PCM stream data to remote side from another source to instread of microphone Parameters sessionId 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 0 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 Int32 PortSIP PortSIPLib sendPcmStreamToRemote Int32 sessionid byte data Int32 dataLength 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 dataLength The size of data Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Remarks Usually we should use it like below 35 enableSendPcmStreamToRemote sessionId true 16000 sendPcmStreamToRemote sessionId data dataSize Int32 PortSIP PortSIPLib enableSendVideoStreamToRemote Int32 sessionid B
20. the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib presenceAcceptSubscribe Int32 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 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib presenceOnline Int32 subscribeld String stateText Send a NOTIFY message to contact to notify that presence status is online changed Parameters subscribeld Subscribe id when received a SUBSCRIBE request from contact the event onPresenceRecvSubscribe will be triggered the event inclues the subscribe id stateText The state text of presende online for example I m here Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib presenceOffline Int32 subscribeld Send a NOTIFY message to contact to notify that presence status is offline 52 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
21. the interface SIPCallbackEvents to process the callback events 6 Right click the project choose Properties click Build tab check the Allow unsafe code checkbox More details please read the Sample project source code Delphi 1 Download and extract the sample project 2 Create a new VCL Forms Application project 3 Copy the PortSIP sdk dll to project output directories 4 Copy the PortSIPLib folder to project folder and add into this new project More details please read the Sample project source code RAE 1 Download and extract the sample project 2 Create a new MFC Application project 3 Copy the PortSIP sdk dll to project output directories 4 Copy the include PortSIPLib folder to project folder and add the hxx files into project 5 NC ODE Dc bl Eolder stomp rosiece tolder sands leinky ss Ports iP ms cilisis rni OI I Oei 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 DES LRS 5 LOG dl 10 I IP erolleeas ayer 192 1S T 3 Enter a user name and password on A for example user name is 111 password is aaa you can enter anything for the password the SDK will ignore it Enter a user name and password on B for example user name is 222 passw
22. 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 Int32 PortSIP SIPCallbackEvents onSendMessageFailure Int32 callbackIndex Int32 callbackObject Int32 sessionld Int32 messageld String reason Int32 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 Int32 PortSIP SIPCallbackEvents onSendOutOfDialogMessageSuccess Int32 callbackindex Int32 callbackObject Int32 messageld String fromDisplayName String from String toDisplayName String 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 69 Int32 PortSIP SIPCallbackEvents onSendOutOfDialogMessageFailure Int32 callbackIndex Int32 callbackObject Int32 messageld String fromDisplayName String from String toDisplayName String to String reason Int32 code If the message was sent failure out of dialog this event
23. to contact to notify that presence status is online changed Int32 presenceOffline Int32 subscribeld Send a NOTIFY message to contact to notify that presence status is offline Int32 getNumOfRecordingDevices Gets the number of audio devices available for audio recording Int32 getNumOfPlayoutDevices Gets the number of audio devices available for audio playout Int32 getRecordingDeviceName Int32 deviceIndex StringBuilder nameUTFS Int32 nameUTF8Length Gets the name of a specific recording device given by an index Int32 getPlayoutDeviceName Int32 deviceIndex StringBuilder nameUTF8 Int32 nameUTF8Length Gets the name of a specific playout device given by an index Int32 setSpeakerVolume Int32 volume Set the speaker volume level Int32 getSpeakerVolume Gets the speaker volume level Int32 setSystemOutputMute Boolean enable Mutes the speaker device completely in the OS Boolean getSystemOutputMute Retrieves the output device mute state in the operating system Int32 setMicVolume Int32 volume Sets the microphone volume level Int32 getMicVolume Retrieves the current microphone volume Int32 setSystemInputMute Boolean enable 87 Mute the microphone input device completely in the OS Boolean getSystemInputMute Gets the mute state of the input device in the operating system void audioPlayLoopbackTest Boolean enable Use to do the audio device loop back tes
24. video Int32 PortSIP SIPCallbackEvents onInviteTrying Int32 callbackIndex Int32 callbackObject Int32 sessionld If the outgoing call was processing this event triggered Parameters sessionld The session ID of the call Int32 PortSIP SIPCallbackEvents onInviteSessionProgress Int32 callbackindex Int32 callbackObject Int32 sessionld String audioCodecNames String videoCodecNames Boolean existsEarlyMedia Boolean existsAudio Boolean exists Video Once the caller received the 183 session progress message this event will be triggered Parameters sessionld The session ID of the call audioCodecNames The matched audio codecs it s separated by if have more than one codec videoCodecNames 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 exists Video If it s true means this call include the video Int32 PortSIP SIPCallbackEvents onInviteRinging Int32 callbackIndex Int32 callbackObject Int32 sessionld String statusText Int32 statusCode 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 Int32 PortSIP SIPCallbackEvents onInviteAnswered Int32 callbackindex Int32 callbackO
25. 000 modifyHeaderValue User Agent MyTest Softphone 1 0 cleaModifyHeaders Audio and video functions Functions Int32 PortSIP PortSIPLib setAudioDeviceld Int32 recordingDeviceld Int32 playoutDeviceld Set the audio device that will use for audio call Int32 PortSIP PortSIPLib setVideoDeviceld Int32 deviceld Set the video device that will use for video call Int32 PortSIP PortSIPLib set VideoResolution VIDEO RESOLUTION resolution Set the video capture resolution 9 Int32 PortSIP PortSIPLib setVideoBitrate Int32 bitrateKbps Set the video bit rate Int32 PortSIP PortSIPLib setVideoFrameRate Int32 frameRate Set the video frame rate Int32 PortSIP PortSIPLib sendVideo Int32 sessionId Boolean sendState Send the video to remote side Int32 PortSIP PortSIPLib setVideoOrientation Int32 rotation Changing the orientation of the video 24 void PortSIP PortSIPLib setLocal VideoWindow IntPtr localVideoWindow Set the the window that using to display the local video image Int32 PortSIP PortSIPLib setRemoteVideoWindow Int32 sessionId IntPtr remoteVideoWindow Set the window for a session that using to display the received remote video image Int32 PortSIP PortSIPLib displayLocalVideo Boolean state Start stop to display the local video image Int32 PortSIP PortSIPLib setVideoNackStatus Boolean state Enable disable the NACK feature rfc6642 which help to
26. 2 enum AUDIOSTREAM CALLBACK MODE int AUDIOSTREAM NONE 0 AUDIOSTREAM CALLBACK MODE AUDIOSTREAM LOCAL MIX AUDIOSTREAM CALLBACK MODE AUDIOSTREAM LOCAL PER CHANNEL AUDIOSTREAM CALLBACK MODE AUDIOSTREAM REMOTE MIX AUDIOSTREAM CALLBACK MODE AUDIOSTREAM REMOTE PER CHANNEL The audio stream callback mode enum VIDEOSTREAM CALLBACK MODE int VIDEOSTREAM CALLBACK MODE VIDEOSTREAM NONE 0 VIDEOSTREAM CALLBACK MODE VIDEOSTREAM LOCAL 74 VIDEOSTREAM CALLBACK MODE VIDEOSTREAM REMOTE VIDEOSTREAM CALLBACK MODE VIDEOSTREAM BOTH The video stream callback mode enum PORTSIP LOG LEVEL int PORTSIP LOG NONE 1 PORTSIP LOG ERROR 1 PORTSIP LOG WARNING 2 PORTSIP LOG INFO 3 PORTSIP LOG DEBUG 4 Log level enum SRTP POLICY int SRTP POLICY SRTP POLICY NONE 0 SRTP POLICY SRTP POLICY FORCE SRTP POLICY SRTP POLICY PREFER SRTP Policy enum TRANSPORT TYPE int TRANSPORT TYPE TRANSPORT UDP 0 TRANSPORT TYPE TRANSPORT TLS TRANSPORT TYPE TRANSPORT TCP TRANSPORT TYPE TRANSPORT PERS Transport for SIP signaling enum SESSION REFRESH MODE int SESSION REFRESH MODE SESSION REFERESH UAC 0 SESSION REFRESH MODE SESSION REFERESH UAS The session refresh by UAC or UAS enum DTME METHOD DTMF METHOD DTMF RFC2833 0 DTMF METHOD DTMF INFO 1 send DTMF tone with two methods enum EC MODES
27. 2 PortSIP PortSIPLib modifyHeader Value String headerName String headerValue Modify the special SIP header value for every outgoing SIP message Int32 PortSIP PortSIPLib clearModifyHeaders Clear the modify headers value no longer modify every outgoing SIP message header values Detailed Description 22 Function Documentation Int32 PortSIP PortSIPLib getExtensionHeaderValue String sipMessage String headerName StringBuilder header Value Int32 headerValueLength Access the SIP header of SIP message Parameters sipMessage The SIP message headerName Which header want to access of the SIP message headerValue The buffer to receive header value headerValueLengt The headerValue buffer size Usually we recommended set it more than 512 h bytes Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks When got a SIP message in the onReceivedSignaling callback event and want to get SIP message header value use getExtensionHeaderValue to do it StringBuilder value new StringBuilder value Length 512 getExtensionHeaderValue message name value Int32 PortSIP PortSIPLib addExtensionHeader String headerName String headerValue Add the extension header custom header into every outgoing SIP message Parameters headerName The custom header name which will be appears in every out
28. 600 it will be inserted into SIP REGISTER message headers retryTimes The retry times if failed to refresh the registration set to lt 0 the retry will be disabled and onRegisterFailure callback triggered when retry failure Returns If the function succeeds the return value is 0 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 Int32 PortSIP PortSIPLib unRegisterServer Un register from the SIP proxy server Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setLicenseKey String key Set the license key must called before setUser function 11 Parameters key The SDK license key please purchase from PortSIP Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code NIC and local IP functions Functions Int32 PortSIP PortSIPLib getNICNums Get the Network Interface Card numbers Int32 PortSIP PortSIPLib getLocalIpAddress Int32 index StringBuilder ip Int32 ipSize Get the local IP address by Network Interface Card index Detailed Description Function Documentation Int32 PortSIP PortSIPLib getNICNums Get the Network Interface Card numbers Returns If the function suc
29. CodecParameter VIDEOCODEC TYPE codecType String parameter Set the codec parameter for video codec 82 Int32 setDisplayName String name Set user display name Int32 getVersion out Int32 majorVersion out Int32 minorVersion Get the current version number of the SDK Int32 enableReliableProvisional Boolean enable Enable disable PRACK Int32 enable3GppTags Boolean enable Enable disable the 3Gpp tags include ims icsi mmtel and g 3gpp smsip void enableCallbackSendingSignaling Boolean enable Enable disable callback the sending SIP messages Int32 setSrtpPolicy SRTP POLICY srtpPolicy Set the SRTP policy Int32 setRtpPortRange Int32 minimumRtpAudioPort Int32 maximumRtpAudioPort Int32 minimumRtpVideoPort Int32 maximumRtpVideoPort Set the RTP ports range for audio and video streaming Int32 setRtcpPortRange Int32 minimumRtcpAudioPort Int32 maximumRtcpAudioPort Int32 minimumRtcpV ideoPort Int32 maximumRtcpVideoPort Set the RTCP ports range for audio and video streaming Int32 enableCallForward Boolean forBusyOnly String forwardTo Enable call forward Int32 disableCallForward Disable the call forward the SDK is not forward any incoming call after this function is called Int32 enableSessionTimer Int32 timerSeconds SESSION REFRESH MODE refreshMode Allows to periodically refresh Session Initiation Protocol SIP sessions by sending repeated INVITE requests Int32 disableSessio
30. ER request that comes from onReceivedRefer callback event referSignalingMes The SIP message of REFER request that comes from onReceivedRefer sage callback event Returns If the function succeeds the return value is a session ID greater than 0 to the new call for REFER otherwise is a specific error code less than 0 Int32 PortSIP PortSIPLib rejectRefer Int32 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 Send audio and video stream functions Functions Int32 PortSIP PortSIPLib enableSendPcmStreamToRemote Int32 sessionId Boolean state Int32 streamSamplesPerSec Enable the SDK send PCM stream data to remote side from another source to instread of microphone Int32 PortSIP PortSIPLib sendPcmStreamToRemote Int32 sessionId byte data Int32 dataLength 34 Send the audio stream in PCM format from another source to instead of audio device capture microphone Int32 PortSIP PortSIPLib enableSendVideoStreamToRemote Int32 sessionId Boolean state Enable the SDK send video stream data to remote side from another source to instread of camera Int32 PortSIP PortSIPLib sendVideoStreamToRemote Int32 sessionId byte data Int32 dataLength Int32 width Int32 height Send the video stream to
31. Empty Audio and video codecs functions 13 joinToConference Conference functions 42 modifyHeaderValue Access SIP message header functions 23 muteMicrophone Audio and video functions 27 muteSession Call functions 30 muteSpeaker Audio and video functions 27 MWI events 64 onWaitingFaxMessage 64 onWaitingVoiceMessage 64 NIC and local IP functions 11 getLocallpAddress 11 getNICNums 11 onACTV TransferFailure Refer events 63 onACTV TransferSuccess Refer events 62 onAudioRawCallback Audio and video stream callback events 71 onInviteAnswered Call events 59 onInviteBeginingForward Call events 60 onInviteClosed Call events 61 onInviteConnected Call events 60 onInviteFailure Call events 60 onInviteIncoming Call events 58 onInviteRinging Call events 59 onInviteSessionProgress Call events 59 onInviteTrying Call events 59 onInviteUpdated Call events 60 onPlayAudioFileFinished Play audio and video file finished events 69 93 onPlayVideoFileFinished Play audio and video file finished events 69 onPresenceOffline Presence events 67 onPresenceOnline Presence events 67 onPresenceRecvSubscribe Presence events 67 onReceivedRefer Refer events 62 onReceivedRtpPacket RTP callback events 70 onReceivedSignaling Signaling events 63 onRecvDtmfTone DTMF events 65 onRecvInfo INFO OPTIONS message events 66 onRecvMessage Presence events 67 onRecvOptions INFO OPTIONS mess
32. Events onSendOutOfDialogMessageFailure Int32 callbackIndex Int32 callbackObject Int32 messageld String fromDisplayName String from String toDisplayName String to String reason Int32 code Detailed Description Function Documentation Int32 PortSIP SIPCallbackEvents onPresenceRecvSubscribe Int32 callbackIndex Int32 callbackObject Int32 subscribeld String fromDisplayName String from String subject This event will be triggered when received the SUBSCRIBE request from a contact 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 Int32 PortSIP SIPCallbackEvents onPresenceOnline Int32 callbackIndex Int32 callbackObject String fromDisplayName String from String 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 Int32 PortSIP SIPCallbackEvents onPresenceOffline Int32 callbackIndex Int32 callbackObject String fromDisplayName String 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 Int32 PortSIP
33. IOCODEC OPUS OPUS 48KHZ 32kbit s AUDIOCODEC DTMF DTMF RFC 2833 enum PortSIP VIDEOCODEC TYPE int Video codec type Enumerator VIDEO CODE NONE Not use Video codec VIDEO CODEC 1420 1420 YUV420 Raw Video format just use with startRecord VIDEO CODEC H263 H263 video codec VIDEO CODEC H263 1998 H263 H263 1998 video codec VIDEO CODEC H264 H264 video codec VIDEO CODEC VPS VP8 video code enum PortSIP VIDEO RESOLUTION int Video Resolution Enumerator VIDEO QCIF 176X144 for H 263 H 263 1998 H 264 VP8 VIDEO CIF 352X288 for H 263 H 263 1998 H 264 VP8 VIDEO_VGA 640X480 for H 264 VP8 VIDEO_SVGA 800X600 for H 264 VP8 VIDEO XVGA 1024X768 for H 264 VP8 VIDEO 720P 1280X720 for H 264 VP8 VIDEO QVGA 320X240 for H 264 VP8 enum PortSIP AUDIO RECORDING FILEFORMAT int The audio record file format Enumerator FILEFORMAT WAVE The record audio file is WAVE format FILEFORMAT AMR The record audio file is AMR format all voice data is compressed by AMR codec enum PortSIP RECORD MODE int The audio Video record mode 76 Enumerator RECORD NONE Not Record RECORD RECV Only record the received data RECORD SEND Only record send data RECORD BOTH The record audio file is WAVE format enum PortSIP AUDIOSTREAM CALLBACK MODE int The audio stream callback mode Enumerator AUDIOSTREAM LOCAL MIX Callback the audio stream from microphone for all channels AUDIOSTREAM LOCAL PER CHANNEL Callback the a
34. IP PortSIPLib enableSessionTimer Int32 timerSeconds 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 19 Returns If the function succeeds the return value is 0 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 status 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 Int32 PortSIP PortSIPLib 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 PortSIP PortSIPLib setDoNotDisturb Boolean state Enable the Do not disturb to enable disable Parameter
35. IP SIPCallbackEvents onInviteBeginingForward Int32 callbackIndex Int32 callbackObject String forwardTo Int32 PortSIP SIPCallbackEvents onInviteClosed Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 PortSIP SIPCallbackEvents onRemoteHold Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 PortSIP SIPCallbackEvents onRemoteUnHold Int32 callbackIndex Int32 callbackObject Int32 sessionId String audioCodecNames String videoCodecNames Boolean existsAudio Boolean exists Video Detailed Description Function Documentation Int32 PortSIP SIPCallbackEvents onInvitelncoming Int32 callbackIndex Int32 callbackObject Int32 sessionld String callerDisplayName String caller String 59 calleeDisplayName String callee String audioCodecNames String videoCodecNames Boolean existsAudio Boolean exists Video When the call is coming this event was triggered Parameters sessionId The session ID of the call callerDisplayNam The display name of caller e caller The caller calleeDisplayNam The display name of callee e callee The callee audioCodecNames The matched audio codecs it s separated by if have more than one codec videoCodecNames 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 exists Video If it s true means this call include the
36. Int32 callbackObject Int32 sessionld When the refer call is processing this event trigged Parameters sessionId The session ID of the call Int32 PortSIP SIPCallbackEvents onTransferRinging Int32 callbackIndex Int32 callbackObject Int32 sessionld When the refer call is ringing this event trigged Parameters sessionld The session ID of the call Int32 PortSIP SIPCallbackEvents onACTVTransferSuccess Int32 callbackindex Int32 callbackObject Int32 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 sessionId The session ID of the call 63 Int32 PortSIP SIPCallbackEvents onACTVTransferFailure Int32 callbackIndex Int32 callbackObject Int32 sessionld String reason Int32 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 Int32 PortSIP SIPCallbackEvents onReceivedSignaling Int32 callbackIndex Int32 callbackObject Int32 sessionId StringBuilder signaling Int32 Port
37. OCODEC G722 74 AUDIOCODEC G7221 75 AUDIOCODEC G729 74 AUDIOCODEC GSM 74 AUDIOCODEC ILBC 74 AUDIOCODEC ISACSWB 75 AUDIOCODEC ISACWB 75 AUDIOCODEC OPUS 75 AUDIOCODEC PCMA 74 AUDIOCODEC PCMU 74 AUDIOCODEC SPEEX 74 AUDIOCODEC SPEEXWB 74 AUDIOCODEC TYPE 74 AUDIOSTREAM CALLBACK MODE 76 AUDIOSTREAM LOCAL MIX 76 AUDIOSTREAM LOCAL PER CHANN EL 76 AUDIOSTREAM REMOTE MIX 76 AUDIOSTREAM REMOTE PER CHAN NEL 76 DTMF INFO 77 DTMF METHOD 77 DTMF RFC2833 77 FILEFORMAT AMR 75 FILEFORMAT WAVE 75 RECORD BOTH 76 RECORD MODE 75 94 RECORD NONE 76 RECORD RECV 76 RECORD SEND 76 SESSION REFERESH UAC 77 SESSION REFERESH UAS 77 SESSION REFRESH MODE 77 SRTP POLICY 76 SRTP POLICY FORCE 76 SRTP POLICY NONE 76 SRTP POLICY PREFER 76 TRANSPORT PERS 77 TRANSPORT TCP 77 TRANSPORT TLS 77 TRANSPORT TYPE 76 TRANSPORT UDP 77 VIDEO 720P 75 VIDEO CIF 75 VIDEO CODE NONE 75 VIDEO CODEC H263 75 VIDEO CODEC H263 1998 75 VIDEO CODEC H264 75 VIDEO CODEC 1420 75 VIDEO CODEC VPS 75 VIDEO QCIP 75 VIDEO QVGA 75 VIDEO RESOLUTION 75 VIDEO SVGA 75 VIDEO VGA 75 VIDEO XVGA 75 VIDEOCODEC TYPE 75 VIDEOSTREAM BOTH 76 VIDEOSTREAM CALLBACK MODE 76 VIDEOSTREAM LOCAL 76 VIDEOSTREAM NONE 76 VIDEOSTREAM_REMOTE 76 PortSIP PortSIP Errors 78 PortSIP PortSIPLib 81 PortSIP SIPCallbackEvents 88 Presence events 66 onPresenceOffline 67 onPresenceOnline 67 onPresenceRecvSubscribe 67 onRecvMessage 67 onR
38. PortNotEvenNumber 60018 static readonly int ECoreAudioVideoPortOverlapped 60019 static readonly int ECoreAudioVideoPortRangeTooSmall 60020 static readonly int ECoreAlreadyRegistered 60021 static readonly int ECoreSIPServerEmpty 60022 static readonly int ECoreExpiresValueTooSmall 60023 static readonly int ECoreCallIdNotFound 60024 static readonly int ECoreNotRegistered 60025 static readonly int ECoreCalleeEmpty 60026 static readonly int ECoreInvalidUri 60027 static readonly int ECoreAudioVideoCodecEmpty 60028 static readonly int ECoreNoFreeDialogSession 60029 static readonly int ECoreCreateAudioChannelFailed 60030 static readonly int ECoreSessionTimer ValueTooSmall 60040 static readonly int ECoreAudioHandleNull 60041 static readonly int ECoreVideoHandleNull 60042 static readonly int ECoreCallIsClosed 60043 static readonly int ECoreCallAlreadyHold 60044 static readonly int ECoreCallNotEstablished 60045 static readonly int ECoreCallNotHold 60050 static readonly int ECoreSipMessaegEmpty 60051 static readonly int ECoreSipHeaderNotExist 60052 static readonly int ECoreSipHeader ValueEmpty 60053 static readonly int ECoreSipHeaderBadFormed 60054 static readonly int ECoreBufferTooSmall 60055 static readonly int ECoreSipHeader ValueListEmpty 60056 static readonly int ECoreSipHeaderParserEmpty 60057 static readonly int ECoreSipHeader ValueListNull 60058 st
39. PortSIP VolP SDK Manual for Windows Version 11 2 2 3 23 2015 Table of Contents Welcome to the PortSIP VoIP SDK sese eee 3 Moodie FI TTT 6 Namespace Index x i iu estende pete IR PER ERE eret e EE ETE ERE tte ere EU RUE e Eee Red 7 GI EGISSET TERRENCE E E EEEE A E 8 Module Documentation T 9 SDE SET ERE RR 9 Initialize and register functions sess nent trennen eren rennen entente trennen 9 NIC and local IP functions eeeeeeeeeeeeennn n e nne nnn nnnm na nnne nnns usn ese nsi nsn nsn nsns ins 12 Audio and video codecs functions essien esris oireen eene eene nnn nnne rnnt nennen 13 Additional settmp functions etie I teet e beer ee Pub dite eee tus 15 Access SIP message header functions essseeseeeeseeeeeneeee nennen trennen rennen enne 22 Audio and video functions 3e teet eere aaa en tr de ete petet rete ee ior 24 CallsfinCt Ons A RR RR EERE EEE 28 Retet futnictIons z eret eee eei tete eet tetenetediee tr de ete petiit reete redes 33 Send audio and video stream functions eeeeeseseeseeee eene e e emen nennen ese ese e e nsns e esses ases ee 34 RTP packets Audio stream and video stream callback functions sss ee ee eee eee eee 36 Record fUNCtiONnS ERE RIDE T E E SEEE EER ESEESE ES re STEE E DE ESSE PER ESEE Eisers 38 Play audio and video file to remoe functions essere nennen menn 39 Conference functions eeeeeeseseeseseeeeennnn e e e e e enn nnne nnns erete
40. SIP PortSIPLib playVideoFileToRemote Int32 sessionld String fileName Boolean loop Boolean playAudio Play an AVI file to remote party Parameters sessionId Session ID of the call fileName The file full path name such as c 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 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib stopPlayVideoFileToRemote Int32 sessionld Stop play video 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 Int32 PortSIP PortSIPLib play AudioFileToRemote Int32 sessionld String fileName Int32 fileSamplesPerSec Boolean loop Play an wave file to remote party 40 Parameters sessionld Session ID of the call fileName The file full path name such as c West 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 c
41. SIP SIPCallbackEvents onSendingSignaling Int32 callbackIndex Int32 callbackObject Int32 sessionId StringBuilder signaling Detailed Description Function Documentation Int32 PortSIP SIPCallbackEvents onReceivedSignaling Int32 callbackIndex Int32 callbackObject Int32 sessionld StringBuilder signaling This event will be triggered when received a SIP message Parameters sessionld The session ID of the call signaling The SIP message which is received Int32 PortSIP SIPCallbackEvents onSendingSignaling Int32 callbackIndex Int32 callbackObject Int32 sessionld StringBuilder signaling This event will be triggered when sent a SIP message Parameters sessionld The session ID of the call signaling The SIP message which is sent 64 MWI events Functions Int32 PortSIP SIPCallbackEvents onWaitingVoiceMessage Int32 callbackIndex Int32 callbackObject String messageAccount Int32 urgentNewMessageCount Int32 urgentOldMessageCount Int32 newMessageCount Int32 oldMessageCount Int32 PortSIP SIPCallbackEvents onWaitingFaxMessage Int32 callbackIndex Int32 callbackObject String messageAccount Int32 urgentNewMessageCount Int32 urgentOldMessageCount Int32 newMessageCount Int32 oldMessageCount Detailed Description Function Documentation Int32 PortSIP SIPCallbackEvents onWaitingVoiceMessage Int32 callbackindex Int32 callbackObject String messageAccou
42. StringBuilder optionsMessage Int32 onRecvInfo Int32 callbackIndex Int32 callbackObject StringBuilder infoMessage Int32 onPresenceRecvSubscribe Int32 callbackIndex Int32 callbackObject Int32 subscribeld String fromDisplayName String from String subject 89 Int32 onPresenceOnline Int32 callbackIndex Int32 callbackObject String fromDisplayName String from String stateText Int32 onPresenceOffline Int32 callbackIndex Int32 callbackObject String fromDisplayName String from Int32 onRecvMessage Int32 callbackIndex Int32 callbackObject Int32 sessionId String mimeType String subMimeType byte messageData Int32 messageDataLength Int32 onRecvOutOfDialogMessage Int32 callbackIndex Int32 callbackObject String fromDisplayName String from String toDisplayName String to String mimeType String subMimeType byte messageData Int32 messageDataLength Int32 onSendMessageSuccess Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 messageld Int32 onSendMessageFailure Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 messageld String reason Int32 code Int32 onSendOutOfDialogMessageSuccess Int32 callbackIndex Int32 callbackObject Int32 messageld String fromDisplayName String from String toDisplayName String to Int32 onSendOutOfDialogMessageFailure Int32 callbackIndex Int32 callbackObject Int32 messageld String fromDisplayName String from String t
43. The video rotation that you want to set 0 90 180 270 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code void PortSIP PortSIPLib setLocalVideoWindow IntPtr local VideoWindow Set the the window that using to display the local video image Parameters localVideoWindow The window to display local video image from camera Int32 PortSIP PortSIPLib setRemoteVideoWindow Int32 sessionid IntPtr remoteVideoWindow Set the window for a session that using to display the received remote video image Parameters sessionId The session ID of the call remoteVideoWindo The window to display received remote video image w Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib displayLocalVideo Boolean 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 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setVideoNackStatus Boolean state Enable disable the NACK feature rfc6642 which help to improve the video quatliy 27 Parameters state state Set to true to enable Returns If the function succeeds the return value is 0 If the function fails the re
44. Tone 60085 static readonly int ECoreWrongLicenseKey 60086 static readonly int ECoreTrialVersionLicenseKey 60087 static readonly int ECoreOutgoingAudioMuted 60088 static readonly int ECoreOutgoing VideoMuted 60089 static readonly int EAudioFileNameEmpty 70000 static readonly int EAudioChannelNotFound 70001 static readonly int EAudioStartRecordFailure 70002 static readonly int EAudioRegister RecodingFailure 70003 static readonly int EAudioRegister PlaybackFailure 70004 static readonly int EAudioGetStatisticsFailure 70005 static readonly int EAudioIsPlaying 70006 static readonly int EAudioPlayObjectNotExist 70007 static readonly int EAudioPlaySteamNotEnabled 70008 static readonly int EAudioRegisterCallbackFailure 70009 static readonly int EAudioCreateA udioConferenceFailure 70010 static readonly int EAudioOpenPlayFileFailure 70011 static readonly int EAudioPlayFileModeNotSupport 70012 static readonly int EAudioPlayFileFormatNotSupport 70013 static readonly int EAudioPlaySteamAlreadyEnabled 70014 static readonly int EAudioCreateRecordFileFailure 70015 static readonly int EAudioCodecNotSupport 70016 static readonly int EAudioPlayFileNotEnabled 70017 static readonly int EAudioPlayFileUnknowSeekOrigin 70018 static readonly int EAudioCantSetDeviceIdDuringCall 70019 static readonly int EVideoFileNameEmpty 80000 static readonly int EVideoGetDeviceNameFailure 80001
45. UAS Enumerator SESSION REFERESH UAC The session refresh by UAC SESSION REFERESH UAS The session refresh by UAS enum PortSIP DTMF METHOD send DTMF tone with two methods Enumerator DTMF RFC2833 send DTMF tone with RFC 2833 recommend DTMF INFO send DTMF tone with SIP INFO 78 Class Documentation PortSIP PortSIP Errors Class Reference Static Public Attributes static readonly int INVALID SESSION ID 1 static readonly int ECoreAlreadyInitialized 60000 static readonly int ECoreNotInitialized 60001 static readonly int ECoreSDKObjectNull 60002 static readonly int ECoreArgumentNull 60003 static readonly int ECorelInitializeWinsockFailure 60004 static readonly int ECoreUserNameAuthNameEmpty 60005 static readonly int ECorelInitiazeStackFailure 60006 static readonly int ECorePortOutOfRange 60007 static readonly int ECoreAddTcpTransportFailure 60008 static readonly int ECoreAddTIsTransportFailure 60009 static readonly int ECoreAddUdpTransportFailure 60010 static readonly int ECoreMiniAudioPortOutOfRange 60011 static readonly int ECoreMaxAudioPortOutOfRange 60012 static readonly int ECoreMiniVideoPortOutOfRange 60013 static readonly int ECoreMaxVideoPortOutOfRange 60014 static readonly int ECoreMiniAudioPortNotEvenNumber 60015 static readonly int ECoreMaxAudioPortNotEvenNumber 60016 static readonly int ECoreMiniVideoPortNotEvenNumber 60017 static readonly int ECoreMaxVideo
46. age events 66 onRecvOutOfDialogMessage Presence events 68 onReferAccepted Refer events 62 onReferRejected Refer events 62 onRegisterFailure Register events 58 onRegisterSuccess Register events 57 onRemoteHold Call events 61 onRemoteUnHold Call events 61 onSendingRtpPacket RTP callback events 70 onSendingSignaling Signaling events 63 onSendMessageFailure Presence events 68 onSendMessageSuccess Presence events 68 onSendOutOfDialogMessageFailure Presence events 69 onSendOutOfDialogMessageSuccess Presence events 68 onTransferRinging Refer events 62 onTransferTrying Refer events 62 onVideoRawCallback Audio and video stream callback events 71 onWaitingFaxMessage MWI events 64 onWaitingVoiceMessage MWI events 64 Play audio and video file finished events 69 onPlayAudioFileFinished 69 onPlayVideoFileFinished 69 Play audio and video file to remoe functions 38 playAudioFileToRemote 39 playAudioFileToRemoteAsBackground 40 playVideoFileToRemote 39 stopPlay AudioFileToRemote 40 stopPlayAudioFileToRemoteAsBackground 40 stopPlayVideoFileToRemote 39 play AudioFileToRemote Play audio and video file to remoe functions 39 play AudioFileToRemoteAsBackground Play audio and video file to remoe functions 40 playVideoFileToRemote Play audio and video file to remoe functions 39 PortSIP 73 AUDIO RECORDING FILEFORMAT 75 AUDIOCODEC AMR 74 AUDIOCODEC AMRWB 74 AUDIOCODEC DTMF 75 AUDI
47. allback functions 35 enableAudioStreamCallback 36 enableVideoStreamCallback 37 setRtpCallback 36 RTP statistics functions 44 getAudioRtcpStatistics 45 getAudioRtpStatistics 45 getNetworkStatistics 44 getVideoRtpStatistics 46 SDK Callback events 57 SDK functions 8 Send audio and video stream functions 33 enableSendPcmStreamToRemote 34 enableSendVideoStreamToRemote 35 sendPcmStreamToRemote 34 sendVideoStreamToRemote 35 Send OPTIONS INFO MESS AGE functions 48 sendInfo 49 sendMessage 49 sendOptions 48 sendOutOfDialogMessage 49 sendDtmf Call functions 31 sendInfo Send OPTIONS INFO MESSAGE functions 49 sendMessage Send OPTIONS INFO MESSAGE functions 49 sendOptions Send OPTIONS INFO MESSAGE functions 48 sendOutOfDialogMessage Send OPTIONS INFO MESSAGE functions 49 sendPcmStreamToRemote Send audio and video stream functions 34 sendVideo Audio and video functions 25 send VideoStreamToRemote Send audio and video stream functions 35 SESSION_REFERESH_UAC PortSIP 77 SESSION_REFERESH_UAS PortSIP 77 SESSION REFRESH MODE PortSIP 77 setAudioCodecParameter Audio and video codecs functions 14 setAudioCodecPayloadType Audio and video codecs functions 13 setAudioDeviceld Audio and video functions 24 setAudioQos RTP and RTCP QOS functions 43 setAudioRtcpBandwidth RTP and RTCP QOS functions 43 setAudioSamples Additional setting functions 20 setConferenceVideoWindow Conference functions 41 s
48. alse Int32 PortSIP PortSIPLib setAudioCodecPayloadType AUDIOCODEC TYPE codecType Int32 payloadType Set the RTP payload type for dynamic audio codec Parameters 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 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setVideoCodecPayloadType VIDEOCODEC TYPE codecType Int32 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 14 Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setAudioCodecParameter AUDIOCODEC TYPE codecType String 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 setAudioCodecParameter AUDIOCODEC AMR mode set 0 octet align 1 robust sorting 0 Int32 PortSIP PortSIPLib setVideoCodecParameter VIDEOCODEC TYPE codecType Strin
49. atic readonly int ECoreSipHeaderNameEmpty 60059 79 static readonly int ECoreAudioSampleNotmultiple 60060 static readonly int ECoreAudioSampleOutOfRange 60061 static readonly int ECoreInviteSessionNotFound 60062 static readonly int ECoreStackException 60063 static readonly int ECoreMimeTypeUnknown 60064 static readonly int ECoreDataSizeTooLarge 60065 static readonly int ECoreSessionNumsOutOfRange 60066 static readonly int ECoreNotSupportCallbackMode 60067 static readonly int ECoreNotFoundSubscribeld 60068 static readonly int ECoreCodecNotSupport 60069 static readonly int ECoreCodecParameterNotSupport 60070 static readonly int ECorePayloadOutofRange 60071 static readonly int ECorePayloadHasExist 60072 static readonly int ECoreFixPayloadCantChange 60073 static readonly int ECoreCodecTypelInvalid 60074 static readonly int ECoreCodecWasExist 60075 static readonly int ECorePayloadTypelnvalid 60076 static readonly int ECoreArgumentTooLong 60077 static readonly int ECoreMiniRtpPortMustIsEvenNum 60078 static readonly int ECoreCallInHold 60079 static readonly int ECoreNotIncomingCall 60080 static readonly int ECoreCreateMediaEngineF ailure 60081 static readonly int ECoreAudioCodecEmptyButAudioEnabled 60082 static readonly int ECoreVideoCodecEmptyButVideoEnabled 60083 static readonly int ECoreNetworkInterfaceUnavailable 60084 static readonly int ECoreWrongDTMF
50. b updateCall Int32 sessionId bool enable Audio bool enableVideo Use the re INVITE to update the established call Int32 PortSIP PortSIPLib hold Int32 sessionId To place a call on hold Int32 PortSIP PortSIPLib unHold Int32 sessionId Take off hold Int32 PortSIP PortSIPLib muteSession Int32 sessionId Boolean muteIncomingAudio Boolean muteOutgoingAudio Boolean muteIncoming Video Boolean muteOutgoing Video Mute the specified session audio or video Int32 PortSIP PortSIPLib forwardCall Int32 sessionId String forwardTo Forward call to another one when received the incoming call Int32 PortSIP PortSIPLib sendDtmf Int32 sessionId DIMF METHOD dtmfMethod int code int dtmfDuration bool playDtmfTone Send DTMF tone Detailed Description Function Documentation Int32 PortSIP PortSIPLib call String callee Boolean sendSdp Boolean 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 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 at least one video codec was added then the outgoing call 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 ret
51. bject Int32 sessionld String callerDisplayName String caller String calleeDisplayName String callee String audioCodecNames String videoCodecNames Boolean existsAudio Boolean existsVideo If the remote party was answered the call this event triggered 60 Parameters sessionld The session ID of the call callerDisplayNam e The display name of caller audioCodecNames caller The caller calleeDisplayNam The display name of callee e callee The callee The matched audio codecs it s separated by if have more than one codec videoCodecNames The matched video codecs it s separated by if have more than one codec existsAudio existsVideo If it s true means this call include the audio If it s true means this call include the video Int32 PortSIP SIPCallbackEvents onInviteFailure Int32 callbackIndex Int32 callbackObject Int32 sessionld String reason Int32 code If the outgoing call is fails this event triggered Parameters sessionld The session ID of the call reason The failure reason code The failure code Int32 PortSIP SIPCallbackEvents onInviteUpdated Int32 callbackIndex Int32 callbackObject Int32 sessionld String audioCodecNames String videoCodecNames Boolean existsAudio Boolean exists Video This event will be triggered when remote party updated this call Parameters sessionld The session ID of the call a
52. cecseseececsuseeceesaeeecenseeeeseeeecseueeecseaeeeess 13 Additional setting functions ioo en oem ite Dette e ERR Here tere e large 15 Access SIP message header functions essere nennen nennen 22 Audio and RT eae sle 24 CallfunctioD8 4u ani ascen AS tate eai ai eee E Iris 28 Refer functidiis inten op epe epe ne Dec 33 Send audio and video stream functions eee rennen enne enne nre 34 RTP packets Audio stream and video stream callback unctOong sss sees eee eee 36 Record f nctions emen etie eR ee RH EU EIL eds 38 Play audio and video file to remoe functions nennen nenne 39 Conference T nctiols ee pecie p eee cg dee i ee beet petet 42 RTP and RTCP QOS functions sssssssssessseeeen eene eEG nennen ek aee ar enne nnne rsen nns 43 RTP statistics functions ui i err iter ped tee Dee ee PU edo e pde GE s Eee greed 45 Audio effect functions sacs era rp eere ree Eden 47 Send OPTIONS INFO MESS AGE functions eese enne enne nennen nnne enn 49 Presence Da aTe no a EEEE EE EE EE E EE E E E EEE 51 Device Manage functions echte erri rri reor EEES erre aree Tee PE orbe o EEEE 53 SDK Callback events eerie TER ere a a rape Eel ebd 58 Register Eventis sitaria e e ete o diete pr anie e Fe been steed 58 Call events can nSeadcna eM I diem e entia ee 59 Refer events ssh AnHERSGSaDeSPeneD RU RRUBIURIRODGERU eR E EST 62 Signaling evebts i i sene ER RI Rr ti e ue aped este eie Rc 64 MW e
53. ceeds the return value is NIC numbers gt 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib getLocallp Address Int32 index StringBuilder ip Int32 ipSize 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 0 ip The buffer that to receives the IP ipSize The IP buffer size don t let it less than 32 bytes Returns If the function succeeds the return value isO If the function fails the return value is a specific error code 12 Audio and video codecs functions Functions Int32 PortSIP PortSIPLib addAudioCodec AUDIOCODEC TYPE codecType Enable an audio codec it will be appears in SDP Int32 PortSIP PortSIPLib addVideoCodec VIDEOCODEC TYPE codecType Enable a video codec it will be appears in SDP Boolean PortSIP PortSIPLib isAudioCodecEmpty Detect enabled audio codecs is empty or not Boolean PortSIP PortSIPLib isVideoCodecEmpty Detect enabled video codecs is empty or not Int32 PortSIP PortSIPLib setAudioCodecPayloadType AUDIOCODEC TYPE codecType Int32 payloadType Set the RTP payload type for dynamic audio codec Int32 PortSIP PortSIPLib setVideoCodecPayloadType VIDEOCODEC TYPE codecType Int32 payloadType Set the RTP payload type for dynamic Video codec vo
54. ckEvents onReceivedRtpPacket IntPtr callbackObject Int32 sessionId Boolean isAudio byte RTPPacket Int32 packetSize Int32 PortSIP SIPCallbackEvents onSendingRtpPacket IntPtr callbackObject Int32 sessionId Boolean isAudio byte RTPPacket Int32 packetSize Detailed Description Function Documentation Int32 PortSIP SIPCallbackEvents onReceivedRtpPacket IntPtr callbackObject Int32 sessionld Boolean isAudio byte RTPPacket Int32 packetSize If called setRTPCallback function to enabled the RTP callback this event will be triggered once received a RTP packet Parameters sessionld 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 Int32 PortSIP SIPCallbackEvents onSendingRtpPacket IntPtr callbackObject Int32 sessionld Boolean isAudio byte RTPPacket Int32 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
55. d out Int32 packetsReceived Obtain the RTP statisics of video void enableV AD Boolean state Enable disable Voice Activity Detection VAD void enableAEC EC MODES ecMode Enable disable AEC Acoustic Echo Cancellation void enableCNG Boolean state 86 Enable disable Comfort Noise Generator CNG void enableAGC AGC MODES agcMode Enable disable Automatic Gain Control AGC void enableANS NS MODES nsMode Enable disable Audio Noise Suppression ANS Int32 sendOptions String to String sdp Send OPTIONS message Int32 sendInfo Int32 sessionId String mimeType String subMimeType String infoContents Send a INFO message to remote side in dialog Int32 sendMessage Int32 sessionId String mimeType String subMimeType byte message Int32 messageLength Send a MESSAGE message to remote side in dialog Int32 sendOutOfDialogMessage String to String mimeType String subMimeType byte message Int32 messageLength Send a out of dialog MESSAGE message to remote side Int32 presenceSubscribeContact String contact String subject Send a SUBSCRIBE message for presence to a contact Int32 presenceRejectSubscribe Int32 subscribeld Accept the presence SUBSCRIBE request which received from contact Int32 presenceAcceptSubscribe Int32 subscribeld Reject a presence SUBSCRIBE request which received from contact Int32 presenceOnline Int32 subscribeld String stateText Send a NOTIFY message
56. d video send video both received and send Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib stopRecord Int32 sessionld 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 Int32 PortSIP PortSIPLib playVideoFileToRemote Int32 sessionId String fileName Boolean loop Boolean playAudio Play an AVI file to remote party Int32 PortSIP PortSIPLib stopPlayVideoFileToRemote Int32 sessionId Stop play video file to remote side Int32 PortSIP PortSIPLib playAudioFileToRemote Int32 sessionId String fileName Int32 fileSamplesPerSec Boolean loop Play an wave file to remote party 39 Int32 PortSIP PortSIPLib stopPlayAudioFileToRemote Int32 sessionId Stop play wave file to remote side Int32 PortSIP PortSIPLib play AudioFileToRemoteAsBackground Int32 sessionId String fileName Int32 fileSamplesPerSec Play an wave file to remote party as conversation background sound Int32 PortSIP PortSIPLib stopPlayAudioFileToRemoteAsBackground Int32 sessionId Stop play an wave file to remote party as conversation background sound Detailed Description Function Documentation Int32 Port
57. de The DTMF tone 0 16 code Description 0 The DTMF tone 0 1 The DTMF tone 1 2 The DTMF tone 2 3 The DTMF tone 3 4 The DTMF tone 4 5 The DTMF tone 5 6 The DTMF tone 6 7 The DTMF tone 7 The DTMF tone 8 9 The DTMF tone 9 10 The DTMF tone 11 The DTMF tone 12 The DTMF tone A 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 If the function succeeds the return value is 0 If the function fails the return value is a specific error code 32 Refer functions Functions Int32 PortSIP PortSIPLib refer Int32 sessionId String referTo Refer the currently call to another one Int32 PortSIP PortSIPLib attendedRefer Int32 sessionId Int32 replaceSessionld String referTo Make an attended refer Int32 PortSIP PortSIPLib acceptRefer Int32 referld String referSignalingMessage Accept the REFER request a new call will be make if called this function usuall called after onReceivedRefer callback event Int32 PortSIP PortSIPLib rejectRefer Int32 referId Reject the REFER request Detailed Description Function Documentation Int32 PortSIP PortSIPLib refer Int32 sessionld String referTo Refer the currently call to another one Parameters sessionld The session ID of the call referTo Target
58. e is a specific error code Remarks the onVideoRawCallback event will be triggered if the callback is enabled Record functions Functions Int32 PortSIP PortSIPLib startRecord Int32 sessionId String recordFilePath String recordFileName Boolean appendTimestamp AUDIO RECORDING FILEFORMAT audioFileFormat RECORD MODE audioRecordMode VIDEOCODEC TYPE videoFileCodecType RECORD MODE videoRecordMode Start record the call Int32 PortSIP PortSIPLib stopRecord Int32 sessionId Stop record Detailed Description 38 Function Documentation Int32 PortSIP PortSIPLib startRecord Int32 sessionld String recordFilePath String recordFileName Boolean appendTimestamp AUDIO RECORDING FILEFORMAT audioFileFormat RECORD MODE audioRecordMode VIDEOCODEC TYPE videoFileCodecType RECORD MODE videoRecordMode Start record the call Parameters sessionld 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 videoFileCodecTy The codec which using for compress the video data to save into video record pe file videoRecordMode Allow set video record mode support record receive
59. ecvOutOfDialogMessage 68 onSendMessageFailure 68 onSendMessageSuccess 68 onSendOutOfDialogMessageFailure 69 onSendOutOfDialogMessageSuccess 68 Presence functions 50 presenceAcceptSubscribe 51 presenceOffline 51 presenceOnline 51 presenceRejectSubscribe 51 presenceSubscribeContact 50 presenceAcceptSubscribe Presence functions 51 presenceOffline Presence functions 51 presenceOnline Presence functions 51 presenceRejectSubscribe Presence functions 51 presenceSubscribeContact Presence functions 50 Record functions 37 startRecord 38 stopRecord 38 RECORD BOTH PortSIP 76 RECORD MODE PortSIP 75 RECORD NONE PortSIP 76 RECORD RECV PortSIP 76 RECORD SEND PortSIP 76 refer Refer functions 32 Refer events 61 onACTV TransferFailure 63 onACTV TransferSuccess 62 onReceivedRefer 62 onReferAccepted 62 onReferRejected 62 onTransferRinging 62 onTransferTrying 62 Refer functions 32 acceptRefer 33 attendedRefer 32 refer 32 rejectRefer 33 Register events 57 onRegisterFailure 58 onRegisterSuccess 57 registerServer Initialize and register functions 10 rejectCall Call functions 28 rejectRefer Refer functions 33 removeFromConference Conference functions 42 RTP and RTCP QOS functions 42 setAudioQos 43 setAudioRtcpBandwidth 43 setVideoQos 43 setVideoRtcpBandwidth 43 RTP callback events 70 onReceivedRtpPacket 70 onSendingRtpPacket 70 95 RTP packets Audio stream and video stream c
60. eld Int32 recordingDeviceld Int32 playoutDeviceld Set the audio device that will use for audio call Int32 setVideoDeviceld Int32 deviceld Set the video device that will use for video call Int32 setVideoResolution VIDEO RESOLUTION resolution Set the video capture resolution Int32 setVideoBitrate Int32 bitrateKbps Set the video bit rate Int32 setVideoFrameRate Int32 frameRate Set the video frame rate Int32 sendVideo Int32 sessionId Boolean sendState Send the video to remote side Int32 setVideoOrientation Int32 rotation Changing the orientation of the video void setLocalVideoWindow IntPtr local VideoWindow Set the the window that using to display the local video image Int32 setRemoteVideoWindow Int32 sessionId IntPtr remote VideoWindow Set the window for a session that using to display the received remote video image Int32 displayLocalVideo Boolean state Start stop to display the local video image Int32 setVideoNackStatus Boolean state Enable disable the NACK feature rfc6642 which help to improve the video quatliy void muteMicrophone Boolean mute Mute the device microphone it s unavailable for Android and iOS void muteSpeaker Boolean mute Mute the device speaker it s unavailable for Android and iOS void getDynamicVolumeLevel out Int32 speakerVolume out Int32 microphoneVolume Obtain the dynamic microphone volume level from current call Int32 call
61. emote Int32 sessionId String fileName Boolean loop Boolean plav Audio Play an AVI file to remote party Int32 stopPlayVideoFileToRemote Int32 sessionId Stop play video file to remote side 85 Int32 playAudioFileToRemote Int32 sessionld String fileName Int32 fileSamplesPerSec Boolean loop Play an wave file to remote party Int32 stopPlayAudioFileToRemote Int32 sessionId Stop play wave file to remote side Int32 playAudioFileToRemoteAsBackground Int32 sessionld String fileName Int32 fileSamplesPerSec Play an wave file to remote party as conversation background sound Int32 stopPlayAudioFileToRemoteAsBackground Int32 sessionId Stop play an wave file to remote party as conversation background sound Int32 createConference IntPtr conference VideoWindow VIDEO RESOLUTION videoResolution Boolean displayLocal VideoInConference Create a conference It s failures if the exists conference isn t destroy yet void destroyConference Destroy the exist conference Int32 setConference VideoWindow IntPtr videoWindow Set the window for a conference that using to display the received remote video image Int32 joinToConference Int32 sessionId Join a session into exist conference if the call is in hold it will be un hold automatically Int32 removeFromConference Int32 sessionId Remove a session from an exist conference Int32 setAudioRtcpBandwidth Int32 sessionId Int32 BitsRR Int32 BitsRS
62. eo Mute the specified session audio or video Parameters sessionId The session ID of the call muteIncomingAudi Set it to true to mute incoming audio stredam can t hearing remote side audio 0 muteOutgoingAudi Set it to true to mute outgoing audio stredam the remote side can t hearing 0 audio muteIncomingVide Setitto 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 video 0 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib forwardCall Int32 sessionld String forwardTo Forward call to another one when received the incoming call 3l Parameters sessionld The session ID of the call forwardTo Target of the forward it can be sip number Gsipserver 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 Int32 PortSIP PortSIPLib sendDtmf Int32 sessionld DTIMF METHOD dtmfMethod int code int dtmfDuration bool playDtmfTone Send DTMF tone Parameters sessionld The session ID of the call dtmfMethod Support send DTMF tone with two methods DIMF_RFC2833 and DTMF INFO The DTMF RFC2833 is recommend co
63. es 53 getNumOfRecordingDevices 53 getNumOfVideoCaptureDevices 56 getPlayoutDeviceName 53 getRecordingDeviceName 53 getSpeakerVolume 54 getSystemInputMute 55 getSystemOutputMute 54 getVideoCaptureDeviceName 56 setMicVolume 55 setSpeakerVolume 54 setSystemInputMute 55 setSystemOutputMute 54 showVideoCaptureSettingsDialogBox 56 disableCallForward Additional setting functions 18 disableSessionTimer Additional setting functions 19 displayLocalVideo Audio and video functions 26 DTMF events 65 onRecvDtmfTone 65 DTMF_INFO PortSIP 77 DTMF_METHOD PortSIP 77 DTMF_RFC2833 PortSIP 77 enable3GppTags Additional setting functions 16 enableAEC Audio effect functions 47 enableAGC Audio effect functions 47 enableANS Audio effect functions 47 enableAudioStreamCallback RTP packets Audio stream and video stream callback functions 36 enableCallbackSendingSignaling Additional setting functions 17 enableCallForward Additional setting functions 18 enableCheckMwi Additional setting functions 19 enableCNG Audio effect functions 47 enableReliableProvisional Additional setting functions 16 enableSendPcmStreamToRemote Send audio and video stream functions 34 enableSendVideoStreamToRemote Send audio and video stream functions 35 enableSessionTimer Additional setting functions 18 92 enableVAD Audio effect functions 46 enableVideoStreamCallback RTP packets Audio stream and video stream callback function
64. essionId The session ID of the call Int32 PortSIP SIPCallbackEvents onRemoteUnHold Int32 callbackindex int32 callbackObject Int32 sessionld String audioCodecNames String videoCodecNames Boolean existsAudio Boolean exists Video If the remote side was un hold the call this event triggered Parameters sessionId The session ID of the call audioCodecNames The matched audio codecs it s separated by if have more than one codec videoCodecNames 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 Refer events Functions Int32 PortSIP SIPCallbackEvents onReceivedRefer Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 referld String to String from String referSipMessage Int32 PortSIP SIPCallbackEvents onRefer Accepted Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 PortSIP SIPCallbackEvents onReferRejected Int32 callbackIndex Int32 callbackObject Int32 sessionld String reason Int32 code Int32 PortSIP SIPCallbackEvents onTransferTrying Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 PortSIP SIPCallbackEvents onTransferRinging Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 PortSIP SIPCallbackEvents onACTV TransferSuccess Int32 callbackI
65. etDisplayName Additional setting functions 16 setDoNotDisturb Additional setting functions 19 setKeepAliveTime Additional setting functions 20 setLicenseKey Initialize and register functions 10 setLocalVideoWindow Audio and video functions 26 setMicVolume Device Manage functions 55 setRemoteVideoWindow Audio and video functions 26 setRtcpPortRange Additional setting functions 17 setRtpCallback RTP packets Audio stream and video stream callback functions 36 setRtpKeepAlive Additional setting functions 20 setRtpPortRange Additional setting functions 17 setSpeakerVolume Device Manage functions 54 setSrtpPolicy Additional setting functions 17 setSystemInputMute Device Manage functions 55 setSystemOutputMute Device Manage functions 54 setUser Initialize and register functions 9 setVideoBitrate Audio and video functions 25 setVideoCodecParameter Audio and video codecs functions 14 setVideoCodecPayloadType Audio and video codecs functions 13 setVideoDeviceld Audio and video functions 24 setVideoFrameRate Audio and video functions 25 setVideoNackStatus Audio and video functions 26 setVideoOrientation Audio and video functions 26 set VideoQos RTP and RTCP QOS functions 43 setVideoResolution 96 Audio and video functions 25 setVideoRtcpBandwidth RTP and RTCP QOS functions 43 showVideoCaptureSettingsDialogBox Device Manage functions 56 Signaling events 63 onReceivedSig
66. function succeeds the return value is 0 If the function fails the return value is a specific error code Device Manage functions Functions Int32 PortSIP PortSIPLib getNumOfRecordingDevices Gets the number of audio devices available for audio recording Int32 PortSIP PortSIPLib getNumOfPlayoutDevices Gets the number of audio devices available for audio playout Int32 PortSIP PortSIPLib getRecordingDeviceName Int32 deviceIndex StringBuilder nameUTF8 Int32 nameUTF8Length Gets the name of a specific recording device given by an index Int32 PortSIP PortSIPLib getPlayoutDeviceName Int32 deviceIndex StringBuilder nameUTFS Int32 nameUTF8Length Gets the name of a specific playout device given by an index Int32 PortSIP PortSIPLib setSpeakerVolume Int32 volume Set the speaker volume level Int32 PortSIP PortSIPLib getSpeakerVolume Gets the speaker volume level Int32 PortSIP PortSIPLib setSystemOutputMute Boolean enable Mutes the speaker device completely in the OS Boolean PortSIP PortSIPLib getSystemOutputMute Retrieves the output device mute state in the operating system Int32 PortSIP PortSIPLib setMic Volume Int32 volume Sets the microphone volume level Int32 PortSIP PortSIPLib getMicVolume Retrieves the current microphone volume nt32 PortSIP PortSIPLib setSystemInputMute Boolean enable Mute the microphone input device comp
67. g parameter Set the codec parameter for video codec Parameters codecType Video codec type defined in the PortSIPTypes file parameter The parameter in string format Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Remarks Example setVideoCodecParameter VIDEO CODEC H264 profile level id 420033 packetization mode 0 Additional setting functions Functions Int32 PortSIP PortSIPLib setDisplayName String name Set user display name Int32 PortSIP PortSIPLib getVersion out Int32 majorVersion out Int32 minorVersion Get the current version number of the SDK Int32 PortSIP PortSIPLib enableReliableProvisional Boolean enable 15 Enable disable PRACK Int32 PortSIP PortSIPLib enable3GppTags Boolean enable Enable disable the 3Gpp tags include ims icsi mmtel and g 3gpp smsip void PortSIP PortSIPLib enableCallbackSendingSignaling Boolean enable Enable disable callback the sending SIP messages Int32 PortSIP PortSIPLib setSrtpPolicy SRTP_POLICY srtpPolicy Set the SRTP policy nt32 PortSIP PortSIPLib setRtpPortRange Int32 minimumRtpAudioPort Int32 maximumRtpAudioPort Int32 minimumRtpVideoPort Int32 maximumRtpVideoPort Set the RTP ports range for audio and video streaming Int32 PortSIP PortSIPLib setRtcpPortRange Int32 minimumRtcpAudioPort Int32 maximumRtcpAudi
68. going 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 Int32 PortSIP PortSIPLib 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 addExtensionHeader Blling usd100 00 addExtensionHeader ServiceId 8873456 23 clearAddextensionHeaders Int32 PortSIP PortSIPLib modifyHeaderValue String headerName String 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 is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib clearModifyHeaders Clear the modify headers value no longer modify every outgoing SIP message header values Returns If the function succeeds the return value is 0 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 modifyHeaderValue Expires 1
69. id PortSIP PortSIPLib clearAudioCodec Remove all enabled audio codecs void PortSIP PortSIPLib clearVideoCodec Remove all enabled video codecs Int32 PortSIP PortSIPLib setAudioCodecParameter AUDIOCODEC TYPE codecType String parameter Set the codec parameter for audio codec Int32 PortSIP PortSIPLib setVideoCodecParameter VIDEOCODEC TYPE codecType String parameter Set the codec parameter for video codec Detailed Description Function Documentation Int32 PortSIP PortSIPLib 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 0 If the function fails the return value is a specific error code 13 Int32 PortSIP PortSIPLib 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 0 If the function fails the return value is a specific error code Boolean PortSIP PortSIPLib isAudioCodecEmpty Detect enabled audio codecs is empty or not Returns If no audio codec was enabled the return value is true otherwise is false Boolean PortSIP PortSIPLib isVideoCodecEmpty Detect enabled video codecs is empty or not Returns If no video codec was enabled the return value is true otherwise is f
70. improve the video quatliy void PortSIP PortSIPLib muteMicrophone Boolean mute Mute the device microphone it s unavailable for Android and iOS void PortSIP PortSIPLib muteSpeaker Boolean mute Mute the device speaker it s unavailable for Android and iOS void PortSIP PortSIPLib getDynamic VolumeLevel out Int32 speakerVolume out Int32 microphoneVolume Obtain the dynamic microphone volume level from current call Detailed Description Function Documentation Int32 PortSIP PortSIPLib setAudioDeviceld Int32 recordingDeviceld Int32 playoutDeviceld Set the audio device that will use for audio call Parameters recordingDeviceld Device ID index for audio record Microphone playoutDeviceld Device ID index for audio playback Speaker Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setVideoDeviceld Int32 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 0 If the function fails the return value is a specific error code 25 Int32 PortSIP PortSIPLib setVideoResolution VIDEO RESOLUTION resolution Set the video capture resolution Parameters resolution Video resolution defined in PortSIPType file Note Some camera
71. ing Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 onInviteSessionProgress Int32 callbackIndex Int32 callbackObject Int32 sessionId String audioCodecNames String videoCodecNames Boolean existsEarlyMedia Boolean existsAudio Boolean exists Video Int32 onInviteRinging Int32 callbackIndex Int32 callbackObject Int32 sessionId String statusText Int32 statusCode Int32 onInviteAnswered Int32 callbackIndex Int32 callbackObject Int32 sessionId String callerDisplayName String caller String calleeDisplayName String callee String audioCodecNames String videoCodecNames Boolean existsAudio Boolean exists Video Int32 onInviteFailure Int32 callbackIndex Int32 callbackObject Int32 sessionId String reason Int32 code Int32 onInviteUpdated Int32 callbackIndex Int32 callbackObject Int32 sessionId String audioCodecNames String videoCodecNames Boolean existsAudio Boolean exists Video Int32 onInviteConnected Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 onInviteBeginingForward Int32 callbackIndex Int32 callbackObject String forwardTo Int32 onInviteClosed Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 onRemoteHold Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 onRemoteUnHold Int32 callbackIndex Int32 callbackObject Int32 sessionId String audioCodecNames String videoCodecNames Boolean existsAudio Boolean exists Video Int32 onReceivedRefer I
72. iteIncoming Int32 callbackIndex Int32 callbackObject Int32 sessionId String callerDisplayName String caller String calleeDisplayName String callee String audioCodecNames String videoCodecNames Boolean existsAudio Boolean existsVideo Int32 PortSIP SIPCallbackEvents onInviteTrying Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 PortSIP SIPCallbackEvents onInviteSessionProgress Int32 callbackIndex Int32 callbackObject Int32 sessionId String audioCodecNames String videoCodecNames Boolean existsEarlyMedia Boolean existsAudio Boolean existsVideo Int32 PortSIP SIPCallbackEvents onInviteRinging Int32 callbackIndex Int32 callbackObject Int32 sessionId String statusText Int32 statusCode Int32 PortSIP SIPCallbackEvents onInvite Answered Int32 callbackIndex Int32 callbackObject Int32 sessionld String callerDisplayName String caller String calleeDisplayName String callee String audioCodecNames String videoCodecNames Boolean existsAudio Boolean existsVideo Int32 PortSIP SIPCallbackEvents onInviteFailure Int32 callbackIndex Int32 callbackObject Int32 sessionId String reason Int32 code Int32 PortSIP SIPCallbackEvents onInviteUpdated Int32 callbackIndex Int32 callbackObject Int32 sessionId String audioCodecNames String videoCodecNames Boolean existsAudio Boolean existsVideo Int32 PortSIP SIPCallbackEvents onInviteConnected Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 PortS
73. ive expansion Rate 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 Int32 PortSIP PortSIPLib getAudioRtpStatistics Int32 sessionld out Int32 averageJitierMs out Int32 maxdJitterMs out Int32 discardedPackets Obtain the RTP statisics of audio channel Parameters sessionId The session ID of call conversation averageJitterMs Short time average jitter in milliseconds maxJitterMs 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 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib getAudioRtcpStatistics Int32 sessionld out Int32 bytesSent out Int32 packetsSent out Int32 bytesReceived out Int32 packetsReceived out Int32 sendFractionLost out Int32 sendCumulativeLost out Int32 recvFractionLost out Int32 recvCumulativeLost Obtain the RTCP statisics of audio channel Parameters sessionld 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 perce
74. lback callbackMode The audio stream callback mode Mode 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 sessionId AUDIOSTREAM REMOTE MIX Callback the received audio stream that mixed including all channels AUDIOSTREAM REMOTE PER CHANNE Callback the received audio stream for one L channel base on the given sessionId 37 Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Remarks the onAudioRawCallback event will be triggered if the callback is enabled Int32 PortSIP PortSIPLib enableVideoStreamCallback Int32 callbackObject Int32 sessionld VIDEOSTREAM CALLBACK MODE callbackMode Enable disable the video stream callback Parameters callbackObject The callback object that you passed in and can access it once callback function triggered 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 0 If the function fails the return valu
75. leCallbackSendingSignaling 17 enableCallForward 18 enableCheckM wi 19 enableReliableProvisional 16 enableSessionTimer 18 getVersion 16 setAudioSamples 20 setDisplayName 16 setDoNotDisturb 19 setKeepAliveTime 20 setRtcpPortRange 17 setRtpKeepAlive 20 setRtpPortRange 17 setSrtpPolicy 17 addSupportedMimeT ype Additional setting functions 20 add VideoCodec Audio and video codecs functions 13 answerCall Call functions 29 attendedRefer Refer functions 32 Audio and video codecs functions 12 addAudioCodec 12 addVideoCodec 13 isAudioCodecEmpty 13 isVideoCodecEmpty 13 setAudioCodecParameter 14 setAudioCodecPayloadType 13 setVideoCodecParameter 14 setVideoCodecPayloadType 13 Audio and video functions 23 displayLocalVideo 26 getDynamic VolumeLevel 27 muteMicrophone 27 muteSpeaker 27 send Video 25 setAudioDeviceld 24 setLocalVideoWindow 26 setRemote VideoWindow 26 setVideoBitrate 25 setVideoDeviceld 24 setVideoFrameRate 25 setVideoNackStatus 26 setVideoOrientation 26 setVideoResolution 25 Audio and video stream callback events 71 onAudioRawCallback 71 onVideoRawCallback 71 Audio effect functions 46 enableAEC 47 enableAGC 47 enableANS 47 enableCNG 47 enable VAD 46 AUDIO_RECORDING_FILEFORMAT PortSIP 75 AUDIOCODEC_AMR PortSIP 74 AUDIOCODEC_AMRWB PortSIP 74 AUDIOCODEC_DTMF PortSIP 75 AUDIOCODEC G722 PortSIP 74 AUDIOCODEC G7221 PortSIP 75 AUDIOCODEC G729 PortSIP
76. letely in the OS Boolean PortSIP PortSIPLib getSystemInputMute Gets the mute state of the input device in the operating system void PortSIP PortSIPLib audioPlayLoopbackTest Boolean enable Use to do the audio device loop back test Int32 PortSIP PortSIPLib getNumOfVideoCaptureDevices Gets the number of available capture devices Int32 PortSIP PortSIPLib getVideoCaptureDeviceName Int32 deviceIndex StringBuilder uniqueIdUTF8 Int32 uniqueIdUTFS8Length StringBuilder deviceNameUTFS Int32 deviceNameUTF8Length Gets the name of a specific video capture device given by an index Int32 PortSIP PortSIPLib showVideoCaptureSettingsDialogBox String uniqueIdUTF8 Int32 uniqueIdUTF8Length String dialogTitle IntPtr parentWindow Int32 x Int32 y 53 Display the capture device property dialog box for the specified capture device Detailed Description Function Documentation Int32 PortSIP PortSIPLib getNumOfRecordingDevices Gets the number of audio devices available for audio recording Returns The return value is number of recording devices If the function fails the return value is a specific error code less than 0 Int32 PortSIP PortSIPLib getNumOfPlayoutDevices Gets the number of audio devices available for audio playout Returns The return value is number of playout devices If the function fails the return value is a specific error code less than 0 Int32 PortSIP PortSIPLib getReco
77. 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 SIP messages audioDeviceLayer Specifies which audio device layer should be using 0 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 0 Use the OS default device 2 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 Int32 PortSIP PortSIPLib setUser String userName String displayName String authName String password String locallp Int32 localSipPort String userDomain String sipServer Int32 sipServerPort String stunServer Int32 stunServerPort String outboundServer Int32 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 10
78. n 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 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setAudioSamples Int32 ptime Int32 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 0 If the function fails the return value is a specific error code Remarks which will be appears in the SDP of INVITE and 200 OK message as ptime and maxptime attribute Int32 PortSIP PortSIPLib addSupportedMimeType String methodName String mimeType String subMimeType Set the SDK receive the SIP message that include special mime type 21 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 0 If the function fails the return value is a specific error code Remarks Default the PortSIP VoIP SDK support these media types mime types that in the below incoming SIP
79. n value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib joinToConference Int32 sessionld Join a session into exist conference if the call is in hold it will be un hold automatically 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 Int32 PortSIP PortSIPLib removeFromConference Int32 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 Int32 PortSIP PortSIPLib setAudioRtcpBandwidth Int32 sessionId Int32 BitsRR Int32 BitsRS Int32 KBitsAS Set the audio RTCP bandwidth parameters as the RFC3556 Int32 PortSIP PortSIPLib setVideoRtcpBandwidth Int32 sessionId Int32 BitsRR Int32 BitsRS Int32 KBitsAS Set the video RTCP bandwidth parameters as the RFC3556 Int32 PortSIP PortSIPLib setAudioQos Boolean state Int32 DSCPValue Int32 priority Set the DSCP differentiated services code point value of QoS Quality of Service for audio channel Int32 PortSIP PortSIPLib setVideoQos Boolean state Int32 DSCPValue Set the DSCP differentiated services code point value of QoS Quality of Service for video channel
80. nTimer Disable the session timer void setDoNotDisturb Boolean state Enable the Do not disturb to enable disable Int32 detectMwi Use to obtain the MWI status Int32 enableCheckMwi Boolean state Allows enable disable the check MWI Message Waiting Indication Int32 setRtpKeepAlive Boolean state Int32 keepAlivePayloadType Int32 deltaTransmitTimeMS Enable or disable send RTP keep alive packet during the call is established Int32 setKeepAliveTime Int32 keepAliveTime Enable or disable send SIP keep alive packet Int32 setAudioSamples Int32 ptime Int32 maxPtime Set the audio capture sample Int32 addSupportedMimeType String methodName String mimeType String subMimeType Set the SDK receive the SIP message that include special mime type Int32 getExtensionHeaderValue String sipMessage String headerName StringBuilder headerValue Int32 headerValueLength Access the SIP header of SIP message Int32 addExtensionHeader String headerName String headerValue Add the extension header custom header into every outgoing SIP message Int32 clearAddExtensionHeaders Clear the added extension headers custom headers 83 Int32 modifyHeaderValue String headerName String headerValue Modify the special SIP header value for every outgoing SIP message Int32 clearModifyHeaders Clear the modify headers value no longer modify every outgoing SIP message header values Int32 setAudioDevic
81. naling 63 onSendingSignaling 63 SRTP POLICY PortSIP 76 SRTP POLICY FORCE PortSIP 76 SRTP POLICY NONE PortSIP 76 SRTP POLICY PREFER PortSIP 76 startRecord Record functions 38 stopPlayAudioFileToRemote Play audio and video file to remoe functions 40 stopPlayAudioFileToRemoteAsBackground Play audio and video file to remoe functions 40 stopPlayVideoFileToRemote Play audio and video file to remoe functions 39 stopRecord Record functions 38 TRANSPORT PERS PortSIP 77 TRANSPORT TCP PortSIP 77 TRANSPORT TLS PortSIP 77 TRANSPORT TYPE PortSIP 76 TRANSPORT UDP PortSIP 77 unHold Call functions 30 unRegisterServer Initialize and register functions 10 updateCall Call functions 29 VIDEO 720P PortSIP 75 VIDEO CIF PortSIP 75 VIDEO CODE NONE PortSIP 75 VIDEO CODEC H263 PortSIP 75 VIDEO CODEC H263 1998 PortSIP 75 VIDEO CODEC H264 PortSIP 75 VIDEO CODEC 1420 PortSIP 75 VIDEO CODEC VPS 8 PortSIP 75 VIDEO QCIF PortSIP 75 VIDEO QVGA PortSIP 75 VIDEO RESOLUTION PortSIP 75 VIDEO SVGA PortSIP 75 VIDEO VGA PortSIP 75 VIDEO XVGA PortSIP 75 VIDEOCODEC TYPE PortSIP 75 VIDEOSTREAM BOTH PortSIP 76 VIDEOSTREAM CALLBACK MODE PortSIP 76 VIDEOSTREAM LOCAL PortSIP 76 VIDEOSTREAM NONE PortSIP 76 VIDEOSTREAM REMOTE PortSIP 76 97
82. ndex Int32 callbackObject Int32 sessionId Int32 PortSIP SIPCallbackEvents onACTV TransferFailure Int32 callbackIndex Int32 callbackObject Int32 sessionId String reason Int32 code Detailed Description 62 Function Documentation Int32 PortSIP SIPCallbackEvents onReceivedRefer Int32 callbackIndex Int32 callbackObject Int32 sessionld Int32 referld String to String from String 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 Int32 PortSIP SIPCallbackEvents onReferAccepted Int32 callbackindex Int32 callbackObject Int32 sessionld This callback will be triggered once remote side called acceptRefer to accept the REFER Parameters sessionld The session ID of the call Int32 PortSIP SIPCallbackEvents onReferRejected Int32 callbackindex Int32 callbackObject Int32 sessionld String reason Int32 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 Int32 PortSIP SIPCallbackEvents onTransferTrying Int32 callbackIndex
83. nt sendCumulativeLo The number of sent cumulative lost packet St recvFractionLost Fraction of received lost in percent recvCumulativeLo The number of received cumulative lost packets st 46 Returns If the function succeeds the return value is O If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib getVideoRtpStatistics Int32 sessionld out Int32 bytesSent out Int32 packetsSent out Int32 bytesReceived out Int32 packetsReceived Obtain the RTP statisics of video 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 0 If the function fails the return value is a specific error code Audio effect functions Functions void PortSIP PortSIPLib enableV AD Boolean state Enable disable Voice Activity Detection VAD void PortSIP PortSIPLib enableAEC EC MODES ecMode Enable disable AEC Acoustic Echo Cancellation void PortSIP PortSIPLib enableCNG Boolean state Enable disable Comfort Noise Generator CNG void PortSIP PortSIPLib enableAGC AGC MODES agcMode Enable disable Automatic Gain Control AGC void PortSIP PortSIPLib enableANS NS MODES nsMode Enable disable Audio Noise Suppression ANS Detailed De
84. nt Int32 urgentNewMessageCount Int32 urgentOldMessageCount Int32 newMessageCount Int32 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 oldMessageCount Old message count Int32 PortSIP SIPCallbackEvents onWaitingFaxMessage Int32 callbackIndex Int32 callbackObject String messageAccount Int32 urgentNewMessageCount Int32 urgentOldMessageCount Int32 newMessageCount Int32 oldMessageCount If has the waiting fax message MW then this event will be triggered Parameters messageAccount Fax message account urgentNewMessag Urgent new message count eCount urgentOldMessage Urgent old message count Count newMessageCount New message count oldMessageCount Old message count 65 DTMF events Functions Int32 PortSIP SIPCallbackEvents onRecvDtmfTone Int32 callbackIndex Int32 callbackObject Int32 sessionld Int32 tone Detailed Description Function Documentation Int32 PortSIP SIPCallbackEvents onRecvDtmfTone Int32 callbackindex Int32 callbackObject Int32 sessionld Int32 tone This event will be triggered when received a DTMF tone from remote side Parameters sessionld The session ID of the call
85. nt32 callbackIndex Int32 callbackObject Int32 sessionId Int32 referld String to String from String referSipMessage Int32 onReferAccepted Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 onReferRejected Int32 callbackIndex Int32 callbackObject Int32 sessionId String reason Int32 code Int32 onTransferTrying Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 onTransferRinging Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 onACTVTransferSuccess Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 onACTV TransferFailure Int32 callbackIndex Int32 callbackObject Int32 sessionId String reason Int32 code Int32 onReceivedSignaling Int32 callbackIndex Int32 callbackObject Int32 sessionId StringBuilder signaling Int32 onSendingSignaling Int32 callbackIndex Int32 callbackObject Int32 sessionId StringBuilder signaling Int32 onWaiting VoiceMessage Int32 callbackIndex Int32 callbackObject String messageAccount Int32 urgentNewMessageCount Int32 urgentOldMessageCount Int32 newMessageCount Int32 oldMessageCount Int32 onWaitingFaxMessage Int32 callbackIndex Int32 callbackObject String messageAccount Int32 urgentNewMessageCount Int32 urgentOldMessageCount Int32 newMessageCount Int32 oldMessageCount Int32 onRecvDtmfTone Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 tone Int32 onRecvOptions Int32 callbackIndex Int32 callbackObject
86. o channel Int32 PortSIP PortSIPLib getAudioRtcpStatistics Int32 sessionId out Int32 bytesSent out Int32 packetsSent out Int32 bytesReceived out Int32 packetsReceived out Int32 sendFractionLost out Int32 sendCumulativeLost out Int32 recvFractionLost out Int32 recvCumulativeLost Obtain the RTCP statisics of audio channel Int32 PortSIP PortSIPLib getVideoRtpStatistics Int32 sessionId out Int32 bytesSent out Int32 packetsSent out Int32 bytesReceived out Int32 packetsReceived Obtain the RTP statisics of video Detailed Description Function Documentation Int32 PortSIP PortSIPLib getNetworkStatistics Int32 sessionid out Int32 currentBufferSize out Int32 preferredBufferSize out Int32 currentPacketLossRate out Int32 currentDiscardRate out Int32 currentExpandRate out Int32 currentPreemptiveRate out Int32 currentAccelerateRate Get the in call statistics The statistics are reset after the query Parameters sessionld The session ID of call conversation 45 currentBufferSize Current jitter buffer size in ms preferredBufferSiz Preferred optimal buffer size in ms e currentPacketLoss Loss rate network late in percent Rate currentDiscardRat Late loss rate in percent e currentExpandRat Fraction of original stream of synthesized speech inserted through expansion e currentPreemptive Fraction of synthesized speech inserted through pre empt
87. oDisplayName String to String reason Int32 code Int32 onPlayAudioFileFinished Int32 callbackIndex Int32 callbackObject Int32 sessionId String fileName Int32 onPlayVideoFileFinished Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 onReceivedRtpPacket IntPtr callbackObject Int32 sessionId Boolean isAudio byte RTPPacket Int32 packetSize Int32 onSendingRtpPacket IntPtr callbackObject Int32 sessionId Boolean isAudio byte RTPPacket Int32 packetSize Int32 onAudioRawCallback IntPtr callbackObject Int32 sessionId Int32 callbackType byte data Int32 dataLength Int32 samplingFreqHz Int32 onVideoRawCallback IntPtr callbackObject Int32 sessionId Int32 callbackType Int32 width Int32 height byte data Int32 dataLength Detailed Description SIPCallbackEvents PortSIP VoIP SDK Callback events The documentation for this interface was generated from the following file SIPCallbackEvents cs 90 Index acceptRefer Refer functions 33 Access SIP message header functions 21 addExtensionHeader 22 clearAddExtensionHeaders 22 clearModifyHeaders 23 getExtensionHeaderValue 22 modifyHeaderValue 23 addAudioCodec Audio and video codecs functions 12 addExtensionHeader Access SIP message header functions 22 Additional setting functions 14 addSupportedMimeType 20 detectM wi 19 disableCallForward 18 disableSessionTimer 19 enable3GppTags 16 enab
88. oPort Int32 minimumRtcpVideoPort Int32 maximumRtcpVideoPort Set the RTCP ports range for audio and video streaming Int32 PortSIP PortSIPLib enableCallForward Boolean forBusyOnly String forwardTo Enable call forward Int32 PortSIP PortSIPLib disableCallForward Disable the call forward the SDK is not forward any incoming call after this function is called Int32 PortSIP PortSIPLib enableSessionTimer Int32 timerSeconds SESSION REFRESH MODE refreshMode Allows to periodically refresh Session Initiation Protocol SIP sessions by sending repeated INVITE requests Int32 PortSIP PortSIPLib disableSessionTimer Disable the session timer void PortSIP PortSIPLib setDoNotDisturb Boolean state Enable the Do not disturb to enable disable Int32 PortSIP PortSIPLib detectMwi Use to obtain the MWI status Int32 PortSIP PortSIPLib enableCheckMwi Boolean state Allows enable disable the check MWI Message Waiting Indication Int32 PortSIP PortSIPLib setRtpKeepAlive Boolean state Int32 keepAlivePayloadType Int32 delta TransmitTimeMS Enable or disable send RTP keep alive packet during the call is established Int32 PortSIP PortSIPLib setKeepAliveTime Int32 keepAliveTime Enable or disable send SIP keep alive packet Int32 PortSIP PortSIPLib setAudioSamples Int32 ptime Int32 maxPtime Set the audio capture sample Int32 PortSIP PortSIPLib addSuppor
89. ode Int32 PortSIP PortSIPLib stopPlay AudioFileToRemote Int32 sessionld Stop play wave file to remote side Parameters sessionId Returns If the function succeeds the return value is 0 If the function fails the return value is a specific Session ID of the call error code Int32 PortSIP PortSIPLib play AudioFileToRemoteAsBackground Int32 sessionld String fileName Int32 fileSamplesPerSec Play an wave file to remote party as conversation background sound Parameters sessionld Session ID of the call fileName The file full path name such as c West wav fileSamplesPerSec The wave file sample in seconds should be 8000 or 16000 or 32000 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib stopPlay AudioFileToRemoteAsBackground Int32 sessionld Stop play an wave file to remote party as conversation background sound Parameters sessionld Returns If the function succeeds the return value is 0 If the function fails the return value is a specific Session ID of the call error code 41 Conference functions Functions Int32 PortSIP PortSIPLib createConference IntPtr conferenceVideoWindow VIDEO RESOLUTION videoResolution Boolean displayLocalV ideoInConference Create a conference It s failures if the exists conference isn t destroy yet
90. 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 71 Audio and video stream callback events Functions Int32 PortSIP SIPCallbackEvents onAudioRawCallback IntPtr callbackObject Int32 sessionId Int32 callbackType byte data Int32 dataLength Int32 samplingFreqHz Int32 PortSIP SIPCallbackEvents onVideoRawCallback IntPtr callbackObject Int32 sessionId Int32 callbackType Int32 width Int32 height byte data Int32 dataLength Detailed Description Function Documentation Int32 PortSIP SIPCallbackEvents onAudioRawCallback IntPtr callbackObject Int32 sessionld Int32 callbackType byte data Int32 dataLength Int32 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 an
91. of the refer 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 Remarks refer sessionId 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 Int32 PortSIP PortSIPLib attendedRefer Int32 sessionld Int32 replaceSessionld String referTo Make an attended refer 33 Parameters sessionId The session ID of the call replaceSessionId 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 0 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 downloads video blindtransfer rar use the Windows Media Player to play the AVI file after extracted it will shows how to do the transfer Int32 PortSIP PortSIPLib acceptRefer Int32 referld String referSignalingMessage 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 REF
92. oolean state Enable the SDK send video stream data to remote side from another source to instread 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 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib sendVideoStreamToRemote Int32 sessionld byte data Int32 dataLength Int32 width Int32 height Send the video stream to remote Parameters sessionld Session ID of the call conversation data The video video stream data must is 1420 format dataLength The size of data 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 funtion you MUST call the enableSendVideoStreamToRemote function Usually we should use it like below enableSendVideoStreamToRemote sessionId true sendVideoStreamToRemote sessionId data dataSize 352 288 RTP packets Audio stream and video stream callback functions Functions Int32 PortSIP PortSIPLib setRtpCallback Int32 callbackObject Boolean enable Set the RTP callbacks to allow access the sending and received RTP packets
93. oolean state Int32 streamSamplesPerSec Enable the SDK send PCM stream data to remote side from another source to instread of microphone Int32 sendPcmStreamToRemote Int32 sessionId byte data Int32 dataLength Send the audio stream in PCM format from another source to instead of audio device capture microphone Int32 enableSendVideoStreamToRemote Int32 sessionId Boolean state Enable the SDK send video stream data to remote side from another source to instread of camera Int32 sendVideoStreamToRemote Int32 sessionId byte data Int32 dataLength Int32 width Int32 height Send the video stream to remote Int32 setRtpCallback Int32 callbackObject Boolean enable Set the RTP callbacks to allow access the sending and received RTP packets Int32 enableAudioStreamCallback Int32 callbackObject Int32 sessionId Boolean enable AUDIOSTREAM CALLBACK MODE callbackMode Enable disable the audio stream callback Int32 enable VideoStreamCallback Int32 callbackObject Int32 sessionId VIDEOSTREAM CALLBACK MODE callbackMode Enable disable the video stream callback Int32 startRecord Int32 sessionId String recordFilePath String recordFileName Boolean appendTimestamp AUDIO RECORDING FILEFORMAT audioFileFormat RECORD MODE audioRecordMode VIDEOCODEC TYPE videoFileCodecType RECORD MODE videoRecordMode Start record the call Int32 stopRecord Int32 sessionId Stop record Int32 playVideoFileToR
94. ord is aaa 4 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 locale orci he EDS IT eX DNI eI D 5 The log box will appears Initialized if the SDK initialize succeeded 6 Make call from A to B enter sip 2220192 168 1 11 and click Dial button Make call from BECO enter Ss a9 ENG SIS 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 22280192 168 1 11 6021 and dial Make call from B to A enter sip 1110192 168 1 10 5080 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 onSendingRtpPacket RISE T 6 Does the SDK support native 64 bits Yes the SDK support both 32bit and 64 bits Support Please send email to Our support if you need any helps Module Index Modules Here is a list of all modules SDK functions A Lue RUE eiit Ae al a eed a 9 Initialize and register functions sees sees eee eee 9 NIC and JocalilP functions Ree neces otis BA id SR ee Re ARR 12 Audio and video codecs fUNCTtIONS cccccecssscesssseeceeseececeesse
95. rdingDeviceName Int32 devicelndex StringBuilder nameUTF8 Int32 nameUTF8Length Gets the name of a specific recording device given by an index Parameters deviceIndex Device index 0 1 2 N 1 where N is given by getNumOfRecordingDevices Also 1 is a valid value and will return the name of the default recording device nameUTFS A character buffer to which the device name will be copied as a null terminated string in UTF8 format nameUTFSLength The size of nameUTF8 buffer don t let it less than 128 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib getPlayoutDeviceName Int32 devicelndex StringBuilder nameUTF8 Int32 nameUTF8Length Gets the name of a specific playout device given by an index 54 Parameters deviceIndex deviceIndex Device index 0 1 2 N 1 where N is given by getNumOfRecordingDevices Also 1 is a valid value and will return the name of the default recording device nameUTFS A character buffer to which the device name will be copied as a null terminated string in UTF8 format nameUTFSLength The size of nameUTFS buffer don t let it less than 128 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setSpeakerVolume Int32 volume Set
96. s state If set to true the SDK reject all incoming calls anyway Int32 PortSIP PortSIPLib detectMwi Use to obtain the MWI status Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib enableCheckMwi Boolean state Allows enable disable the check MWI Message Waiting Indication 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 0 If the function fails the return value is a specific error code 20 Int32 PortSIP PortSIPLib setRtpKeepAlive Boolean state Int32 keepAlivePayloadType Int32 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 keepAlivePayload The payload type of the keep alive RTP packet usually set to 126 Type deltaTransmitTime The keep alive RTP packet send interval in millisecond usually recommend MS 15000 300000 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setKeepAliveTime Int32 keepAliveTime Enable or disable send SIP keep alive packet Parameters keepAliveTime This is the SIP keep alive time interval i
97. s 37 FILEFORMAT AMR PortSIP 75 FILEFORMAT WAVE PortSIP 75 forwardCall Call functions 30 getAudioRtcpStatistics RTP statistics functions 45 getAudioRtpStatistics RTP statistics functions 45 getDynamic VolumeLevel Audio and video functions 27 getExtensionHeaderValue Access SIP message header functions 22 getLocallpAddress NIC and local IP functions 11 getMic Volume Device Manage functions 55 getNetworkStatistics RTP statistics functions 44 getNICNums NIC and local IP functions 11 getNumOfPlayoutDevices Device Manage functions 53 getNumOfRecordingDevices Device Manage functions 53 getNumOfVideoCaptureDevices Device Manage functions 56 getPlayoutDeviceName Device Manage functions 53 getRecordingDeviceName Device Manage functions 53 getSpeakerVolume Device Manage functions 54 getS ystemInputMute Device Manage functions 55 getSystemOutputMute Device Manage functions 54 getVersion Additional setting functions 16 getVideoCaptureDeviceName Device Manage functions 56 getVideoRtpStatistics RTP statistics functions 46 hangUp Call functions 29 hold Call functions 30 INFO OPTIONS message events 66 onRecvInfo 66 onRecvOptions 66 initialize Initialize and register functions 9 Initialize and register functions 8 initialize 9 registerServer 10 setLicenseKey 10 setUser 9 unRegisterServer 10 isAudioCodecEmpty Audio and video codecs functions 13 isVideoCodec
98. s 0 If the function fails the return value is a specific error code 17 void PortSIP PortSIPLib enableCallbackSendingSignaling Boolean 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 Int32 PortSIP PortSIPLib setSrtpPolicy SRTP POLICY srtpPolicy Set the SRTP policy Parameters srtpPolicy The SRTP policy Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setRtpPortRange Int32 minimumRtpAudioPort Int32 maximumRipAudioPort Int32 minimumRtp VideoPort Int32 maximumRtpVideoPort Set the RTP ports range for audio and video streaming Parameters minimumRtpAudio The minimum RTP port for audio stream Port maximumRtpAudio The maximum RTP port for audio stream Port minimumRtpVideo The minimum RTP port for video stream Port maximumRtpVideo The maximum RTP port for video stream Port 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 Int32 PortSIP PortSIPLib setRtcpPortRange Int32 minimumRtcpAudioPor
99. s don t support SVGA and XVGA 720P please read your camera manual Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setVideoBitrate Int32 bitrateKbps Set the video bit rate Parameters bitrateKbps The video bit rate in KBPS Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setVideoFrameRate Int32 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 0 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 Int32 PortSIP PortSIPLib sendVideo Int32 sessionid Boolean sendSiate 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 0 If the function fails the return value is a specific error code 26 Int32 PortSIP PortSIPLib setVideoOrientation Int32 rotation Changing the orientation of the video Parameters rotation
100. scription Function Documentation void PortSIP PortSIPLib enableVAD Boolean state Enable disable Voice Activity Detection V AD 47 Parameters state Set to true to enable VAD false to disable void PortSIP PortSIPLib enableAEC EC MODES ecMode Enable disable AEC Acoustic Echo Cancellation Parameters ecMode Allow set the AEC mode to effect for different scenarios Mode Description EC_NONE Disable AEC EC_DEFAULT Platform default AEC EC_CONFERENCE Desktop platform windows MAC Conferencing default aggressive AEC void PortSIP PortSIPLib enableCNG Boolean state Enable disable Comfort Noise Generator CNG Parameters state state Set to true to enable CNG false to disable void PortSIP PortSIPLib enableAGC AGC MODES agcMode Enable disable Automatic Gain Control AGC Parameters agcMode Allow set the AGC mode to effect for different scenarios Mode Description AGC DEFAULT Disable AGC AGC DEFAULT Platform default AGC ADAPTIVE ANALOG Desktop platform windows MAC adaptive mode for use when analog volume control exists AGC ADAPTIVE DIGITAL scaling takes place in the digital domain e g for conference servers and embedded devices AGC FIXED DIGITAL can be used on embedded devices where the capture signal level is predictable void PortSIP PortSIPLib enableANS NS MODES nsMode Enable disable Audio Noise Suppre
101. sendMessage sessionId application vnd 3gpp sms binData binDataSize Int32 PortSIP PortSIPLib sendOutOfDialogMessage String to String mimeType String subMimeType byte message Int32 messageLength Send a out of dialog MESSAGE message to remote side Parameters to The message receiver Likes sip receiver portsip com 50 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 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 sendOutOfDialogMessage Sip userl sip portsip com text plain hello 6 Example 2 send a binary message sendOutOfDialogMessage sip userl8sip portsip com application vnd 3gpp sms binData binDataSize Presence functions Functions Int32 PortSIP PortSIPLib presenceSubscribeContact String contact String subject Send a SUBSCRIBE message for presence to a contact Int32 PortSIP PortSIPLib presenceRejectSubscribe Int32 subscribeld Accept the
102. ssion ANS 48 Parameters nsMode Allow set the NS mode to effect for different scenarios Mode Description NS_NONE Disable NS NS_DEFAULT Platform default NS_Conference conferencing default NS_LOW_SUPPRESSION lowest suppression NS_MODERATE_SUPPRESSION moderate suppression NS_HIGH_SUPPRESSION high suppression NS_VERY_HIGH_SUPPRESSION highest suppression Send OPTIONS INFO MESSAGE functions Functions Int32 PortSIP PortSIPLib sendOptions String to String sdp Send OPTIONS message Int32 PortSIP PortSIPLib sendInfo Int32 sessionId String mimeType String subMimeType String infoContents Send a INFO message to remote side in dialog Int32 PortSIP PortSIPLib sendMessage Int32 sessionId String mimeType String subMimeType byte message Int32 messageLength Send a MESSAGE message to remote side in dialog Int32 PortSIP PortSIPLib sendOutOfDialogMessage String to String mimeType String subMimeType byte message Int32 messageLength Send a out of dialog MESSAGE message to remote side Detailed Description Function Documentation Int32 PortSIP PortSIPLib sendOptions String to String 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 49 Returns If the function succeeds the return value is O If the func
103. static readonly int EVideoGetDeviceldFailure 80002 static readonly int EVideoStartCaptureFailure 80003 static readonly int EVideoChannelNotFound 80004 static readonly int EVideoStartSendFailure 80005 80 static readonly int EVideoGetStatisticsFailure 80006 static readonly int EVideoStartPlayA viF ailure 80007 static readonly int EVideoSendA viFileFailure 80008 static readonly int EVideoRecordUnknowCodec 80009 static readonly int EVideoCantSetDeviceIdDuringCall 80010 static readonly int EVideoUnsupportCaptureRotate 80011 static readonly int EVideoUnsupportCaptureResolution 80012 static readonly int EDeviceGetDeviceNameFailure 90001 The documentation for this class was generated from the following file PortSIP Errors cs 81 PortSIP PortSIPLib Class Reference The PortSIP VoIP SDK class Public Member Functions PortSIPLib Int32 callbackIndex Int32 callbackObject SIPCallbackEvents calbackevents Boolean createCallbackHandlers void releaseCallbackHandlers Int32 initialize TRANSPORT TYPE transportType PORTSIP LOG LEVEL logLevel String logFilePath Int32 maxCallLines String sipAgent Int32 audioDeviceLayer Int32 videoDeviceLayer Initialize the SDK void unInitialize Un initialize the SDK and release resources Int32 setUser String userName String displayName String authName String password String localIp Int32 localSipPort String userDomain String sipSer
104. t Int32 getNumOfVideoCaptureDevices Gets the number of available capture devices Int32 getVideoCaptureDeviceName Int32 deviceIndex StringBuilder uniqueIdUTFS Int32 uniqueIdUTF8Length StringBuilder deviceNameUTFS Int32 deviceNameUTF8Length Gets the name of a specific video capture device given by an index Int32 showVideoCaptureSettingsDialogBox String uniqueIdUTF8 Int32 uniqueldUTF8Length String dialogTitle IntPtr parentWindow Int32 x Int32 y Display the capture device property dialog box for the specified capture device Detailed Description The PortSIP VoIP SDK class Author Copyright c 2006 2014 PortSIP Solutions Inc All rights reserved Version 11 2 See also http www PortSIP com PortSIP VoIP SD functions class description The documentation for this class was generated from the following file PortSIPLib cs 88 PortSIP SIPCallbackEvents Interface Reference Public Member Functions Int32 onRegisterSuccess Int32 callbackIndex Int32 callbackObject String statusText Int32 statusCode Int32 onRegisterFailure Int32 callbackIndex Int32 callbackObject String statusText Int32 statusCode Int32 onInviteIncoming Int32 callbackIndex Int32 callbackObject Int32 sessionId String callerDisplayName String caller String calleeDisplayName String callee String audioCodecNames String videoCodecNames Boolean existsAudio Boolean exists Video Int32 onInviteTry
105. t Int32 maximumRicpAudioPort Int32 minimumRtcp VideoPort Int32 maximumHtocp VideoPort Set the RTCP ports range for audio and video streaming 18 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 Int32 PortSIP PortSIPLib enableCallForward Boolean forBusyOnly String 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 G sip portsip com Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib 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 0 If the function fails the return value is a specific error code Int32 PortS
106. t etet et steret ese uses as ese se sese s ese uses e setate sese ses es ue 42 RTP and RTOP QOS functions 5 4 nter ec pene tae tee Die diet re deett 43 RTP statistics functions eeeeeeseseceeeeeeennnn e e e e e e nnne nnnm nn nn nnns nnns ases ns i ese uses a ese e ese ase ases a e nsns asas ue 45 AXudio etfeet functions BRR ERR ae al dn RE Oen oe e EDT 47 Send OPTIONS INFO MESSAGE functions sss eee ee eee 49 Presence f nctlons n eere rrr eret e Dee DEDI DIE 51 Device Manage functions teen m RAISES AG Oe eere e pipes 53 SDE Callback events us naue eere RR ERR 58 Register events sio eon nemen I T ates eae te notes 58 Calle Vents sss uReeeeceRIOIBemieeneuinemienienun eU RO E 59 Refer eventssc nueces ehem eie 62 Signaling events c i ome eden Pies ae a ee 64 MWLeyents us Ree aenea eidem di 65 DTMESvyentSz x o acenehehemcmeneeuibermidbiemieeneiuIBOINU GOD ame 66 INFO OPTIONS message events eeeseeseeseeeeeeeeeeeneenee nennen nennen eren rennen TSEN E kes trennen trennen 67 Presence evelitsi i a e cows cock tusk aded tet tete ente eed te ede et dv tede EE bet 67 Play audio and video file finished events sss esse essen 70 REP callback Events acc ectetuer tede eee e E ee Ee CG 71 Audio and video stream callback events 72 10 AT ee eth ee EE Re eee 74 Class Documentation eret ete ett eee ect tete eee d e EE ee tete dete nee Ee ebd ecu dee dece 79 PortSIP POrtSIP BETOIS i niece tette tete cei tet ete iced tete
107. tatic libraries sources headers datasheet and everything else a SDK user might need 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 VoIP 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 Frequently Asked Questions 1 Where can I 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 1 Download the sample projects from PortSIP website ao RBRxttact the zip file 3 Open the project by your IDE Cf VB NET VCt Visual Studio 2008 or higher Delphi Delphi XE4 or higher 4 Compile the sample project directly the trial version SDK allows 2 3 minutes conversation 3 How to create a new project base on PortSIP VoIP SDK C VB NET Download and extract the sample project for C VB NET 2 Create a new Windows application project 3 Copy the PortSipesdk dill to project output directories bin and bin 4 Copy the PortSIP folder to project folder and add into Solution 5 Inherit
108. tedMimeType String methodName String mimeType String subMimeType Set the SDK receive the SIP message that include special mime type Detailed Description 16 Function Documentation Int32 PortSIP PortSIPLib setDisplayName String name Set user display name Parameters name The display name Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib getVersion out Int32 majorVersion out Int32 minorVersion Get the current version number of the SDK Parameters major Version Return the major version number minorVersion Return the minor version number Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib enableReliableProvisional Boolean enable Enable disable PRACK Parameters enable enable Set to true to enable the SDK support PRACK default the PRACK is disabled Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib enable3GppTags Boolean 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 i
109. the speaker volume level Parameters volume Volume level of speaker valid range is 0 255 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib getSpeakerVolume Gets the speaker volume level Returns If the function succeeds the return value is speaker volume valid range is 0 255 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setSystemOutputMute Boolean enable Mutes the speaker device completely in the OS Parameters enable If set to true the device output is muted If set to false the output is unmuted Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Boolean PortSIP PortSIPLib getSystemOutputMute Retrieves the output device mute state in the operating system 55 Returns If return value is true the output device is muted If false the output device is not muted Int32 PortSIP PortSIPLib setMicVolume Int32 volume Sets the microphone volume level Parameters volume The microphone volume level the valid value is 0 255 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib getMicVolume Retrieves the current microphone volume Returns
110. tion fails the return value is a specific error code Int32 PortSIP PortSIPLib sendInfo Int32 sessionld String mimeType String subMimeType String infoContents Send a INFO message to remote side in dialog Parameters sessionId The session ID of call mimeType The mime type of INFO message subMimeType The sub mime type of INFO message infoContents The contents that 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 Int32 PortSIP PortSIPLib sendMessage Int32 sessionld String mimeType String subMimeType byte message Int32 messageLength Send a MESSAGE message to remote side in dialog Parameters sessionId 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 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 sendMessage sessionId text plain hello 6 Example 2 send a binary message
111. turn value is a specific error code void PortSIP PortSIPLib muteMicrophone Boolean mute Mute the device microphone it s unavailable for Android and 1OS Parameters mute If the value is set to true the microphone is muted set to false to un mute it void PortSIP PortSIPLib muteSpeaker Boolean 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 void PortSIP PortSIPLib getDynamicVolumeLevel out Int32 speakerVolume out Int32 microphone Volume 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 Remarks Usually set a timer to call this function to refresh the volume level indicator Call functions Functions Int32 PortSIP PortSIPLib call String callee Boolean sendSdp Boolean videoCall Make a call Int32 PortSIP PortSIPLib rejectCall Int32 sessionId int code rejectCall Reject the incoming call 9 Int32 PortSIP PortSIPLib hangUp Int32 sessionId hangUp Hang up the call Int32 PortSIP PortSIPLib answerCall Int32 sessionId Boolean videoCall answerCall Answer the incoming call 28 Int32 PortSIP PortSIPLi
112. udio stream from microphone for one channel base on the session ID AUDIOSTREAM_REMOTE_MIX Callback the received audio stream that mixed including all channels AUDIOSTREAM REMOTE PER CHANNEL Callback the received audio stream for one channel base on the session ID enum PortSIP VIDEOSTREAM CALLBACK MODE int The video stream callback mode Enumerator 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 enum PortSIP SRTP POLICY int SRTP Policy Enumerator SRTP POLICY NONE No use SRTP The SDK can receive the encrypted call SRTP and unencrypted call both but can t place outgoing encrypted call SRTP POLICY FORCE All calls must use SRTP The SDK just allows receive encrypted Call and place outgoing encrypted call only SRTP POLICY PREFER Top priority to use SRTP The SDK allows receive encrypted and decrypted call and allows place outgoing encrypted call and unencrypted call enum PortSIP TRANSPORT TYPE int 77 Transport for SIP signaling Enumerator TRANSPORT UDP UDP Transport TRANSPORT TLS Tis Transport TRANSPORT TCP TCP Transport TRANSPORT PERS PERS is the PortSIP private transport for anti the SIP blocking it must using with the PERS Server http www portsip com pers html enum PortSIP SESSION REFRESH MODE int The session refresh by UAC or
113. udioCodecNames videoCodecNames The matched audio codecs it s separated by if have more than one codec 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 exists Video If it s true means this call include the video Int32 PortSIP SIPCallbackEvents onInviteConnected Int32 callbackIndex Int32 callbackObject Int32 sessionld 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 sessionId The session ID of the call Int32 PortSIP SIPCallbackEvents onInviteBeginingForward Int32 callbackindex Int32 callbackObject String forwardTo 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 61 Int32 PortSIP SIPCallbackEvents onInviteClosed Int32 callbackIndex Int32 callbackObject Int32 sessionld This event is triggered once remote side close the call Parameters sessionld The session ID of the call Int32 PortSIP SIPCallbackEvents onRemoteHold Int32 callbackIndex Int32 callbackObject Int32 sessionld If the remote side has placed the call on hold this event triggered Parameters s
114. unctions Int32 PortSIP SIPCallbackEvents onPresenceRecvSubscribe Int32 callbackIndex Int32 callbackObject Int32 subscribeld String fromDisplayName String from String subject Int32 PortSIP SIPCallbackEvents onPresenceOnline Int32 callbackIndex Int32 callbackObject String fromDisplayName String from String stateText Int32 PortSIP SIPCallbackEvents onPresenceOffline Int32 callbackIndex Int32 callbackObject String fromDisplayName String from Int32 PortSIP SIPCallbackEvents onRecvMessage Int32 callbackIndex Int32 callbackObject Int32 sessionId String mimeType String subMimeType byte messageData Int32 messageDataLength Int32 PortSIP SIPCallbackEvents onRecvOutOfDialogMessage Int32 callbackIndex Int32 callbackObject String fromDisplayName String from String toDisplayName String to String mimeType String subMimeType byte messageData Int32 messageDataLength Int32 PortSIP SIPCallbackEvents onSendMessageSuccess Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 messageld 67 Int32 PortSIP SIPCallbackEvents onSendMessageFailure Int32 callbackIndex Int32 callbackObject Int32 sessionId Int32 messageld String reason Int32 code Int32 PortSIP SIPCallbackEvents onSendOutOfDialogMessageSuccess Int32 callbackIndex Int32 callbackObject Int32 messageld String fromDisplayName String from String toDisplayName String to Int32 PortSIP SIPCallback
115. urn 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 Int32 PortSIP PortSIPLib rejectCall Int32 sessionld int code rejectCall Reject the incoming call Parameters sessionld The sessionId of the call code Reject code for example 486 480 etc 29 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib hangUp Int32 sessionld hangUp Hang up the call 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 Int32 PortSIP PortSIPLib answerCall Int32 sessionid Boolean videoCall answerCall Answer the incoming call Parameters sessionId 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 return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib updateCall Int32 sessionld bool enableAudio bool enable Video Use the re INVITE to update the established call
116. vents ca obiit and 65 DTM events ie 5300s ant Mike Arahat SA ce eae AI 66 INFO OPTIONS message events 5 epe Drei RP HER Oper ER ERR 67 Presence events RID m d eem EIS 67 Play audio and video file finished events sss sese eee 70 RIP callb ck events era d EN I C CO e iiec ie Eco duds 71 Audio and video stream callback events sees 72 Namespace Index Packages Here are the packages with brief descriptions if available Forw E EE Class Index Class List Here are the classes structs unions and interfaces with brief descriptions Iunius ilu uy PortSIP PortSIPLib The PortSIP VoIP SDK class sss sese PoriSIP SIPCallbackE venis 2o cere ree eee Ree rane eerte E HERE P HARE RE e Module Documentation 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 MESS AGE functions Presence functions Device Manage functions Detailed Description SDK functions
117. ver Int32 sipServerPort String stunServer Int32 stunServerPort String outboundServer Int32 outboundServerPort Set user account info Int32 registerServer Int32 expires Int32 retryTimes Register to SIP proxy server login to server Int32 unRegisterServer Un register from the SIP proxy server Int32 setLicenseKey String key Set the license key must called before setUser function Int32 getNICNums Get the Network Interface Card numbers Int32 getLocalIpAddress Int32 index StringBuilder ip Int32 ipSize Get the local IP address by Network Interface Card index Int32 addAudioCodec AUDIOCODEC TYPE codecType Enable an audio codec it will be appears in SDP Int32 addVideoCodec VIDEOCODEC TYPE codecType Enable a video codec it will be appears in SDP Boolean isAudioCodecEmpty Detect enabled audio codecs is empty or not Boolean is VideoCodecEmpty Detect enabled video codecs is empty or not Int32 setAudioCodecPayloadType AUDIOCODEC TYPE codecType Int32 payloadType Set the RTP payload type for dynamic audio codec Int32 setVideoCodecPayloadType VIDEOCODEC TYPE codecType Int32 payloadType Set the RTP payload type for dynamic Video codec void clearAudioCodec Remove all enabled audio codecs void clear VideoCodec Remove all enabled video codecs Int32 setAudioCodecParameter AUDIOCODEC TYPE codecType String parameter Set the codec parameter for audio codec Int32 setVideo
118. 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 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib setVideoQos Boolean state Int32 DSCPValue 44 Set the DSCP differentiated services code point value of QoS Quality of Service for video channel Parameters state 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 0 If the function fails the return value is a specific error code RTP statistics functions Functions Int32 PortSIP PortSIPLib getNetworkStatistics Int32 sessionId out Int32 currentBufferSize out Int32 preferredBufferSize out Int32 currentPacketLossRate out Int32 currentDiscardRate out Int32 currentExpandRate out Int32 currentPreemptiveRate out Int32 currentAccelerateRate Get the in call statistics The statistics are reset after the query Int32 PortSIP PortSIPLib getAudioRtpStatistics Int32 sessionId out Int32 averageJitterMs out Int32 maxJitterMs out Int32 discardedPackets Obtain the RTP statisics of audi
119. 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 reason The failure reason code The failure code Play audio and video file finished events Functions Int32 PortSIP SIPCallbackEvents onPlayAudioFileFinished Int32 callbackIndex Int32 callbackObject Int32 sessionId String fileName Int32 PortSIP SIPCallbackEvents onPlay VideoFileFinished Int32 callbackIndex Int32 callbackObject Int32 sessionId Detailed Description Function Documentation Int32 PortSIP SIPCallbackEvents onPlay AudioFileFinished Int32 callbackindex Int32 callbackObject Int32 sessionld String 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 Int32 PortSIP SIPCallbackEvents onPlayVideoFileFinished Int32 callbackIndex Int32 callbackObject Int32 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 70 RTP callback events Functions Int32 PortSIP SIPCallba
120. x 0 1 2 N 1 where N is given by getNumOfVideoCaptureDevices Also 1 is a valid value and will return the name of the default capture device uniqueldUTF8 Unique identifier of the capture device uniqueldUTF8Len Size in bytes of uniqueldUTF8 gth deviceNameUTF8 A character buffer to which the device name will be copied as a null terminated string in UTF8 format deviceNameUTFS The size of nameUTF8 buffer don t let it less than 128 Length Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Int32 PortSIP PortSIPLib showVideoCaptureSettingsDialogBox String uniqueldUTF8 Int32 uniqueldUTF8Length String dialogTitle IntPtr parentWindow Int32 x Int32 y Display the capture device property dialog box for the specified capture device Parameters uniqueldUTF8 Unique identifier of the capture device uniqueldUTFS8Len Size in bytes of uniqueldUTF8 gth dialogTitle The title of the video settings dialog parentWindow Parent window to use for the dialog box should originally be a HWND x Horizontal position for the dialog relative to the parent window in pixels y Vertical position for the dialog relative to the parent window in pixels Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code 57 SDK Callback events Modules Register events Call events
121. y 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 Int32 PortSIP SIPCallbackEvents onVideoRawCallback IntPtr callbackObject Int32 sessionld Int32 callbackType Int32 width Int32 height byte data Int32 dataLength This event will be triggered once received the video packets if called enable VideoStreamCallback function Parameters sessionId The session ID of the call videoCallbackMod The type which pasdded in enableVideoStreamCallback function e width The width of video image height The height of video image data The memory of video stream it s YUV420 format Y V12 dataLength The data size 72 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 73 Namespace Documentation Package PortSIP Classes class PortSIP Errors class PortSIPLib The PortSIP VoIP SDK class interface SIPCallbackEvents Enumerations enum AUDIOCODEC TYPE int AUDIOCODEC NONE 1 AUDIOCODEC TYPE AUDIOCODEC G729 18 AUDIOCODEC TYPE AUDIOCODEC PCMA 8 AUDIOCODEC TYPE AUDIOCODEC PCMU 0 AUDIOCODEC TYPE AUDIOCODEC GSM

Download Pdf Manuals

image

Related Search

Related Contents

Free of cost  

Copyright © All rights reserved.
Failed to retrieve file