Home
PortSIP VoIP SDK Manual for Android
Contents
1. void com portsip OnPortSIPEvent onReceivedRefer long sessionld long referld String to String from String referSipMessage void com portsip OnPortSIPEvent onReferAccepted long sessionId void com portsip OnPortSIPEvent onReferRejected long sessionld String reason int code void com portsip OnPortSIPEvent onTransferTrying long sessionId void com portsip OnPortSIPEvent onTransferRinging long sessionld void com portsip OnPortSIPEvent onACTV TransferSuccess long sessionId void com portsip OnPortSIPEvent onACTV TransferFailure long sessionId String reason int code Detailed Description Function Documentation void com portsip OnPortSIPEvent onReceivedRefer long sessionld long 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 50 void com portsip OnPortSIPEvent onReferAccepted long sessionld This callback will be triggered once remote side called acceptRefer to accept the REFER Parameters sessionld The session ID of the call void com portsip OnPortSIPEvent onReferRejected long sessionld String reason int code This callback will be trigg
2. Parameters fromDisplayName The display name of contact from The contact who send the SUBSCRIBE request void com portsip OnPortSIPEvent onRecvMessage long sessionld String mimeType String subMimeType byte messageData int messageDataLength This event will be triggered when received a MESSAGE message in dialog Parameters sessionld The session ID of the call mimeType The message mime type subMimeType The message sub mime type messageData The received message body it s can be text or binary data use the mimeType and subMimeT ype to differentiate them For example if the mimeType is text and subMimeType is plain then messageData is text messsage body if the mimeType is application and subMimeType is vnd 3gpp sms then messageData is binary messsage body messageDataLength messageDataLengt The length of messageData h void com portsip OnPortSIPEvent onRecvOutOfDialogMessage String fromDisplayName String from String toDisplayName String to String mimeType String subMimeType bytel messageData int messageDataLength This event will be triggered when received a MESSAGE message out of dialog for example pager message Parameters fromDisplayName The display name of sender from The message sender toDisplayName The display name of receiver to The receiver mimeType The message mime type subMimeType The message sub mime typ
3. AGC_DEFAULT 1 Platform default AGC_ADAPTIVE_ANALOG 2 Desktop platform windows MAC adaptive mode for use when analog volume control exists AGC ADAPTIVE DIGITAL 3 Scaling takes place in the digital domain e g for conference servers and embedded devices AGC FIXED DIGITAL 4 Can be used on embedded devices where the capture signal level is predictable void com portsip PortSipSdk enableANS int enum nsMode Enable disable Audio Noise Suppression ANS Parameters enum_nsMode Mode Description NS_NONE 0 Disable NS NS_DEFAULT 1 Platform default NS_Conference 2 Conferencing default NS_LOW_SUPPRESSION 3 Lowest suppression NS_MODERATE_SUPPRESSION 4 Moderate suppression NS_HIGH_SUPPRESSION 5 High suppression NS_VERY_HIGH_SUPPRESSION 6 Highest suppression Send OPTIONS INFO MESSAGE functions Functions int com portsip PortSipSdk sendOptions String to String sdp int com portsip PortSipSdk sendInfo long sessionId String mimeType String subMimeType String infoContents long com portsip PortSipSdk sendMessage long sessionId String mimeType String subMimeType byte message int messageLength long com portsip PortSipSdk sendOutOfDialogMessage String to String mimeType String subMimeType byte message int messageLength long com portsip PortSipSdk presenceSubscribeContact String contact String subject int com portsip PortSipSdk pre
4. sipMessage The SIP message headerName Which header want to access of the SIP message Returns String the SIP header of SIP message int com portsip PortSipSdk addExtensionHeader String headerName String header Value Add the extension header custom header into every outgoing SIP message Parameters headerName The custom header name which will be appears in every outgoing SIP message headerValue The custom header value Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk clear AddExtensionHeaders Clear the added extension headers custom headers 19 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 clearAddextensionHeaders if called this function the added extension headers is no longer appear in outgoing SIP message int com portsip PortSipSdk 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 funct
5. 14 addSupportedMimeType Additional setting functions 17 add VideoCodec Audio and video codecs functions 11 answerCall Call functions 24 attendedRefer Refer functions 27 Audio and video codecs functions 10 addAudioCodec 10 addVideoCodec 11 clearAudioCodec 12 clearVideoCodec 12 isAudioCodecEmpty 11 isVideoCodecEmpty 11 setAudioCodecParameter 12 setAudioCodecPayloadType 11 setVideoCodecParameter 12 setVideoCodecPayloadType 11 Audio and video functions 19 displayLocalVideo 21 getDynamicMicrophoneVolumeLevel 22 getDynamicSpeakerVolumeLevel 22 muteMicrophone 22 muteSpeaker 22 sendVideo 21 setLocalVideoWindow 21 setLoudspeakerStatus 22 setRemote VideoWindow 21 setVideoBitrate 20 setVideoDeviceld 20 setVideoFrameRate 20 setVideoNackStatus 22 setVideoOrientation 21 setVideoResolution 20 Audio effect functions 37 enableAEC 38 enableAGC 38 enableANS 39 enableCNG 38 enableV AD 38 audioPlayLoopbackTest Device Manage functions 45 Call functions 23 Call events 46 onInviteAnswered 47 onInviteBeginingForward 48 onInviteClosed 48 onInviteConnected 48 onInviteFailure 48 onInviteIncoming 47 onInviteRinging 47 onInviteSessionProgress 47 onInviteTrying 47 onInviteUpdated 48 onRemoteHold 49 onRemoteUnHold 49 Call functions 23 answerCall 24 call 23 forwardCall 25 hangUp 24 hold 24 muteSession 25 rejectCall 23 sendDtmf 25 unHold 25 updateCal
6. If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk 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 int com portsip PortSipSdk setRtpKeepAlive boolean state int keepAlivePayloadType int deltaTransmitTimeMS Enable or disable send RTP keep alive packet during the call is established Parameters state Set to true allow send the keep alive packet during the conversation keepAlivePayload The payload type of the keep alive RTP packet usually set to 126 17 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 int com portsip PortSipSdk setKeepAliveTime int keepAliveTime Enable or disable send SIP keep alive packet Parameters keepAliveTime This is the SIP keep alive time interval in seconds set to O to disable the SIP keep alive it s in seconds recommend 30 or 50 Returns If the function succeeds the
7. it s PCM format dataLength The data size sampling Fred H The audio stream sample in HZ for example it s 8000 or 16000 Remarks 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 See also PortSipSdk enableAudioStreamCallback void com portsip OnPortSIPEvent onVideoRawCallback long sessionld int enum videoCallbackMode int width int height byte data int dataLength This event will be triggered once received the video packets if called enableVideoStreamCallback function Parameters sessionld The session ID of the call enum videoCallba The type which pasdded in enable VideoStreamCallback function allow ckMode ENUM VIDEOSTREAM NONE ENUM VIDEOSTREAM LOCAL 59 ENUM VIDEOSTREAM REMOTE ENUM VIDEOSTREAM BOTH width The width of video image height The height of video image data The memory of video stream it s YUV420 format YV12 dataLength The data size See also PortSipSdk enableVideoStreamCallback 60 Class Documentation com portsip OnPortSIPEvent Interface Reference Public Member Functions void onRegisterSuccess String reason int code void onRegisterFailure String reason int code void onInviteIncoming long sessionld String callerDisplayName S
8. VIDEOCODEC NONE 1 static final int ENUM VIDEOCODEC 1420 133 static final int ENUM VIDEOCODEC H263 34 static final int ENUM_VIDEOCODEC_H263_ 1998 115 static final int ENUM_VIDEOCODEC_H264 125 static final int ENUM VIDEOCODEC VPS 120 static final int ENUM_RESULUTION_NONE 0 static final int ENUM_RESULUTION_QCIF 1 static final int ENUM RESULUTION CIF 2 static final int ENUM_RESULUTION_VGA 3 static final int ENUM_RESULUTION_SVGA 4 static final int ENUM_RESULUTION_XVGA 5 static final int ENUM _RESULUTION_720P 6 static final int ENUM_RESULUTION_QVGA 7 static final int ENUM_SRTPPOLICY_NONE 0 static final int ENUM _SRTPPOLICY_FORCE 1 static final int ENUM _SRTPPOLICY_PREFER 2 static final int ENUM_TRANSPORT_UDP 0 static final int ENUM TRANSPORT TLS 1 static final int ENUM_TRANSPORT_TCP 2 static final int ENUM TRANSPORT PERS 3 static final int ENUM_LOG_LEVEL_NONE 1 static final int ENUM LOG LEVEL ERROR 1 static final int ENUM LOG LEVEL WARNING 2 static final int ENUM_LOG_LEVEL_INFO 3 static final int ENUM LOG LEVEL DEBUG 4 static final int ENUM DTMF MOTHOD RFC2833 0 static final int ENUM DTMF MOTHOD INFO 1 static final int ENUM ROTATE CAPTURE FRAME 0 0 static final int ENUM _ ROTATE CAPTURE FRAME 90 90 static final int ENUM ROTATE CAPTURE FRAME 180 180 static final int ENUM ROTATE CAPTURE FRAME 270 270 static final int ENUM_AUDIOSTREAM_ NONE 0 static final int
9. 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 enum audioFileFo rmat The audio record file format allow below values enum audioRecor dMode The audio record mode allow below values enum videocodec The codec which using for compress the video data to save into video record file enum videoRecord Mode Allow set video record mode support record received video send video both received and send Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk stopRecord long 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 int com portsip PortSipSdk playVideoFileToRemote long sessionld String aviFile boolean loop int com portsip PortSipSdk stopPlayVideoFileToRemote long sessionId int com portsip PortSipSdk playAudioFileToRemote long sessionld String filename int int com portsip PortSipSdk stopPlay AudioFileToRemote long sessionId int com port
10. 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 com portsip PortSipSdk getSystemOutputMute Retrieves the output device mute state in the operating system Returns If return value is true the output device is muted If false the output device is not muted int com portsip PortSipSdk setMicVolume int 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 int com portsip PortSipSdk getMicVolume Retrieves the current microphone volume Returns If the function succeeds the return value is the microphone volume If the function fails the return value is a specific error code int com portsip PortSipSdk setSystemlnputMute boolean mute Mute the microphone input device completely in the OS Parameters mute 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 com portsip PortSipSdk 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
11. the device speaker it s unavailable for Android and iOS Parameters mute If the value is set to true the speaker is muted set to false to un mute it int com portsip PortSipSdk getDynamicSpeakerVolumeLevel Obtain the dynamic microphone volume level from current call Usually set a timer to call this function to refresh the volume level indicator Returns the dynamic speaker volume by this parameter the range is 0 9 int com portsip PortSipSdk getDynamicMicrophoneVolumeLevel Obtain the dynamic microphone volume level from current call Usually set a timer to call this function to refresh the volume level indicator Returns the dynamic microphone volume by this parameter the range is 0 9 int com portsip PortSipSdk setLoudspeakerStatus boolean useSpeaker Set the audio device that will use for audio call For Android and 1OS just allow switch between earphone and Loudspeaker Parameters useSpeaker Set to true the SDK use loudspeaker for audio call this just available for mobile platform only Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code 23 Call functions Functions long com portsip PortSipSdk call String callee boolean sendSdp boolean videoCall int com portsip PortSipSdk rejectCall long sessionId int code int com portsip PortSipSdk hangUp long sessionId int com portsip PortSipSdk
12. the input device is not muted 45 void com portsip PortSipSdk 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 int com portsip PortSipSdk 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 String com portsip PortSipSdk getVideoCaptureDeviceName int index Gets the name of a specific video capture device given by an index Parameters index Device index 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 Returns the name of a specific video capture device given by an index SDK Callback events Modules Register events Call events Refer events Signaling events MWI events DTME events INFO OPTIONS message events Presence events Play audio and video file finished events RTP callback events Detailed Description SDK Callback events Register events Functions void com portsip OnPortSIPEvent onRegisterSuccess String reason int code void com portsip OnPortSIPEvent onRegisterFailure String reason int code 46 Detailed Description Register events Function Documentation void com po
13. 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 8 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 O If the function fails the return value is a specific error code Refer functions Functions int com portsip PortSipSdk refer long sessionld String referTo int com portsip PortSipSdk attendedRefer long sessionld long replaceSessionld String referTo long com portsip PortSipSdk acceptRefer long referld String referSignaling int com portsip PortSipSdk rejectRefer long referId Detailed Description Function Documentation int com portsip PortSipSdk refer long sessionld String referTo Refer the currently call to another one 27 Parameters sessionld The session ID of the 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 refer sessionId sip testuserl2 sip portsip com You c
14. video codecs functions 12 setVideoCodecPayloadType Audio and video codecs functions 11 setVideoDeviceld Audio and video functions 20 setVideoFrameRate Audio and video functions 20 setVideoNackStatus Audio and video functions 22 set VideoOrientation Audio and video functions 21 set VideoQos RTP and RTCP QOS functions 36 setVideoResolution Audio and video functions 20 setVideoRtcpBandwidth RTP and RTCP QOS functions 35 Signaling events 51 onReceivedSignaling 51 onSendingSignaling 51 startRecord Record functions 31 stopPlayAudioFileToRemote Play audio and video file to remoe functions 32 stopPlayAudioFileToRemoteAsBackground Play audio and video file to remoe functions 33 stopPlayVideoFileToRemote Play audio and video file to remoe functions 32 stopRecord Record functions 31 unHold Call functions 25 unRegisterServer Initialize and register functions Initialize and register 9 updateCall Call functions 24 77
15. you MUST call the enableSendVideoStreamToRemote function Parameters sessionld Session ID of the call conversation data The video video stream data must is i420 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 RTP packets Audio stream and video stream callback Functions void com portsip PortSipSdk setRtpCallback boolean enable void com portsip PortSipSdk enableAudioStreamCallback long sessionId boolean enable int enum audioCallbackMode void com portsip PortSipSdk enable VideoStreamCallback long sessionld int enum videoCallbackMode Detailed Description functions 30 Function Documentation void com portsip PortSipSdk setRtpCallback boolean enable Set the RTP callbacks to allow access the sending and received RTP packets Parameters enable Set to true to enable the RTP callback for received and sending RTP packets the onSendingRtpPacket and onReceivedRtpPacket events will be triggered void com portsip PortSipSdk enableAudioStreamCallback long sessionld boolean enable int enum audioCallbackMode Enable disable the audio stream callback the onAudioRawCallback event will be triggered if the callback is enabled Parameters sessionld The session ID of call en
16. you need to detect the call final state in onInviteTrying onInviteRinging onInviteFailure callback events int com portsip PortSipSdk rejectCall long sessionld int code rejectCall Reject the incoming call Parameters sessionld The sessionld of the call code Reject code for example 486 480 etc 24 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk hangUp long 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 int com portsip PortSipSdk answerCall long sessionld boolean videoCall answerCall Answer the incoming call Parameters sessionld The session ID of call videoCall If the incoming call is a video call and the video codec is matched set to true to answer the video call If set to false the answer call doesn t include video codec answer anyway Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk updateCall long sessionld boolean enableAudio boolean enableVideo updateCall Use the re INVITE to update the established call Parameters sessionld The session ID of call enableAudio
17. 0 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 int com portsip PortSipSdk unRegisterServer Un register from the SIP proxy server 10 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk setLicenseKey String key Set the license key must called before setUser function Parameters key The SDK license key please purchase from PortSIP Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Audio and video codecs functions Functions int com portsip PortSipSdk addAudioCodec int enum_audiocodec int com portsip PortSipSdk addVideoCodec int enum_videocodec boolean com portsip PortSipSdk isAudioCodecEmpty boolean com portsip PortSipSdk isVideoCodecEmpty int com portsip PortSipSdk setAudioCodecPayloadType int enum audiocodec int payloadType int com portsip PortSipSdk setVideoCodecPayloadType int enum videocodec int pay
18. DisplayNam The display name of caller e caller The caller calleeDisplayNam The display name of callee e callee The callee audioCodecs The matched audio codecs it s separated by if have more than one codec videoCodecs The matched video codecs it s separated by if have more than one codec existsAudio If it s true means this call include the audio existsVideo If it s true means this call include the video void com portsip OnPortSIPEvent onInviteFailure long sessionld String reason int 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 void com portsip OnPortSIPEvent onInviteUpdated long sessionld String audioCodecs String videoCodecs boolean existsAudio boolean exists Video This event will be triggered when remote party updated this call Parameters sessionld The session ID of the call audioCodecs The matched audio codecs it s separated by if have more than one codec videoCodecs The matched video codecs it s separated by if have more than one codec existsAudio If it s true means this call include the audio existsVideo If it s true means this call include the video void com portsip OnPortSIPEvent onInviteConnected long sessionld This event will be triggered when UAC sent UAS received ACK the call is connected Some functions hold upda
19. EC H263 ENUM VIDEOCODEC H263 1998 ENUM VIDEOCODEC H264 ENUM VIDEOCODEC VP8 sdpParameter The parameter in string format 13 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 PortSipEnumDefine ENUM VIDEOCODEC H264 profile level id 420033 packetization mode 0 Additional setting functions Functions int com portsip PortSipSdk setDisplayName String displayName String com portsip PortSipSdk getVersion int com portsip PortSipSdk enableReliableProvisional boolean enable int com portsip PortSipSdk enable3GppTags boolean enable void com portsip PortSipSdk enableCallbackSendingSignaling boolean enable void com portsip PortSipSdk setSrtpPolicy int enum srtppolicy int com portsip PortSipSdk setRtpPortRange int minimumRtpAudioPort int maximumRtpAudioPort int minimumRtpVideoPort int maximumRtpVideoPort int com portsip PortSipSdk setRtcpPortRange int minimumRtcpAudioPort int maximumRtcpAudioPort int minimumRtcpVideoPort int mnaximumRtcp VideoPort int com portsip PortSipSdk enableCallForward boolean forBusyOnly String forwardTo int com portsip PortSipSdk disableCallForward int com portsip PortSipSdk enableSessionTimer int timerSeconds void com portsip PortSipSdk disableSessionTimer void com portsip PortSipSdk setDoNotDisturb boolean forBusyOnly int com po
20. EMOTE MIX com portsip PortSipEnumDefine 64 73 ENUM AUDIOSTREAM REMOTE PER CH ANNEL com portsip PortSipEnumDefine 64 ENUM RECORD MODE BOTH com portsip PortSipEnumDefine 64 ENUM RECORD MODE RECV com portsip PortSipEnumDefine 64 ENUM RECORD MODE SEND com portsip PortSipEnumDefine 64 ENUM VIDEOCODEC 1420 com portsip PortSipEnumDefine 63 ENUM VIDEOCODEC NONE com portsip PortSipEnumDefine 63 ENUM VIDEOSTREAM BOTH com portsip PortSipEnumDefine 64 ENUM VIDEOSTREAM LOCAL com portsip PortSipEnumDefine 64 ENUM VIDEOSTREAM NONE com portsip PortSipEnumDefine 64 ENUM VIDEOSTREAM REMOTE com portsip PortSipEnumDefine 64 forwardCall Call functions 25 getAudioRtcpStatistics RTP statistics functions 37 getAudioRtpStatistics RTP statistics functions 37 getDynamicMicrophone VolumeLevel Audio and video functions 22 getDynamicSpeakerVolumeLevel Audio and video functions 22 getExtensionHeaderValue Access SIP message header functions 18 getMicVolume Device Manage functions 44 getNetworkStatistics RTP statistics functions 36 getNumOfPlayoutDevices Device Manage functions 43 getNumOfRecordingDevices Device Manage functions 43 getNumOfVideoCaptureDevices Device Manage functions 45 getPlayoutDeviceName Device Manage functions 43 getRecordingDeviceName Device Manage functions 43 getSpeaker Volume Device Manage functions 44 getSystemInputMute Device Manage functions 44 getSy
21. ENUM AUDIOSTREAM LOCAL MIX 1 static final int ENUM AUDIOSTREAM LOCAL PER CHANNEL 2 static final int ENUM AUDIOSTREAM REMOTE MIX 3 static final int ENUM AUDIOSTREAM REMOTE PER CHANNEL 4 63 VIDEOSTREAM NONE 0 VIDEOSTREAM LOCAL 1 VIDEOSTREAM REMOTE 2 VIDEOSTREAM BOTH 3 RECORD MODE RECV 1 RECORD MODE SEND 2 static final int ENUM RECORD MODE BOTH 3 static final int ENUM AUDIO FILE FORMAT WAVE 1I static final int ENUM AUDIO FILE FORMAT AMR 2 static final int ENUM EC NONE 0 type of Echo Control static final int ENUM EC DEFAULT 1 Disable AEC static final int ENUM EC CONFERENCE 2 Platform default AEC static final int ENUM EC ARC 3 Desktop platform windows MAC Conferencing default aggressive AEC static final int ENUM EC AECM 1 4 Desktop platform windows MAC Acoustic Echo Cancellation desktop Platform default static final int ENUM EC AECM 2 5 Mobile platform iOS Android most earpiece use static final int ENUM EC AECM 3 6 Mobile platform iOS Android Loud earpiece or quiet speakerphone use static final int ENUM EC AECM 4 7 Mobile platform iOS Android most speakerphone use Mobile Platform default static final int ENUM AGC NONE 0 Mobile platform iOS Android Loud speakerphone static final int ENUM AGC DEFAULT 1 static final int ENUM AGC ADAPTIVE ANALOG 2 static final int ENUM AGC ADAPTIVE DIGITAL 3 static final int ENUM AGC FIXED DIGITAL 4 sta
22. EOSTREAM_NONE O static Disable video stream callback final int com portsip PortSipEnumDefine ENUM_VIDEOSTREAM_LOCAL 1 static Local video stream callback final int com portsip PortSipEnumDefine ENUM_VIDEOSTREAM_REMOTE 2 static Remote video stream callback final int com portsip PortSipEnumDefine ENUM VIDEOSTREAM BOTH 3 static Both of local and remote video stream callback final int com portsip PortSipEnumDefine ENUM RECORD MODE RECV 1 static record only received final int com portsip PortSipEnumDefine ENUM RECORD MODE SEND 2 static record only sent out final int com portsip PortSipEnumDefine ENUM RECORD MODE BOTH 3 static record both sent out and received final int com portsip PortSipEnumDefine ENUM AGC NONE O static Mobile platform 1OS Android Loud speakerphone type of Automatic Gain Control 65 The documentation for this class was generated from the following file PortSipEnumDefine java 66 com portsip PortSipSdk Class Reference Classes class MainHandler Public Member Functions void CreateCallManager Context context void DeleteCallManager int initialize int enum transport int enum LogLevel String LogPath int maxLines String agent int audioDeviceLayer int videoDeviceLayer int setUser String userName String displayName String authName String password String localIP int localSIPPort String userDomain String SIPServer int SIPServerPort String STU
23. Event onSendingSignaling long sessionld String message Detailed Description Function Documentation void com portsip OnPortSIPEvent onReceivedSignaling long sessionld String message This event will be triggered when received a SIP message Parameters sessionld The session ID of the call message The SIP message which is received void com portsip OnPortSIPEvent onSendingSignaling long sessionld String message This event will be triggered when sent a SIP message Parameters sessionld The session ID of the call message The SIP message which is sent MWI events Functions void com portsip OnPortSIPEvent onWaitingVoiceMessage String messageAccount int urgentNewMessageCount int urgentOldMessageCount int newMessageCount int oldMessageCount void com portsip OnPortSIPEvent onWaitingFaxMessage String messageAccount int urgentNewMessageCount int urgentOldMessageCount int newMessageCount int oldMessageCount Detailed Description 52 Function Documentation void com portsip OnPortSIPEvent onWaitingVoiceMessage String messageAccount int urgentNewMessageCount int urgentOldMessageCount int newMessageCount int oldMessageCount If has the waiting voice message MWL then this event will be triggered Parameters messageAccount Voice message account urgentNewMessag Urgent new message count eCount urgentOldMessage Urgent old m
24. NServer int STUNServerPort String outboundServer int outboundServerPort int registerServer int expires int retryTimes int unRegisterServer int setLicenseKey String key int addAudioCodec int enum audiocodec int add VideoCodec int enum videocodec boolean isAudioCodecEmpty boolean is VideoCodecEmpty int setAudioCodecPayloadType int enum audiocodec int payloadType int setVideoCodecPayloadType int enum videocodec int payloadType void clearAudioCodec void clear VideoCodec int setAudioCodecParameter int enum audiocodec String sdpParameter int setVideoCodecParameter int enum videocodec String sdpParameter int setDisplayName String displayName String getVersion int enableReliableProvisional boolean enable int enable3GppTags boolean enable void enableCallbackSendingSignaling boolean enable void setSrtpPolicy int enum srtppolicy int setRtpPortRange int minimumRtpAudioPort int maximumRtpAudioPort int minimumRtpV ideoPort int maximumRtpVideoPort int setRtcpPortRange int minimumRtcpAudioPort int maximumRtcpAudioPort int minimumRtcpVideoPort int maximumRtcpVideoPort int enableCallForward boolean forBusyOnly String forwardTo int disableCallForward int enableSessionTimer int timerSeconds void disableSessionTimer void setDoNotDisturb boolean forBusyOnly int detectM wi int enableCheckM wi boolean state int setRtpKeepAlive boolean state int keepAliveP
25. Name String from String toDisplayName String to String reason int code void onPlayAudioFileFinished long sessionId String fileName void onPlayVideoFileFinished long sessionId void onReceivedRTPPacket long sessionId boolean isAudio byte RTPPacket int packetSize void onSendingRTPPacket long sessionId boolean isAudio byte RTPPacket int packetSize void onAudioRawCallback long sessionId int enum_audioCallbackMode byte data int dataLength int samplingFreqHz void onVideoRawCallback long sessionId int enum_videoCallbackMode int width int height bytel data int dataLength The documentation for this interface was generated from the following file OnPortSIPEvent java 62 com portsip PortSipEnumDefine Class Reference Static Public Attributes static final int ENUM AUDIOCODEC G729 18 static final int ENUM AUDIOCODEC PCMA 8 static final int ENUM AUDIOCODEC PCMU 0 static final int ENUM AUDIOCODEC GSM 3 static final int ENUM_AUDIOCODEC_G722 9 static final int ENUM_AUDIOCODEC_ILBC 97 static final int ENUM_AUDIOCODEC_AMR 98 static final int ENUM_AUDIOCODEC_AMRWB 99 static final int ENUM_AUDIOCODEC_SPEEX 100 static final int ENUM_AUDIOCODEC_SPEEXWB 102 static final int ENUM_AUDIOCODEC_ISACWB 103 static final int ENUM_AUDIOCODEC_ISACSWB 104 static final int ENUM_AUDIOCODEC_OPUS 105 static final int ENUM_AUDIOCODEC_DTMF 101 static final int ENUM
26. P version 4 IPv4 TOS field and the IP version 6 IPv6 Traffic Class field priority The 802 1p priority PCP field in a 802 1Q VLAN tag Values 0 7 set the priority value 1 leaves the priority setting unchanged Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code 36 int com portsip PortSipSdk setVideoQos boolean enable int DSCPValue Set the DSCP differentiated services code point value of QoS Quality of Service for video channel Parameters enable Set as true to enable QoS false to disable DSCPValue The six bit DSCP value Valid range is 0 63 As defined in RFC 2472 the DSCP value is the high order 6 bits of the IP version 4 IPv4 TOS field and the IP version 6 IPv6 Traffic Class field Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code RTP statistics functions Functions int com portsip PortSipSdk getNetworkStatistics long sessionId int statistics int com portsip PortSipSdk getAudioRtpStatistics long sessionId int statistics int com portsip PortSipSdk getAudioRtcpStatistics long sessionId int statistics int com portsip PortSipSdk getVideoRtpStatistics long sessionId int statistics Detailed Description Function Documentation int com portsip PortSipSdk getNetworkStatistics long sessionl
27. PortSIP VolP SDK Manual for Android Version 11 2 2 3 21 2015 Table of Contents Welcome to the PortSIP VoIP SDK sese see se ee Re enne GR ee ee ER Re ee GR AA ee Re ee ee ER Re ee Ge ee ee GR Re ee ee RA 3 Module Index es EER R Ee GE GE aciem RR 6 i E L Eata TTT 7 Module Documentation ees see ee ee Re eha Toa GR Re AA ER deN dTa ER Re ee Ge ee ee GR Re ee ER Re ee Ge ee ee GR Prat 8 SDK functions SDK functions i ee se ee oe ae GR AA ER Re GE RA GR ee ER Re ee Ge AA ee GR eneore ee en on ee rennen Ee 8 Initialize and register functions Initialize and register 8 Audio and video codecs functions esses seen ER Re ee RA rnn rennen ee nennen nennen 11 Additional setting functions da Zeat see ee Ge Ge eese eene enne nnne RA entente entes enses ense Ge Re entere 14 Access SIP message header functions 0 0 0 0 ee se se se ee isis Ge ee Ge ee ee ee ee Ge Se Ge Re Ge GR RA Gee ee ee 19 Audio and video functions usta tete d eeclesie ete dye ee ee ede ee ee eek ee 20 Call functions e eet eee dec eterne eet de ee pu ded b ly etd 24 Refer v D T 27 Send audio and video stream functions sss 29 RTP packets Audio stream and video stream callback esee 30 Record PUNCH ONS EE e ede eade tei cede ei e EE EE EN Ee 31 Play audio and video file to remoe functions sess nee een eene 32 Conference funcHORS eee en aep CONTRE REI e 34 RTP and R
28. SCRIBE request which received from contact Parameters subscribeld Subscribe id when received a SUBSCRIBE reguest from contact the event onPresenceRecvSubscribe will be triggered lt bt gt the event inclues the 42 subscribe id Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk presenceOnline long subscribeld String statusText Send a NOTIFY message to contact to notify that presence status is online changed Parameters subscribeld Subscribe id when received a SUBSCRIBE reguest from contact the event onPresenceRecvSubscribe will be triggered the event inclues the subscribe id statusText The state text of presende online for example Tm here Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int com portsip PortSipSdk presenceOffline long subscribeld Send a NOTIFY message to contact to notify that presence status is offline Parameters subscribeld Subscribe id when received a SUBSCRIBE request from contact the event onPresenceRecvSubscribe will be triggered the event inclues the subscribe id Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Device Manage functions Functions int com portsip PortSipSdk getNumOfRe
29. Sdk registerServer int expires int retryTimes int com portsip PortSipSdk unRegisterServer int com portsip PortSipSdk setLicenseKey String key Detailed Description functions Function Documentation void com portsip PortSipSdk CreateCallManager Context context Create the callback handlers Parameters context The context of application void com portsip PortSipSdk DeleteCallManager Release the callbackHandlers int com portsip PortSipSdk initialize int enum transport int enum LogLevel String LogPath int maxLines String agent int audioDeviceLayer int videoDeviceLayer Initialize the SDK Parameters enum transport Transport for SIP signaling it can be set as ENUM_TRANSPORT_UDP ENUM_TRANSPORT_TCP ENUM_TRANSPORT_TLS ENUM_TRANSPORT_PERS The ENUM_TRANSPORT_PERS is the PortSIP private transport for anti the SIP blocking it must using with the PERS enum_LogLevel Set the application log level the SDK generate the PortSIP_Log_datatime log file if the log enabled ENUM LOG LEVEL NONE ENUM LOG LEVEL DEBUG ENUM LOG LEVEL ERROR ENUM LOG LEVEL WARNING ENUM LOG LEVEL INFO ENUM LOG LEVEL DEBUG LogPath The log file path the path folder MUST is exists maxLines In theory support unlimited lines just depends on the device capability for SIP client recommend less than 1 100 agent The User Agent header to insert in SIP messages audioDeviceLayer videoD
30. Set to true to allow the audio in update call false for disable audio in update call enableVideo Set to true to allow the video in update call false for disable video in update call Returns If the function succeeds the return value is 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 updateCall sessionId true false int com portsip PortSipSdk hold long sessionld To place a call on hold 25 Parameters sessionld The session ID of call Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk unHold long 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 int com portsip PortSipSdk muteSession long sessionld boolean mutelncomingAudio boolean muteOutgoingAudio boolean mutelncomingVideo boolean muteOutgoing Video Mute the specified session audio or video Parameters sessionld The
31. TOP QOS functions ssi ceret Cete Cie te dee p uis 35 RTP statistics functions et EE ih eke EE eeu epe tai AG P Rei 37 Audio effect functions ers odere ee Ee ae Cate Demi 38 Send OPTIONS INFO MESSAGE functions sss ss ss ese ee eee eee eers ee ereer enne enne ee nnne ee nente entrent enne 40 Device Manage functions iiaeonoeesmepo uet eene oed 43 SDK Callback events esie ane o Dedi epp e mei DE eI 46 Register events ec EE RE EA EE EE yy 46 OES EE EE EN URE EE DEE OE HI ER ui Id 47 Ao EE se Reus uec cinia ege OB eee EE ee 50 Signaling events coc ise eg eame enim ee ee Pe 52 MWlI events EN EE EE N EE OE OE OE eg peteretur idend 52 DTMF events EE EE EE EE i teens EE ta ON ER OR EE EE EEN 53 INFO OPTIONS message events iese ee se eeren p GR Ge Gee Ge ee ee ee ee Ge SR Re Ge ee PEE enne ee ee ee 54 Presence events sec ea eee ie intesa teet ei cte ON beet ede epe ede ce eee REEN 55 Play audio and video file finished events see se ee ee ee ee Ge SR Re GR GR GRA Re Ge en rennen 57 RTP callback events EE ecd o GE Ke Re GE Atel se DI E Eb Ee Ye etu Be EE Be Me eh Dee 58 Class DoEUIMENtaHON EE tente iet tet itn i dde Ei e 61 com portsip OnPortSIPEvent esses Gee ee sori ee neen teen Re enr e enne Ge ee ee retener enne nen 61 com portsip PortSipEnumDefine sss sese sese eee 63 Com portsip PortSipSdk iss se EES se EVER ete t Res Bed Bee Ed erret Ke ek iret vo pi eie itte sedere gee es 67 com portsip Rende
32. able Set to true to enable audio stream callback false to stop the callback enum audioCallba The audio stream callback mode allow ENUM AUDIOSTREAM NONE ckMode ENUM AUDIOSTREAM LOCAL MIX ENUM AUDIOSTREAM LOCAL PER CHANNEL ENUM AUDIOSTREAM REMOTE MIX ENUM AUDIOSTREAM REMOTE PER CHANNEL void com portsip PortSipSdk enableVideoStreamCallback long sessionld int enum videoCallbackMode Enable disable the video stream callback the onVideoRawCallback event will be triggered if the callback is enabled Parameters sessionld The session ID of call enum videoCallba The video stream callback mode allow below values ckMode ENUM VIDEOSTREAM NONE ENUM VIDEOSTREAM LOCAL ENUM VIDEOSTREAM REMOTE ENUM VIDEOSTREAM BOTH Record functions Functions int com portsip PortSipSdk startRecord long sessionId String recordFilePath String recordFileName boolean appendTimeStamp int enum_audioFileFormat int enum_audioRecordMode int enum_videocodec int enum_videoRecordMode int com portsip PortSipSdk stopRecord long sessionId Detailed Description 31 Function Documentation int com portsip PortSipSdk startRecord long sessionld String recordFilePath String recordFileName boolean appendTimeStamp int enum audioFileFormat int enum audioRecordMode int enum videocodec int enum videoRecordMode Start record the call Parameters sessionld The session ID of
33. an download the demo AVI at http www portsip com downloads video blindtransfer rar use the Windows Media Player to play the AVI file after extracted it will shows how to do the transfer int com portsip PortSipSdk attendedRefer long sessionld long replaceSessionld String referTo Make an attended refer Parameters sessionld 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 long com portsip PortSipSdk acceptRefer long referld String referSignaling Accept the REFER request a new call will be make if called this function usuall called after onReceivedRefer callback event Parameters referld The ID of REFER request that comes from onReceivedRefer callback event referSignaling The SIP message of REFER request that comes from onReceivedRefer callback event Returns If the function succeeds the return value is a session ID greater than 0 to the new call for REFER otherwise is a specific error cod
34. and click Dial button Make call from Bl to Aa enter supo GSU ING 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 2228192 168 1 11 6021 and daal Make calli from B co A enter sip 11192169 1 105080 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 Calslibacksr Module Index Modules Here is a list of all modules SDK functions SDK functions ee ae EE GR ee ER Re ee GE AA ee GR Re ee TORT ee ee OK 8 Initialize and register functions Initialize and register sese 8 Audio and video codecs funCHONS ese see se ee ER Re Ge RR GR ee ER Re ee Ge AA ee Ge en nennen enne ea 11 Additional STTS Te TTT 14 Access SIP message header functions cece ee se see ee ee ee ee Ge Se GR Ge Re GRA RA Ge ee ee Ge ee ee 19 Audio and video functions eie ee ee RA dy TNT aT GR AA ee Re ee TRR ROE Te RUT nein nnne 20 Call f nctions 5 Hed acces EE nent tea akin nm metn enm eR 24 Refer furctiOnss canne eA hae Sane eat Stk o Ee GE ES ORR AE bas 27 Send audio and video stream functions sse nennen nennen nennen nennen 29 RTP packets A
35. answerCall long sessionId boolean videoCall int com portsip PortSipSdk updateCall long sessionId boolean enable Audio boolean enableVideo int com portsip PortSipSdk hold long sessionId int com portsip PortSipSdk unHold long sessionId int com portsip PortSipSdk muteSession long sessionld boolean muteIncomingAudio boolean muteOutgoingAudio boolean muteIncomingVideo boolean muteOutgoingVideo int com portsip PortSipSdk forwardCall long sessionId String forwardTo int com portsip PortSipSdk sendDtmf long sessionld int enum dtmfMethod int code int dtmfDuration boolean playDtmfTone Detailed Description Function Documentation long com portsip PortSipSdk 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 Otherwise no video codec to be added into outgoing SDP Returns If the function succeeds the return value is the session ID of the call greater than 0 If the function fails the return value is a specific error code Note the function success just means the outgoing call is processing
36. ayloadType int deltaTransmitTimeMS int setKeepAliveTime int keepAliveTime int setAudioSamples int ptime int maxptime int addSupportedMimeType String methodName String mimeType String subMimeType String getExtensionHeaderValue String sipMessage String headerName int addExtensionHeader String headerName String headerValue int clearAddExtensionHeaders int modifyHeaderValue String headerName String headerValue int clearModifyHeaders int setVideoDeviceld int deviceld 67 int setVideoResolution int enum resulution int setVideoBitrate int bitrateKbps int setVideoFrameRate int frameRate int sendVideo long sessionld boolean send int setVideoOrientation int enum rotation void setLocalVideoWindow Object localVideoView int setRemoteVideoWindow long sessionId Object remoteVideoView void displayLocalVideo boolean state int setVideoNackStatus boolean state void muteMicrophone boolean mute void muteSpeaker boolean mute int getDynamicSpeakerVolumeLevel int getDynamicMicrophoneV olumeLe vel int setLoudspeakerStatus boolean useSpeaker long call String callee boolean sendSdp boolean videoCall int rejectCall long sessionld int code int hangUp long sessionId int answerCall long sessionld boolean videoCall int updateCall long sessionld boolean enableAudio boolean enable Video int hold long sessionId int unHo
37. cordingDevices int com portsip PortSipSdk getNumOfPlayoutDevices String com portsip PortSipSdk getRecordingDeviceName int index String com portsip PortSipSdk getPlayoutDeviceName int index int com portsip PortSipSdk setSpeakerVolume int volume int com portsip PortSipSdk getSpeakerVolume int com portsip PortSipSdk setSystemOutputMute boolean mute boolean com portsip PortSipSdk getSystemOutputMute int com portsip PortSipSdk setMicVolume int volume int com portsip PortSipSdk getMicVolume int com portsip PortSipSdk setSystemInputMute boolean mute boolean com portsip PortSipSdk getSystemInputMute void com portsip PortSipSdk audioPlayLoopbackTest boolean enable int com portsip PortSipSdk getNumOfV ideoCaptureDevices String com portsip PortSipSdk getVideoCaptureDeviceName int index 43 Detailed Description Function Documentation int com portsip PortSipSdk 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 int com portsip PortSipSdk getNumOfPlayoutDevices Gets the number of audio devices available for audio playout Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code String com portsip PortSipSdk
38. d int statistics Get the in call statistics The statistics are reset after the query Parameters sessionId The session ID of call conversation Statistics Return network statistic statistics 0 Current jitter buffer size in ms statistics 1 Preferred buffer size in ms statistics 2 Loss rate network late in percent statistics 3 Late loss rate in percent statistics 4 Fraction of original stream of synthesized speech inserted through expansion statistics 5 Fraction of synthesized speech inserted through pre emptive expansion statistics 6 fraction of data removed through acceleration through acceleration Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code 37 int com portsip PortSipSdk getAudioRtpStatistics long sessionld int statistics Obtain the RTP statisics of audio channel Parameters sessionld The session ID of call conversation statistics Return audio rtp statistic statistics 0 Short time average jitter in milliseconds statistics 1 Maximum short time jitter in milliseconds statistics 2 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 int com portsip PortSipSdk getAudioRtcpStatistics long sessionld int statistics Obtain the RTCP sta
39. dType 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 void com portsip PortSipSdk clearAudioCodec Remove all enabled audio codecs void com portsip PortSipSdk clearVideoCodec Remove all enabled video codecs int com portsip PortSipSdk setAudioCodecParameter int enum audiocodec String sdpParameter Set the codec parameter for audio codec Parameters enum audiocodec Audio codec type allow ENUM AUDIOCODEC G729 ENUM AUDIOCODEC PCMA ENUM AUDIOCODEC PCMU ENUM AUDIOCODEC GSM ENUM AUDIOCODEC G722 ENUM AUDIOCODEC ILBC ENUM AUDIOCODEC AMR ENUM AUDIOCODEC AMRWB ENUM AUDIOCODEC SPEEX ENUM AUDIOCODEC SPEEXWB ENUM AUDIOCODEC ISACWB ENUM AUDIOCODEC ISACSWB ENUM AUDIOCODEC OPUS ENUM AUDIOCODEC DTMFE Parameters sdpParameter 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 See also PortSipEnumDefine Remarks Example setAudioCodecParameter AUDIOCODEC AMR mode set 0 octet align 1 robust sorting 0 int com portsip PortSipSdk setVideoCodecParameter int enum videocodec String sdpParameter Set the codec parameter for video codec Parameters enum videocodec Video codec type allow ENUM VIDEOCOD
40. droid Applicatiion Project 3 Copy all files form libs directory under extracted directory to the libs directoy of your new application 4 import The dependent class form the SDK example import com portsip OnPortSIPEvent Impor Eomipo IE Ford CSS 5 Inherit the interface OnPortSIPEvent to process the callback events 6 Initialize sdk Example mPortSIPSDK new PortSipSdk mPortSIPSDK setOnPortSIPEvent instanceofOnPortSIPEvent mPortSIPSDK CreateCallManager context MPoESKESPR aniria lizenn 7 More details please read the Sample project source code 4 How to test the P2P call without SIP server 1 Download and extract the SDK sample project zip file compile and run the P2PSample project 2 Run the P2Psample on two devices for example run it on device A and device B A IP address is 192 60 1 10 is We address is WY GS 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 password 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 poi clic she mies diie butou aga im 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
41. e messageData The received message body it s can be text or binary data use the mimeType and subMimeType to differentiate them For example if the mimeType is text and subMimeType is plain then messageData is text messsage body if the mimeType is application and subMimeType is vnd 3gpp sms then messageData is binary messsage body messageDataLengt The length of messageData h void com portsip OnPortSIPEvent onSendMessageSuccess long sessionld long messageld If the message was sent succeeded in dialog this event will be triggered Parameters sessionld The session ID of the call messageld The message ID it s eguals the return value of sendMessage function 56 void com portsip OnPortSIPEvent onSendMessageFailure long sessionld long messageld String reason int code If the message was sent failure out of dialog this event will be triggered Parameters sessionld The session ID of the call messageld The message ID it s eguals the return value of sendMessage function reason The failure reason code Failure code void com portsip OnPortSIPEvent onSendOutOfDialogMessageSuccess long 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 f
42. e void onReceivedSignaling long sessionId String message void onSendingSignaling long sessionld String message void onWaitingVoiceMessage String messageAccount int urgentNewMessageCount int urgentOldMessageCount int newMessageCount int oldMessageCount void onWaitingFaxMessage String messageAccount int urgentNewMessageCount int urgentOldMessageCount int newMessageCount int oldMessageCount void onRecvDtmfTone long sessionId int tone void onRecvOptions String optionsMessage void onRecvInfo String infoMessage void onPresenceRecvS ubscribe long subscribeld String fromDisplayName String from String subject void onPresenceOnline String fromDisplayName String from String stateText void onPresenceOffline String fromDisplayName String from void onRecvMessage long sessionId String mimeType String subMimeType bytel messageData int messageDataLength void onRecvOutOfDialogMessage String fromDisplayName String from String toDisplayName String to String mimeType String subMimeType byte messageData int messageDataLength void onSendMessageSuccess long sessionld long messageld void onSendMessageFailure long sessionld long messageld String reason int code 61 void onSendOutOfDialogMessageSuccess long messageld String fromDisplayName String from String toDisplayName String to void onSendOutOfDialogMessageFailure long messageld String fromDisplay
43. e long sessionId String mimeType String subMimeType bytel message int messageLength long sendOutOfDialogMessage String to String mimeType String subMimeType byte message int messageLength long presenceSubscribeContact String contact String subject int presenceRejectSubscribe long subscribeld int presenceAcceptSubscribe long subscribeld int presenceOnline long subscribeld String statusText int presenceOffline long subscribeld int getNumOfRecordingDevices int getNumOfPlayoutDevices String getRecordingDeviceName int index String getPlayoutDeviceName int index int setSpeakerVolume int volume int getSpeakerVolume int setSystemOutputMute boolean mute boolean getSystemOutputMute int setMicVolume int volume int getMicVolume int setSystemInputMute boolean mute boolean getSystemInputMute void audioPlayLoopbackTest boolean enable int getNumOfVideoCaptureDevices String getVideoCaptureDeviceName int index void receiveSIPEvent int sipCommand void receivedRTPPacket long sessionld boolean isAudio bytel RTPPacket int packetSize void sendingRTPPacket long sessionId boolean isAudio bytel RTPPacket int packetSize void audioRawCallback long sessionId int enum audioCallbackMode bytel data int dataLength int samplingFreqHz void videoRawCallback long sessionId int enum videoCallbackMode int width int height bytel data int dataLength void setOnPortSIPEve
44. e The file full path name such as mnt sdcard test wav fileSamplesPerSec The wave file sample in seconds should be 8000 or 16000 or 32000 loop Set to false to stop play audio file when it is end Set to true to play it as repeat Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk stopPlayAudioFileToRemote long sessionld Stop play wave file to remote side Parameters sessionld Session ID of the call Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code 33 int com portsip PortSipSdk play AudioFileToRemoteAsBackground long sessionld String filename int 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 mnt sdcard test 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 int com portsip PortSipSdk stopPlay AudioFileToRemoteAsBackground long sessionld Stop play an wave file to remote party as conversation background sound Parameters sessionld Session ID of the call Returns If the function succeeds the return va
45. e 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 sendMessage sessionId application vnd 3gpp sms binData binDataSize 41 long com portsip PortSipSdk sendOutOfDialogMessage String to String mimeType String subMimeType byte message int messageLength Send a out of dialog MESSAGE message to remote side Parameters to The message receiver Likes sip receiver portsip com mimeType The mime type of MESSAGE message subMimeType The sub mime type of MESSAGE message message The contents which send with MESSAGE message allow binary data messageLength The 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
46. e less than 0 int com portsip PortSipSdk rejectRefer long referld Reject the REFER request Parameters referld The ID of REFER request that comes from onReceivedRefer callback event Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code 28 Send audio and video stream functions Functions int com portsip PortSipSdk enableSendPcmStreamToRemote long sessionId boolean state int streamSamplesPerSec int com portsip PortSipSdk sendPcmStreamToRemote long sessionId bytel data int dataLength int com portsip PortSipSdk enableSend VideoStreamToRemote long sessionId boolean state int com portsip PortSipSdk sendVideoStreamToRemote long sessionId bytel data int dataLength int width int height Detailed Description Function Documentation int com portsip PortSipSdk enableSendPcmStreamToRemote long sessionid boolean state int streamSamplesPerSec Enable the SDK send PCM stream data to remote side from another source to instread of microphone MUST called this function first if want to send the PCM stream data to another side Parameters sessionld The session ID of call state Set to true to enable the send stream false to disable streamSamplesPer The PCM stream data sample in seconds for example 8000 or 16000 Sec Returns If the function succeeds the return value is 0 If the function fails the
47. eld void com portsip OnPortSIPEvent onSendMessageFailure long sessionld long messageld String reason int code void com portsip OnPortSIPEvent onSendOutOfDialogMessageSuccess long messageld String fromDisplayName String from String toDisplayName String to void com portsip OnPortSIPEvent onSendOutOfDialogMessageFailure long messageld String fromDisplayName String from String toDisplayName String to String reason int code Detailed Description Function Documentation void com portsip OnPortSIPEvent onPresenceRecvSubscribe long 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 reguest fromDisplayName The display name of contact from The contact who send the SUBSCRIBE request subject The subject of the SUBSCRIBE request void com portsip OnPortSIPEvent onPresenceOnline 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 55 void com portsip OnPortSIPEvent onPresenceOffline String fromDisplayName String from When the contact is went offline then this event will be triggered
48. emoe functions 31 playAudioFileToRemote 32 playAudioFileToRemoteAsBackground 33 play VideoFileToRemote 32 stopPlay AudioFileToRemote 32 stopPlayAudioFileToRemoteAsBackground 33 stopPlayVideoFileToRemote 32 play AudioFileToRemote Play audio and video file to remoe functions 32 play AudioFileToRemoteAsBackground Play audio and video file to remoe functions 33 play VideoFileToRemote Play audio and video file to remoe functions 32 Presence events 54 onPresenceOffline 55 onPresenceOnline 54 onPresenceRecvSubscribe 54 onRecvMessage 55 onRecvOutOfDialogMessage 55 onSendMessageFailure 56 onSendMessageSuccess 55 onSendOutOfDialogMessageFailure 56 onSendOutOfDialogMessageSuccess 56 presenceAcceptSubscribe Send OPTIONS INFO MESSAGE functions 41 presenceOffline Send OPTIONS INFO MESSAGE functions 42 presenceOnline Send OPTIONS INFO MESSAGE functions 42 presenceRejectSubscribe Send OPTIONS INFO MESSAGE functions 41 presenceSubscribeContact 75 Send OPTIONS INFO MESSAGE functions 41 Record functions 30 startRecord 31 stopRecord 31 refer Refer functions 26 Refer events 49 onACTV TransferFailure 50 onACTV TransferSuccess 50 onReceivedRefer 49 onReferAccepted 50 onReferRejected 50 onTransferRinging 50 onTransferTrying 50 Refer functions 26 acceptRefer 27 attendedRefer 27 refer 26 rejectRefer 27 Register events 45 onRegisterFailure 46 onRegisterSuccess 46 registerServe
49. enable int DSCPValue 35 Detailed Description Function Documentation int com portsip PortSipSdk setAudioRtcpBandwidth long sessionld int BitsRR int BitsRS int KBitsAS Set the audio RTCP bandwidth parameters as the RFC3556 Parameters sessionld Set the audio RTCP bandwidth parameters as the RFC3556 BitsRR The bits for the RR parameter BitsRS The bits for the RS parameter KBitsAS The Kbits for the AS parameter Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int com portsip PortSipSdk setVideoRtcpBandwidth long sessionld int BitsRR int BitsRS int 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 int com portsip PortSipSdk setAudioQos boolean enable int DSCPValue int priority Set the DSCP differentiated services code point value of QoS Quality of Service for audio channel Parameters enable Set to true to enable audio QoS DSCPValue The six bit DSCP value Valid range is 0 63 As defined in RFC 2472 the DSCP value is the high order 6 bits of the I
50. enable AGC int enum agcMode void com portsip PortSipSdk enable ANS int enum nsMode Detailed Description Function Documentation void com portsip PortSipSdk enableVAD boolean state Enable disable Voice Activity Detection V AD Parameters state Set to true to enable VAD false to disable void com portsip PortSipSdk enableAEC int enum_aecMode Enable disable AEC Acoustic Echo Cancellation Parameters enum_aecMode Mode Description EC_NONE 0 Disable AEC EC_DEFAULT 1 Platform default AEC EC_CONFERENCE 2 Desktop platform windows MAC Conferencing default aggressive AEC EC_AEC 3 Desktop platform windows MAC Acoustic Echo Cancellation desktop Platform default EC AECM 1 4 Mobile platform 1OS Android most earpiece use EC AECM 2 5 Mobile platform 10OS Android Loud earpiece or quiet speakerphone use EC AECM 3 6 Mobile platform 1OS Android most speakerphone use Mobile Platform default EC AECM 4 7 Mobile platform 1OS Android Loud speakerphone void com portsip PortSipSdk enableCNG boolean state Enable disable Comfort Noise Generator CNG Parameters state Set to true to enable CNG false to disable void com portsip PortSipSdk enableAGC int enum agcMode Enable disable Automatic Gain Control AGC 39 Parameters enum_agcMode Mode Description AGC_NONE 0 Disable AGC
51. ered Parameters sessionld The session ID of the call void com portsip OnPortSIPEvent onInviteSessionProgress long sessionld String audioCodecs String videoCodecs boolean existsEarlyMedia boolean existsAudio boolean existsVideo Once the caller received the 183 session progress message this event will be triggered Parameters sessionld The session ID of the call audioCodecs The matched audio codecs it s separated by if have more than one codec videoCodecs The matched video codecs it s separated by if have more than one codec existsEarlyMedia If it s true means the call has early media existsAudio If it s true means this call include the audio existsVideo If it s true means this call include the video void com portsip OnPortSIPEvent onInviteRinging long sessionld String statusText int 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 void com portsip OnPortSIPEvent onInviteAnswered long sessionld String callerDisplayName String caller String calleeDisplayName String callee String audioCodecs String videoCodecs boolean existsAudio boolean existsVideo If the remote party was answered the call this event triggered 48 Parameters sessionld The session ID of the call caller
52. ered once remote side called rejectRefer to reject the REFER Parameters sessionld The session ID of the call reason Reject reason code Reject code void com portsip OnPortSIPEvent onTransferTrying long sessionld When the refer call is processing this event trigged Parameters sessionld The session ID of the call void com portsip OnPortSIPEvent onTransferRinging long sessionld When the refer call is ringing this event trigged Parameters sessionld The session ID of the call void com portsip OnPortSIPEvent onACTVTransferSuccess long sessionld When the refer call is succeeds this event will be triggered The ACTV means Active For example A established the call with B A transfer B to C C accepted the refer call A received this event Parameters sessionld The session ID of the call void com portsip OnPortSIPEvent onACTVTransferFailure long sessionld String reason int code When the refer call is fails this event will be triggered The ACTV means Active For example A established the call with B A transfer B to C C rejected this refer call A will received this event Parameters sessionld The session ID of the call reason The error reason code The error code 51 Signaling events Functions void com portsip OnPortSIPEvent onReceivedSignaling long sessionId String message void com portsip OnPortSIP
53. essage count Count newMessageCount New message count oldMessageCount Old message count void com portsip OnPortSIPEvent onWaitingFaxMessage String messageAccount int urgentNewMessageCount int urgentOldMessageCount int newMessageCount int 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 DTMF events Functions void com portsip OnPortSIPEvent onRecvDtmfTone long sessionId int tone Detailed Description Function Documentation void com portsip OnPortSIPEvent onRecvDtmfTone long sessionld int tone This event will be triggered when received a DTMF tone from remote side Parameters sessionld The session ID of the call tone 53 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 8 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 INFO OPTIONS message events Functions v
54. essionId String filename int fileSamplesPerSec boolean loop int stopPlayAudioFileToRemote long sessionId int playAudioFileToRemote AsBackground long sessionId String filename int fileSamplesPerSec int stopPlayAudioFileToRemoteAsBackground long sessionId int createConference Object conference VideoWindow int enum_videoResolution boolean displayLocal VideoInConference void destroyConference int setConference VideoWindow Object conference Video Window int joinToConference long sessionId int removeFromConference long sessionId int setAudioRtcpBandwidth long sessionId int BitsRR int BitsRS int KBitsAS int setVideoRtcpBandwidth long sessionId int BitsRR int BitsRS int KBitsAS int setAudioQos boolean enable int DSCP Value int priority 68 int setVideoQos boolean enable int DSCPValue int getNetworkStatistics long sessionld int statistics int getAudioRtpStatistics long sessionld int statistics int getAudioRtcpStatistics long sessionId int statistics int getVideoRtpStatistics long sessionId int statistics void enable VAD boolean state void enableAEC int enum_aecMode void enableCNG boolean state void enableAGC int enum_agcMode void enableANS int enum_nsMode int sendOptions String to String sdp int sendInfo long sessionId String mimeType String subMimeType String infoContents long sendMessag
55. etLocalVideoWindow Object ocalVideo View Set the the window that using to display the local video image Parameters localVideoView SurfaceView a SurfaceView to display local video image from camera int com portsip PortSipSdk setRemoteVideoWindow long sessionld Object remoteVideo View Set the window for a session that using to display the received remote video image Parameters sessionld The session ID of the call remoteVideoView Surface View a SurfaceView to display received remote video image Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code void com portsip PortSipSdk displayLocalVideo boolean state Start stop to display the local video image 22 Parameters state Set to true to display local video iamge int com portsip PortSipSdk setVideoNackStatus boolean state Enable disable the NACK feature rfc6642 which help to improve the video guatliy Parameters state Set to true to enable Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code void com portsip PortSipSdk muteMicrophone boolean mute Mute the device microphone Parameters mute If the value is set to true the microphone is muted set to false to un mute it void com portsip PortSipSdk muteSpeaker boolean mute Mute
56. eviceLayer 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 2 AndroidOpenSLES Use the OpenSL ES for audio device just valid to Android if you got bad voice with this optional please try AndroidAudioTrackJni 3 AndroidAudioTrackJni Use Audio Track JNI for audio device just valid to Android if you got bad voice with this optional please try AndroidOpenSLES Specifies which video device layer should be using 0 Use the OS default device 1 Use Virtual device usually use this for the device which no camera installed Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk setUser String userName String displayName String authName String password String locallP int localSIPPort String userDomain String SIPServer int SIPServerPort String STUNServer int STUNServerPort String outboundServer int outboundServerPort Set user account info Parameters userName Account User name of the SIP usually provided by an IP Telephony service provider displayName The display name of user you can set it as your like such as James Kend It s optional authName Authorization user name usually equals the username password The pass
57. getRecordingDeviceName int index Gets the name of a specific recording device given by an index Parameters index 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 Returns String the name of a specific recording device given by an index String com portsip PortSipSdk getPlayoutDeviceName int index Gets the name of a specific playout device given by an index Parameters index Device index 0 1 2 N 1 where N is given by getNumOfPlayoutDevices U Also 1 is a valid value and will return the name of the default playout device Returns String the name of a specific playout device given by an index int com portsip PortSipSdk setSpeakerVolume int volume Set 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 44 int com portsip PortSipSdk getSpeakerVolume Gets the speaker volume level Returns If the function succeeds the return value is speaker volume If the function fails the return value is a specific error code int com portsip PortSipSdk setSystemOutputMute boolean mute Mutes the speaker device completely in the OS Parameters mute If set to true the device output is
58. ideo 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 int com portsip PortSipSdk setVideoFrameRate int frameRate Set the video frame rate Usually you do not need to call this function set the frame rate the SDK using default frame rate 21 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 int com portsip PortSipSdk sendVideo long sessionld boolean send Send the video to remote side Parameters sessionld The session ID of the call send 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 int com portsip PortSipSdk setVideoOrientation int enum rotation Changing the orientation of the video Parameters enum rotation The video rotation that you want to set it allows ENUM ROTATE CAPTURE FRAME 0 ENUM ROTATE CAPTURE FRAME 90 ENUM ROTATE CAPTURE FRAME 180 ENUM ROTATE CAPTURE FRAME 270 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code void com portsip PortSipSdk s
59. ion fails the return value is a specific error code 16 int com portsip PortSipSdk enableSessionTimer int timerSeconds This function 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 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 void com portsip PortSipSdk disableSessionTimer Disable the session timer void com portsip PortSipSdk setDoNotDisturb boolean forBusyOnly Enable the Do not disturb to enable disable Parameters forBusyOnly If set to true the SDK reject all incoming calls anyway int com portsip PortSipSdk detectMwi Use to obtain the MWI status Returns
60. ion succeeds the return value is 0 If the function fails the return value is a specific error code Remarks Example modify Expires header and User Agent header value for every outgoing SIP message modifyHeaderValue Expires 1000 modifyHeaderValue User Agent MyTest Softphone 1 0 int com portsip PortSipSdk 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 1000 modifyHeaderValue User Agent MyTest Softphone 1 0 cleaModifyHeaders Audio and video functions Functions int com portsip PortSipSdk setVideoDeviceld int deviceld int com portsip PortSipSdk setVideoResolution int enum resulution int com portsip PortSipSdk setVideoBitrate int bitrateKbps int com portsip PortSipSdk setVideoFrameRate int frameRate int com portsip PortSipSdk sendVideo long sessionld boolean send int com portsip PortSipSdk setVideoOrientation int enum rotation void com portsip PortSipSdk setLocalVideoWindow Object localVideoView int com portsip PortSipSdk setRemoteVideoWindow long sessionId Object remote Video View 20 void com portsip PortSipSdk displayLocalVideo boolean
61. l 24 clearAddExtensionHeaders Access SIP message header functions 18 clearAudioCodec 72 Audio and video codecs functions 12 clearModifyHeaders Access SIP message header functions 19 clearVideoCodec Audio and video codecs functions 12 com portsip OnPortSIPEvent 60 com portsip PortSipEnumDefine 62 com portsip PortSipSdk 66 com portsip Renderer 70 com portsip PortSipEnumDefine ENUM AGC NONE 64 ENUM AUDIOSTREAM LOCAL MIX 64 ENUM AUDIOSTREAM LOCAL PER CHANNEL 64 ENUM AUDIOSTREAM REMOTE MIX 64 ENUM AUDIOSTREAM REMOTE PER CHANNEL 64 NUM RECORD MODE BOTH 64 NUM RECORD MODE RECV 64 NUM RECORD MODE SEND 64 NUM VIDEOCODEC 1420 63 NUM VIDEOCODEC NONE 63 NUM VIDEOSTREAM BOTH 64 NUM VIDEOSTREAM LOCAL 64 NUM VIDEOSTREAM NONE 64 ENUM VIDEOSTREAM REMOTE 64 Conference functions 33 createConference 33 destroyConference 34 joinToConference 34 removeFromConference 34 setConferenceVideoWindow 34 CreateCallManager Initialize and register functions Initialize and register 8 createConference Conference functions 33 DeleteCallManager Initialize and register functions Initialize and register 8 destroyConference Conference functions 34 detectM wi Additional setting functions 16 Device Manage functions 42 audioPlayLoopbackTest 45 getMicVolume 44 getNumOfPlayoutDevices 43 getNumOfRecordingDevices 43 getNumOfVideoCaptureDevices 45 getPlayoutDeviceName 43 getRecordingDeviceName 43 getSpeakerV
62. l events 47 onInviteUpdated Call events 48 onPlayAudioFileFinished Play audio and video file finished events 57 onPlayVideoFileFinished Play audio and video file finished events 57 onPresenceOffline Presence events 55 onPresenceOnline Presence events 54 onPresenceRecvSubscribe Presence events 54 onReceivedRefer Refer events 49 onReceivedRTPPacket RTP callback events 57 onReceivedSignaling Signaling events 51 onRecvDtmfTone DTMF events 52 onRecvInfo INFO OPTIONS message events 53 onRecvMessage Presence events 55 onRecvOptions INFO OPTIONS message events 53 onRecvOutOfDialogMessage Presence events 55 onReferAccepted Refer events 50 onReferRejected Refer events 50 onRegisterFailure Register events 46 onRegisterSuccess Register events 46 onRemoteHold Call events 49 onRemoteUnHold Call events 49 onSendingRTPPacket RTP callback events 58 onSendingSignaling Signaling events 51 onSendMessageFailure Presence events 56 onSendMessageSuccess Presence events 55 onSendOutOfDialogMessageFailure Presence events 56 onSendOutOfDialogMessageSuccess Presence events 56 onTransferRinging Refer events 50 onTransferTrying Refer events 50 onVideoRawCallback RTP callback events 58 onWaitingFaxMessage MWI events 52 onWaitingVoiceMessage MWI events 52 Play audio and video file finished events 56 onPlayAudioFileFinished 57 onPlayVideoFileFinished 57 Play audio and video file to r
63. ld long sessionId int muteSession long sessionId boolean muteIncomingAudio boolean muteOutgoing Audio boolean muteIncoming Video boolean muteOutgoing Video int forwardC all long sessionId String forwardTo int sendDtmf long sessionld int enum dtmfMethod int code int dtmfDuration boolean playDtmfTone int refer long sessionld String referTo int attendedRefer long sessionId long replaceSessionld String referTo long acceptRefer long referld String referSignaling int rejectRefer long referId int enableSendPcmStreamToRemote long sessionld boolean state int streamSamplesPerSec int sendPcmStreamToRemote long sessionld bytel data int dataLength int enableSendVideoStreamToRemote long sessionld boolean state int send VideoStreamToRemote long sessionId byte data int dataLength int width int height void setRtpCallback boolean enable void enableAudioStreamCallback long sessionld boolean enable int enum audioCallbackMode void enableVideoStreamCallback long sessionld int enum videoCallbackMode int startRecord long sessionld String recordFilePath String recordFileName boolean appendTimeStamp int enum audioFileFormat int enum audioRecordMode int enum videocodec int enum videoRecordMode int stopRecord long sessionId int playVideoFileToRemote long sessionId String aviFile boolean loop boolean play Audio int stopPlayVideoFileToRemote long sessionId int playAudioFileToRemote long s
64. load Type void com portsip PortSipSdk clearAudioCodec void com portsip PortSipSdk clear VideoCodec int com portsip PortSipSdk setAudioCodecParameter int enum audiocodec String sdpParameter int com portsip PortSipSdk setVideoCodecParameter int enum videocodec String sdpParameter Detailed Description Function Documentation int com portsip PortSipSdk add AudioCodec int enum audiocodec Enable an audio codec it will be appears in SDP Parameters enum audiocodec Audio codec type allow ENUM AUDIOCODEC G729 ENUM AUDIOCODEC PCMA ENUM AUDIOCODEC PCMU ENUM AUDIOCODEC GSM ENUM AUDIOCODEC G722 ENUM AUDIOCODEC ILBC ENUM AUDIOCODEC AMR ENUM AUDIOCODEC AMRWB ENUM AUDIOCODEC SPEEX ENUM AUDIOCODEC SPEEXWB ENUM AUDIOCODEC ISACWB ENUM AUDIOCODEC ISACSWB ENUM AUDIOCODEC OPUS ENUM AUDIOCODEC DTMFE 11 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk addVideoCodec int enum videocodec Enable a video codec it will be appears in SDP Parameters enum videocodec Video codec type allow ENUM VIDEOCODEC H263 ENUM VIDEOCODEC H263 1998 ENUM VIDEOCODEC H264 ENUM VIDEOCODEC VPS Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code boolean com
65. lue is 0 If the function fails the return value is a specific error code Conference functions Functions int com portsip PortSipSdk createConference Object conference Video Window int enum videoResolution boolean displayLocalVideoInConference void com portsip PortSipSdk destroyConference int com portsip PortSipSdk setConferenceVideoWindow Object conferenceVideoWindow int com portsip PortSipSdk joinToConference long sessionld int com portsip PortSipSdk removeFromConference long sessionId Detailed Description Function Documentation int com portsip PortSipSdk createConference Object conference Video Window int enum videoResolution boolean displayLocalVideolnConference Create a conference It s failures if the exists conference isn t destroy yet Parameters conferenceVideoW SurfaceView The window which using to display the conference video indow enum videoResolu The conference video resolution allow ENUM RESULUTION NONE tion ENUM RESULUTION QCIF ENUM RESULUTION CIF ENUM RESULUTION VGA ENUM RESULUTION SVGA 34 ENUM RESULUTION XVGA ENUM RESULUTION 720P ENUM RESULUTION OVGA displayLocalVideo displayLocalVideoInConference InConference Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code void com portsip PortSipSdk destroyConference Destroy the exist c
66. nt OnPortSIPEvent 1 Detailed Description Author PortSIP Solutions Inc All rights reserved Version 11 2 1 69 The documentation for this class was generated from the following file PortSipSdk java 70 com portsip Renderer Class Reference Static Public Member Functions static Surface View CreateRenderer Context context static SurfaceView CreateRenderer Context context boolean useOpenGLES2 static SurfaceView CreateLocalRenderer Context context static SurfaceHolder GetLocalRenderer The documentation for this class was generated from the following file Rendererjava 71 Index acceptRefer Refer functions 27 Access SIP message header functions 18 addExtensionHeader 18 clearAddExtensionHeaders 18 clearModifyHeaders 19 getExtensionHeaderValue 18 modifyHeaderValue 19 addAudioCodec Audio and video codecs functions 10 addExtensionHeader Access SIP message header functions 18 Additional setting functions 13 addSupportedMimeType 17 detectM wi 16 disableCallForward 15 disableSessionTimer 16 enable3GppTags 14 enableCallbackSendingSignaling 14 enableCallForward 15 enableCheckMwi 16 enableReliableProvisional 14 enableSessionTimer 16 getVersion 14 setAudioSamples 17 setDisplayName 13 setDoNotDisturb 16 setKeepAliveTime 17 setRtcpPortRange 15 setRtpKeepAlive 16 setRtpPortRange 14 setSrtpPolicy
67. o another thread and execute SDK API functions or other code in another thread void com portsip OnPortSIPEvent onSendingRTPPacket long sessionld boolean isAudio bytel RTPPacket int packetSize If called setRTPCallback function to enabled the RTP callback this event will be triggered once sending 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 Remarks Don t call any SDK API functions in this event directly If you want to call the API functions or other code which will spend long time you should post a message to another thread and execute SDK API functions or other code in another thread void com portsip OnPortSIPEvent onAudioRawCallback long sessionld int enum audioCallbackMode byte data int dataLength int samplingFreqHz This event will be triggered once received the audio packets if called enableAudioStreamCallback function Parameters sessionld The session ID of the call enum audioCallba The type which pasdded in enable AudioStreamCallback function allow ckMode ENUM AUDIOSTREAM NONE ENUM AUDIOSTREAM LOCAL MIX ENUM AUDIOSTREAM LOCAL PER CHANNEL ENUM_AUDIOSTREAM_REMOTE MIX ENUM AUDIOSTREAM REMOTE PER CHANNEL Parameters data The memory of audio stream
68. oid com portsip OnPortSIPEvent onRecvOptions String optionsMessage void com portsip OnPortSIPEvent onRecvInfo String infoMessage Detailed Description Function Documentation void com portsip OnPortSIPEvent onRecvOptions String optionsMessage This event will be triggered when received the OPTIONS message Parameters optionsMessage The received whole OPTIONS message in text format void com portsip OnPortSIPEvent onRecvlnfo String infoMessage This event will be triggered when received the INFO message Parameters infoMessage The received whole INFO message in text format Presence events Functions void com portsip OnPortSIPEvent onPresenceRecvSubscribe long subscribeld String fromDisplayName String from String subject void com portsip OnPortSIPEvent onPresenceOnline String fromDisplayName String from String stateText void com portsip OnPortSIPEvent onPresenceOffline String fromDisplayName String from void com portsip OnPortSIPEvent onRecvMessage long sessionId String mimeType String subMimeType bytel messageData int messageDataLength void com portsip OnPortSIPEvent onRecvOutOfDialogMessage String fromDisplayName String from String toDisplayName String to String mimeType String subMimeType byte messageData int messageDataLength void com portsip OnPortSIPEvent onSendMessageSuccess long sessionId long messag
69. olume 44 getSystemInputMute 44 Er rrj rrj rrj rrj Hd rn rri getSystemOutputMute 44 getVideoCaptureDeviceName 45 setMicVolume 44 setSpeakerVolume 43 setSystemInputMute 44 setSystemOutputMute 44 disableCallForward Additional setting functions 15 disableSessionTimer Additional setting functions 16 displayLocalVideo Audio and video functions 21 DTMF events 52 onRecvDtmfTone 52 enable3GppTags Additional setting functions 14 enableAEC Audio effect functions 38 enableAGC Audio effect functions 38 enableANS Audio effect functions 39 enableAudioStreamCallback RTP packets Audio stream and video stream callback 30 enableCallbackSendingSignaling Additional setting functions 14 enableCallForward Additional setting functions 15 enableCheckMwi Additional setting functions 16 enableCNG Audio effect functions 38 enableReliableProvisional Additional setting functions 14 enableSendPcmStreamToRemote Send audio and video stream functions 28 enableSendVideoStreamToRemote Send audio and video stream functions 29 enableSessionTimer Additional setting functions 16 enableVAD Audio effect functions 38 enableVideoStreamCallback RTP packets Audio stream and video stream callback 30 ENUM_AGC_NONE com portsip PortSipEnumDefine 64 ENUM AUDIOSTREAM LOCAL MIX com portsip PortSipEnumDefine 64 ENUM AUDIOSTREAM LOCAL PER CHA NNEL com portsip PortSipEnumDefine 64 ENUM AUDIOSTREAM R
70. onference int com portsip PortSipSdk setConferenceVideoWindow Object conferenceVideoWindow Set the window for a conference that using to display the received remote video image Parameters conferenceVideoW SurfaceView The window which using to display the conference video indow Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk joinToConference long 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 int com portsip PortSipSdk removeFromConference long sessionld Remove a session from an exist conference Parameters sessionld Session ID of the call Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code RTP and RTCP QOS functions Functions intcom portsip PortSipSdk setAudioRtcpBandwidth long sessionId int BitsRR int BitsRS int KBitsAS int com portsip PortSipSdk setVideoRtcpB andwidth long sessionId int BitsRR int BitsRS int KBitsAS int com portsip PortSipSdk setAudioQos boolean enable int DSCPValue int priority int com portsip PortSipSdk setVideoQos boolean
71. ote function with no loop mode this event will be triggered once the file play finished Parameters sessionld The session ID of the call RTP callback events Functions void com portsip OnPortSIPEvent onReceivedRTPPacket long sessionId boolean isAudio bytel RTPPacket int packetSize void com portsip OnPortSIPEvent onSendingRTPPacket long sessionId boolean isAudio bytel RTPPacket int packetSize void com portsip OnPortSIPEvent onAudioRawCallback long sessionld int enum audioCallbackMode byte data int dataLength int samplingFreqHz void com portsip OnPortSIPEvent onVideoRawCallback long sessionld int enum videoCallbackMode int width int height byte data int dataLength Detailed Description Function Documentation void com portsip OnPortSIPEvent onReceivedRTPPacket long sessionld boolean isAudio byte RTPPacket int 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 Remarks 58 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 t
72. portsip PortSipSdk 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 com portsip PortSipSdk isVideoCodecEmpty Detect enabled video codecs is empty or not Returns If no video codec was enabled the return value is true otherwise is false int com portsip PortSipSdk setAudioCodecPayloadType int enum audiocodec int payloadType Set the RTP payload type for dynamic audio codec Parameters enum audiocodec Audio codec type allow EN UM AUDIOCODEC G729 ENUM AUDIOCODEC PCMA ENUM AUDIOCODEC PCMU ENUM AUDIOCODEC GSM ENUM AUDIOCODEC G722 ENUM AUDIOCODEC ILBC ENUM AUDIOCODEC AMR ENUM AUDIOCODEC AMRWB ENUM AUDIOCODEC SPEEX ENUM AUDIOCODEC SPEEXWB ENUM AUDIOCODEC ISACWB ENUM AUDIOCODEC ISACSWB ENUM AUDIOCODEC OPUS ENUM AUDIOCODEC DTMFE 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 int com portsip PortSipSdk setVideoCodecPayloadType int enum videocodec int payloadType Set the RTP payload type for dynamic Video codec Parameters enum videocodec Video codec type allow ENUM VIDEOCODEC H263 ENUM VIDEOCODEC H263 1998 ENUM VIDEOCODEC H264 ENUM VIDEOCODEC VPS 12 payloa
73. r Initialize and register functions Initialize and register 9 rejectCall Call functions 23 rejectRefer Refer functions 27 removeFromConference Conference functions 34 RTP and RTCP QOS functions 34 setAudioQos 35 setAudioRtcpBandwidth 35 setVideoQos 36 setVideoRtcpBandwidth 35 RTP callback events 57 onAudioRawCallback 58 onReceivedRTPPacket 57 onSendingRTPPacket 58 onVideoRawCallback 58 RTP packets Audio stream and video stream callback 29 enableAudioStreamCallback 30 enableVideoStreamCallback 30 setRtpCallback 30 RTP statistics functions 36 getAudioRtcpStatistics 37 getAudioRtpStatistics 37 getNetworkStatistics 36 getVideoRtpStatistics 37 SDK Callback events 45 SDK functions SDK functions 7 Send audio and video stream functions 28 enableSendPcmStreamToRemote 28 enableSendVideoStreamToRemote 29 sendPcmStreamToRemote 28 sendVideoStreamToRemote 29 Send OPTIONS INFO MESSAGE functions 39 presenceAcceptSubscribe 41 presenceOffline 42 presenceOnline 42 presenceRejectSubscribe 41 presenceSubscribeContact 41 sendInfo 40 sendMessage 40 sendOptions 40 sendOutOfDialogMessage 41 sendDtmf Call functions 25 sendInfo Send OPTIONS INFO MESS AGE functions 40 sendMessage Send OPTIONS INFO MESS AGE functions 40 sendOptions Send OPTIONS INFO MESS AGE functions 40 sendOutOfDialogMessage Send OPTIONS INFO MESS AGE functions 41 sendPcmStreamToRemote Send audio and video stream func
74. rer s aui EO EA ME tensed OE EE 71 Index RE RE LO ER ER AT EE EEN OR OE ER 72 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 Static libraries sources headers datasheet and everything else a SDK user might need SDK User Man
75. return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk setAudioSamples int ptime int maxptime Set the audio capture sample which will be appears in the SDP of INVITE and 200 OK message as ptime and maxptime attribute 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 int com portsip PortSipSdk addSupportedMimeType String methodName String mimeType String subMimeType Set the SDK receive the SIP message that include special mime type Parameters methodName Method name of the SIP message likes INVITE OPTION INFO MESSAGE UPDATE ACK etc More details please read the RFC3261 mimeType The mime type of SIP message subMimeType The sub mime type of SIP message Returns If the function succeeds the return value is 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 messages message sipfrag in NOTIFY message application simple message summary in NOTIFY message text plain in MESSAGE message application dtmf rela
76. return value is a specific error code int com portsip PortSipSdk sendPcmStreamToRemote long sessionld bytel data int 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 enableSendPcmStreamToRemote sessionId true 16000 29 sendPcmStreamToRemote sessionId data dataSize int com portsip PortSipSdk enableSendVideoStreamToRemote long sessionld boolean state Enable the SDK send video stream data to remote side from another source to instread of camera MUST called this function first if want to send the video stream data to another side 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 int com portsip PortSipSdk sendVideoStreamToRemote long sessionld byte data int dataLength int width int height Send the video stream in 1420 from another source to instead of video device capture camera lt gt Before called this funtion
77. rismp PortSipSdk csse eterna terere GE SG ERG ES ER GES SE Rg deed SR Nege i 67 Coil POrisip Renderer PEE 71 Module Documentation SDK functions SDK functions Modules Initialize and register functions Initialize and register 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 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 Device Manage functions Detailed Description Initialize and register functions Initialize and register Functions void com portsip PortSipSdk CreateCallManager Context context void com portsip PortSipSdk DeleteCallManager int com portsip PortSipSdk initialize int enum transport int enum LogLevel String LogPath int maxLines String agent int audioDeviceLayer int videoDeviceLayer int com portsip PortSipSdk setUser String userName String displayName String authName String password String localIP int localSIPPort String userDomain String SIPServer int SIPServerPort String STUNServer int STUNServerPort String outboundServer int outboundServerPort int com portsip PortSip
78. romDisplayName The display name of message sender from The message sender toDisplayName The display name of message receiver to The message receiver void com portsip OnPortSIPEvent onSendOutOfDialogMessageFailure long messageld String fromDisplayName String from String toDisplayName String to String reason int code If the message was sent failure out of dialog this event will be triggered Parameters messageld The message ID it s equals the return value of SendOutOfDialogMessage function fromDisplayName The display name of message 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 void com portsip OnPortSIPEvent onPlayAudioFileFinished long sessionld String fileName void com portsip OnPortSIPEvent onPlayVideoFileFinished long sessionId Detailed Description 57 Function Documentation void com portsip OnPortSIPEvent onPlayAudioFileFinished long 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 void com portsip OnPortSIPEvent onPlayVideoFileFinished long sessionld If called playVideoFileToRem
79. rtsip OnPortSIPEvent onRegisterSuccess String reason int code When successfully register to server this event will be triggered Parameters reason The status text code The status code void com portsip OnPortSIPEvent onRegisterFailure String reason int code If register to SIP server is fail this event will be triggered Parameters reason The status text code The status code Call events Functions void com portsip OnPortSIPEvent onInviteIncoming long sessionld String callerDisplayName String caller String calleeDisplayName String callee String audioCodecs String videoCodecs boolean existsAudio boolean existsVideo void com portsip OnPortSIPEvent onInviteTrying long sessionId void com portsip OnPortSIPEvent onInviteSessionProgress long sessionId String audioCodecs String videoCodecs boolean existsEarlyMedia boolean existsAudio boolean existsVideo void com portsip OnPortSIPEvent onInviteRinging long sessionld String statusText int statusCode void com portsip OnPortSIPEvent onInvite Answered long sessionld String callerDisplayName String caller String calleeDisplayName String callee String audioCodecs String videoCodecs boolean existsAudio boolean existsVideo void com portsip OnPortSIPEvent onInviteFailure long sessionId String reason int code void com portsip OnPortSIPEvent onInviteUpdated long sessionld String audioCodecs String videoCodecs boolean exis
80. rtsip PortSipSdk detectMwi int com portsip PortSipSdk enableCheckMwi boolean state int com portsip PortSipSdk setRtpKeepAlive boolean state int keepAlivePayloadType int deltaTransmitTimeMS int com portsip PortSipSdk setKeepAliveTime int keepAliveTime int com portsip PortSipSdk setAudioSamples int ptime int maxptime int com portsip PortSipSdk addSupportedMimeType String methodName String mimeType String subMimeType Detailed Description Function Documentation int com portsip PortSipSdk setDisplayName String displayName Set user display name Parameters displayName The display name 14 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code String com portsip PortSipSdk getVersion Get the current version number of the SDK Returns String a version description string int com portsip PortSipSdk enableReliableProvisional boolean enable Enable disable PRACK Parameters 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 int com portsip PortSipSdk enable3GppTags boolean enable Enable disable the 3Gpp tags include ims icsi mmtel and g 3gpp smsip Parameters enable Set to true to enable
81. senceRejectSubscribe long subscribeld int com portsip PortSipSdk presenceAcceptSubscribe long subscribeld int com portsip PortSipSdk presenceOnline long subscribeld String statusText int com portsip PortSipSdk presenceOffline long subscribeld 40 Detailed Description Function Documentation int com portsip PortSipSdk 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 Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk sendInfo long sessionid 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 long com portsip PortSipSdk sendMessage long sessionld String mimeType String subMimeType byte message int messageLength Send a MESSAGE message to remote side in dialog Parameters sessionId The session ID of call mimeTyp
82. session ID of the call mutelncomingAudi 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 Set it to true to mute incoming video stredam can t see remote side video 0 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 int com portsip PortSipSdk forwardCall long sessionld String forwardTo Forward call to another one when received the incoming call Parameters sessionld The session ID of the call forwardTo Target of the forward it can be sip number Gsipserver com or number only Returns If the function succeeds the return value is O If the function fails the return value is a specific error code int com portsip PortSipSdk sendDtmf long sessionld int enum dtmfMethod int code int dtmfDuration boolean playDtmfTone Send DTMF tone Parameters sessionld The session ID of the call enum dtmfMethod Support send DTMF tone with two methods DTMF RFC2833 and DTMF INFO The DTMF RFC2833 is recommend 26 code The DTMF tone the values is listed below code Description 0 The DTMF
83. sip PortSipSdk playAudioFileToRemoteAsBackground long sessionld String filename Functions e boolean playAudio e e fileSamplesPerSec boolean loop e e int fileSamplesPerSec e int com portsip PortSipSdk stopPlay AudioFileToRemoteAsBackground long sessionId Detailed Description 32 Function Documentation int com portsip PortSipSdk playVideoFileToRemote long sessionld String aviFile boolean oop boolean playAudio Play an AVI file to remote party Parameters sessionld Session ID of the call aviFile The file full path name such as mnt sdcard 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 int com portsip PortSipSdk stopPlayVideoFileToRemote long 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 int com portsip PortSipSdk playAudioFileToRemote long sessionld String filename int fileSamplesPerSec boolean loop Play an wave file to remote party Parameters sessionld Session ID of the call filenam
84. state int com portsip PortSipSdk setVideoNackStatus boolean state void com portsip PortSipSdk muteMicrophone boolean mute void com portsip PortSipSdk muteSpeaker boolean mute int com portsip PortSipSdk getDynamicSpeakerVolumeLevel int com portsip PortSipSdk getDynamicMicrophoneV olumeLevel int com portsip PortSipSdk setLoudspeakerStatus boolean useSpeaker Detailed Description Function Documentation int com portsip PortSipSdk setVideoDeviceld int deviceld Set the video device that will use for video call Parameters deviceld Device ID index for video device camera Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk setVideoResolution int enum resulution Set the video capture resolution Parameters enum resulution Video resolution allow ENUM RESULUTION NONE ENUM RESULUTION QCIF ENUM RESULUTION CIF ENUM RESULUTION VGA ENUM RESULUTION SVGA ENUM RESULUTION XVGA ENUM RESULUTION 720P ENUM RESULUTION QVGA Note Some cameras 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 int com portsip PortSipSdk setVideoBitrate int bitrateKbps Set the video bit rate Parameters bitrateKbps The v
85. stemOutputMute Device Manage functions 44 getVersion Additional setting functions 14 getVideoCaptureDeviceName Device Manage functions 45 getVideoRtpStatistics RTP statistics functions 37 hangUp Call functions 24 hold Call functions 24 INFO OPTIONS message events 53 onRecvInfo 53 onRecvOptions 53 initialize Initialize and register functions Initialize and register 8 Initialize and register functions Initialize and register 7 CreateCallManager 8 DeleteCallManager 8 initialize 8 registerServer 9 setLicenseKey 10 setUser 9 unRegisterServer 9 isAudioCodecEmpty Audio and video codecs functions 11 isVideoCodecEmpty Audio and video codecs functions 11 joinToConference Conference functions 34 modifyHeaderValue Access SIP message header functions 19 muteMicrophone Audio and video functions 22 muteSession Call functions 25 muteSpeaker Audio and video functions 22 MWI events 51 onWaitingFaxMessage 52 onWaitingVoiceMessage 52 onACTV TransferFailure Refer events 50 onACTV TransferSuccess Refer events 50 onAudioRawCallback RTP callback events 58 onInvite Answered Call events 47 onInviteBeginingForward Call events 48 onInviteClosed Call events 48 onInviteConnected Call events 48 onInviteFailure Call events 48 onInviteIncoming 74 Call events 47 onInviteRinging Call events 47 onInviteSessionProgress Call events 47 onInviteTrying Cal
86. t com portsip PortSipSdk setRtcpPortRange int minimumHtcpAudioPort int maximumRicpAudioPort int minimumRtcp VideoPort int maximumHtcpVideoPort This function allows set the RTCP ports range for audio and video streaming Parameters minimumRtcpAudi The minimum RTCP port for audio stream oPort maximumRtcpAudi The maximum RTCP port for audio stream oPort minimumRtcpVide The minimum RTCP port for video stream oPort maximumRtcpVide The maximum RTCP port for video stream oPort Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code Remarks The port range max min maxCallLines should more than 4 int com portsip PortSipSdk 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 int com portsip PortSipSdk 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 funct
87. teCall etc can called only after the call connected otherwise the functions will return error Parameters sessionld The session ID of the call void com portsip OnPortSIPEvent onInviteBeginingForward String forward To If the enableCallForward method is called and a call is incoming the call will be forwarded automatically and trigger this event Parameters forwardTo The forward target SIP URI void com portsip OnPortSIPEvent onInviteClosed long sessionld This event is triggered once remote side close the call Parameters sessionld The session ID of the call 49 void com portsip OnPortSIPEvent onRemoteHold long sessionld If the remote side has placed the call on hold this event triggered Parameters sessionld The session ID of the call void com portsip OnPortSIPEvent onRemoteUnHold long sessionld String audioCodecs String videoCodecs boolean existsAudio boolean exists Video If the remote side was un hold the call this event triggered Parameters sessionld The session ID of the call audioCodecs The matched audio codecs it s separated by if have more than one codec videoCodecs The matched video codecs it s separated by if have more than one codec 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
88. 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 userl sip portsip com application vnd 3gpp sms binData binDataSize long com portsip PortSipSdk 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 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 int com portsip PortSipSdk presenceRejectSubscribe long subscribeld Reject a presence SUBSCRIBE request which received from contact Parameters subscribeld Subscribe id when received a SUBSCRIBE request from contact the event onPresenceRecvSubscribe will be triggered the event inclues the subscribe id Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk presenceAcceptSubscribe long subscribeld Accept the presence SUB
89. the SDK support 3Gpp tags Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code void com portsip PortSipSdk enableCallbackSendingSignaling boolean enable Enable disable callback the sending SIP messages Parameters 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 void com portsip PortSipSdk setSrtpPolicy int enum_srtppolicy Set the SRTP policy Parameters enum_srtppolicy The SRTP policy allow ENUM_SRTPPOLICY_NONE ENUM_SRTPPOLICY_FORCE ENUM_SRTPPOLICY_PREFER int com portsip PortSipSdk setRtpPortRange int minimumHtpAudioPort int maximumRipAudioPort int minimumRtip VideoPort int maximumRtp VideoPort This function allows 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 15 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 in
90. tic final int ENUM NS NONE 0 type of Noise Suppression static final int ENUM NS DEFAULT 1 static final int ENUM NS Conference 2 static final int ENUM NS LOW SUPPRESSION 3 static final int ENUM NS MODERATE SUPPRESSION 4 static final int ENUM NS HIGH SUPPRESSION 5 static final int ENUM NS VERY HIGH SUPPRESSION 6 static final int ENU static final int ENU static final int ENU static final int ENU static final int ENU static final int ENU SS SEIS lt Member Data Documentation final int com portsip PortSipEnumDefine ENUM_VIDEOCODEC_NONE 1 static used only in startRecord final int com portsip PortSipEnumDefine ENUM VIDEOCODEC 1420 133 static used only in startRecord 64 final int com portsip PortSipEnumDefine ENUM AUDIOSTREAM LOCAL MIX 1 static Callback the audio stream from microphone for all channels final int com portsip PortSipEnumDefine ENUM_AUDIOSTREAM_LOCAL_PER_CHANNEL 2 static Callback the audio stream from microphone for one channel base on the session ID final int com portsip PortSipEnumDefine ENUM_AUDIOSTREAM_REMOTE_MIX 3 static Callback the received audio stream that mixed including all channels final int com portsip PortSipEnumDefine ENUM_AUDIOSTREAM_REMOTE_PER_CHANNEL 4 static Callback the received audio stream for one channel base on the session ID final int com portsip PortSipEnumDefine ENUM_VID
91. tions 28 send Video Audio and video functions 21 send VideoStreamToRemote Send audio and video stream functions 29 setAudioCodecParameter Audio and video codecs functions 12 setAudioCodecPayloadType Audio and video codecs functions 11 setAudioQos RTP and RTCP QOS functions 35 setAudioRtcpB andwidth RTP and RTCP QOS functions 35 setAudioSamples Additional setting functions 17 setConference VideoWindow Conference functions 34 setDisplayName Additional setting functions 13 setDoNotDisturb Additional setting functions 16 setKeepAliveTime Additional setting functions 17 setLicenseKey Initialize and register functions Initialize and register 10 setLocal Video Window Audio and video functions 21 76 setLoudspeakerStatus Audio and video functions 22 setMic Volume Device Manage functions 44 setRemote Video Window Audio and video functions 21 setRtcpPortRange Additional setting functions 15 setRtpCallback RTP packets Audio stream and video stream callback 30 setRtpKeepAlive Additional setting functions 16 setRtpPortRange Additional setting functions 14 setSpeakerVolume Device Manage functions 43 setSrtpPolicy Additional setting functions 14 setSystemInputMute Device Manage functions 44 setSystemOutputMute Device Manage functions 44 setUser Initialize and register functions Initialize and register 9 set VideoBitrate Audio and video functions 20 setVideoCodecParameter Audio and
92. tisics of audio channel Parameters sessionId The session ID of call conversation Statistics Return audio rtcp statistic statistics 0 The number of sent bytes statistics 1 The number of sent packets statistics 2 The number of received bytes statistics 3 The number of received packets statistics 4 Fraction of sent lost in percent statistics 5 The number of sent cumulative lost packet statistics 6 Fraction of received lost in percent statistics 7 The number of received cumulative lost packets Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk getVideoRtpStatistics long sessionld int statistics Obtain the RTCP statisics of audio channel Parameters sessionld The session ID of call conversation statistics Return Video rtcp statistic statistics 0 The number of sent bytes statistics 1 The number of sent packets statistics 2 The number of received bytes statistics 3 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 com portsip PortSipSdk enableV AD boolean state 38 void com portsip PortSipSdk enableAEC int enum aecMode void com portsip PortSipSdk enableCNG boolean state void com portsip PortSipSdk
93. tring caller String calleeDisplayName String callee String audioCodecs String videoCodecs boolean existsAudio boolean existsVideo void onInviteTrying long sessionId void onInviteSessionProgress long sessionld String audioCodecs String videoCodecs boolean existsEarlyMedia boolean existsAudio boolean existsVideo void onInviteRinging long sessionld String statusText int statusCode void onInviteAnswered long sessionld String callerDisplayName String caller String calleeDisplayName String callee String audioCodecs String videoCodecs boolean existsAudio boolean existsVideo void onInviteFailure long sessionld String reason int code void onInviteUpdated long sessionld String audioCodecs String videoCodecs boolean existsAudio boolean existsVideo void onInviteConnected long sessionId void onInviteBeginingForward String forwardTo void onInviteClosed long sessionId void onRemoteHold long sessionId void onRemoteUnHold long sessionld String audioCodecs String videoCodecs boolean existsAudio boolean existsVideo void onReceivedRefer long sessionld long referld String to String from String referSipMessage void onReferAccepted long sessionId void onReferRejected long sessionld String reason int code void onTransferTrying long sessionId void onTransferRinging long sessionId void onACTV TransferSuccess long sessionId void onACTV TransferFailure long sessionId String reason int cod
94. tsAudio boolean exists Video void com portsip OnPortSIPEvent onInviteConnected long sessionId void com portsip OnPortSIPEvent onInviteBeginingForward String forwardTo void com portsip OnPortSIPEvent onInviteClosed long sessionId void com portsip OnPortSIPEvent onRemoteHold long sessionId void com portsip OnPortSIPEvent onRemoteUnHold long sessionId String audioCodecs String videoCodecs boolean existsAudio boolean existsVideo Detailed Description 47 Function Documentation void com portsip OnPortSIPEvent onInvitelncoming long sessionld String callerDisplayName String caller String calleeDisplayName String callee String audioCodecs String videoCodecs boolean existsAudio boolean existsVideo When the call is coming this event was triggered Parameters sessionld 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 audio Codecs The matched audio codecs it s separated by if have more than one codec videoCodecs The matched video codecs it s separated by if have more than one codec existsAudio If it s true means this call include the audio existsVideo If it s true means this call include the video void com portsip OnPortSIPEvent onInviteTrying long sessionld If the outgoing call was processing this event trigg
95. ual The starting point for the documentation of PortSIP VoIP SDK is the SDK User Manual page which gives a brief description of each API functions Web Site Some general interest or often changing PortSIP SDK information lives only on the PortSIP web site The release contains links to the site so while browsing it you ll see occasional broken links if you aren t connected to the Internet But everything needed to use the PortSIP 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 Support Please send email to Our support if you need any helps Machine Requirements Development using the PortSIP VoIP IMS SDK for Android requires minimum sdk version API 9 Frequently Asked Questions 1 Where can download the PortSIP VoIP SDK for test All sample projects of the PortSIP VoIP SDK can be download to test at http www PortSIP com downloads html http www PortSIP com voipsdk html 2 How to compile the sample project Download the sample projects from PortSIP website Extract the zip file Open the project by your xcode 4 Compile the sample project directly the trial version SDK allows 2 3 minutes conversation w SY Ie 3 Create a new project base on PortSIP VoIP SDK 1 Download the Sample project and evaluation SDK and extract it to a directory 2 Run the eclipse and create a new An
96. udio stream and video stream callback eee 30 Record functions ARE 31 Play audio and video file to remoe functions ese ee eee 32 Conference functions paste eet eure tide Dee eee aes 34 RTP and RTCP OOS f nctions eei eee ice deci ect ciet nee ee EK Es 35 RTP statistics functions eed tee ie Ge ER e prie iride Pee Se e ee e See TR Pines 37 Audio effect functions ie te ete ene Eee gei eye ed Sees na deceat pee hs 38 Send OPTIONS INFO MESS AGE functions esse ee ee se se esse ee ee se es se ee enne nennen enne enne ene 40 Device Manage t nctions o dre Pe Rte eei A tiu te er rep Ee ee 43 SDK Callback events n mie e tee ede e e Eee e chad bs av redde des 46 Re pister eventez SE oen ete ee fi OE en eee BN e nei edlen 46 Call RE c 47 Refer events octo be see Aten ee ied nls hee teen isto aue iicet iet 50 Signaling events sci eases CUAL Ie eO eq ADM et 52 MW events 0 EE RE Rn GU RD EE tees 52 DTME events auum de EE B dq mI 53 Ne AO KEES ER EE EE bns 54 Preserce everits anc ED EE Re Ee Ee ORA ene IIa ni 55 Play audio and video file finished event 0 0 0 sese eee 57 RTP callback events ons REI sti RR Rn ei EE GR Ge es ae be es 58 Class Index Class List Here are the classes structs unions and interfaces with brief descriptions com portsip OnPortSIPEVvent eee 61 com portsip PortSipEnumDefine ss sese sese 63 comipo
97. word of user it s optional locallP 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 If you want the SDK choose correct network interface IP automatically please pass the 0 0 0 0 for IPv4 or for IPv6 localSIPPort The SIP message transport listener port for example 5060 userDomain User domain this parameter is optional that allow pass a empty string if you are not use domain SIPServer SIP proxy server IP or domain for example XX XXX XX X or sip xxx com SIPServerPort Port of the SIP proxy server for example 5060 STUNServer Stun server use for NAT traversal it s optional and can be pass empty string to disable STUN STUNServerPort STUN server port it will be ignored if the outboundServer is empty outboundServer Outbound proxy server for example sip domain com it s optional that allow pass a empty string if not use outbound server outboundServerPo Outbound proxy server port it will be ignored if the outboundServer is empty rt Returns If the function succeeds the return value is 0 If the function fails the return value is a specific error code int com portsip PortSipSdk registerServer int expires int retryTimes Register to SIP proxy server login to server Parameters expires Registration refresh Interval in seconds maximum is 360
98. y in INFO message application media controltxml 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 18 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 String com portsip PortSipSdk getExtensionHeaderValue String sipMessage String headerName int com portsip PortSipSdk addExtensionHeader String headerName String headerValue int com portsip PortSipSdk clearAddExtensionHeaders int com portsip PortSipSdk modifyHeaderValue String headerName String headerValue int com portsip PortSipSdk clearModifyHeaders Detailed Description Function Documentation String com portsip PortSipSdk getExtensionHeaderValue String sipMessage String headerName Access the SIP header of SIP message Parameters
Download Pdf Manuals
Related Search
Related Contents
Sunbeam WF7400 User's Manual Manual de instrucciones, garantía y S.T.A. LAVAVAJILLAS 10 - QuickMedical And click here to view our classic M2 unit! Pavestone Rumblestone RSK52934 Instructions / Assembly MANUEL DE L`OPÉRATEUR Catalogo DAIKIN idronici 2015 manual técnico Decision Trees Using TreePlan Copyright © All rights reserved.
Failed to retrieve file