简介
上篇简单分析imsdroid项目,本篇继续上一篇继续分析。
继续分析
IMS Private Identity (IMPI) 身份认证 用户的id 例如:banketree
IMS Public Identity (IMPU) 公共认证 如:sip:[email protected]
服务设置:
// Sets IP address
final String proxyHost = "192.168.0.1";
mConfigurationService(ConfigurationEntry.NETWORK_PCSCF_HOST, proxyHost);
// Sets port
final int proxyPort = 5060;
mConfigurationService.putInt(ConfigurationEntry.NETWORK_PCSCF_PORT, proxyPort);
Save changes
mConfigurationService.commit();
org.doubango.ngn.sip.NgnAVSession
boolean makeCall (String remoteUri)
boolean makeVideoSharingCall (String remoteUri)
Context getContext ()
void setContext (Context context)
final View startVideoConsumerPreview ()
final View startVideoProducerPreview ()
boolean isSendingVideo ()
void toggleCamera ()
void setRotation (int rot)
void setSpeakerphoneOn (boolean speakerOn)
void toggleSpeakerphone ()
void setState (InviteState state)
boolean acceptCall ()
boolean hangUpCall ()
boolean holdCall ()
boolean resumeCall ()
boolean isLocalHeld ()
boolean isRemoteHeld ()
boolean sendDTMF (int digit)
Static Public Member Functions
static NgnAVSession createOutgoingSession (NgnSipStack sipStack, NgnMediaType mediaType)
static NgnAVSession getSession (long id)
static int getSize ()
static boolean hasSession (long id)
static boolean hasActiveSession ()
static NgnAVSession getFirstActiveCallAndNot (long id)
static boolean makeAudioCall (String remoteUri, NgnSipStack sipStack)
static boolean makeAudioVideoCall (String remoteUri, NgnSipStack sipStack)
boolean org.doubango.ngn.sip.NgnAVSession.acceptCall () //接受一个传入的音频/视频呼叫
Returns:
true is succeed and false otherwise
See also:
hangUpCall()
static NgnAVSession org.doubango.ngn.sip.NgnAVSession.createOutgoingSession (NgnSipStack sipStack, NgnMediaType mediaType)
[static]
创建一个去电音频/视频会话
Parameters:
sipStack the IMS/SIP stack to use to make the call
mediaType the media type.
Returns:一个去电音频/视频会话
Context org.doubango.ngn.sip.NgnAVSession.getContext ()//获取此会话相关的上下文
Returns:上下文
static NgnAVSession org.doubango.ngn.sip.NgnAVSession.getFirstActiveCallAndNot (long id) [static]
根据指定ID获取不同于第一有源音频/视频会议
Parameters:会话id
Returns:一个会议
static NgnAVSession org.doubango.ngn.sip.NgnAVSession.getSession (long id) [static]
检索音频/视频会话的ID
Parameters:会议id
Returns:一个会议
static int org.doubango.ngn.sip.NgnAVSession.getSize () [static]
获取一些暂停的音频/视频会议
Returns:会议
boolean org.doubango.ngn.sip.NgnAVSession.hangUpCall ()
通话结束
Returns:
static boolean org.doubango.ngn.sip.NgnAVSession.hasActiveSession () [static]
一个活动的音频/视频会议
Returns:
static boolean org.doubango.ngn.sip.NgnAVSession.hasSession (long id) [static]
是否有会议
Parameters:会议id
Returns:
boolean org.doubango.ngn.sip.NgnAVSession.holdCall ()
检查是否有保持呼叫
Returns:
boolean org.doubango.ngn.sip.NgnAVSession.isLocalHeld ()
是否为内部电话
Returns:
boolean org.doubango.ngn.sip.NgnAVSession.isRemoteHeld ()
是否为远程电话
Returns:
boolean org.doubango.ngn.sip.NgnAVSession.isSendingVideo ()
是否发送视频
static boolean org.doubango.ngn.sip.NgnAVSession.makeAudioCall (String remoteUri, NgnSipStack sipStack) [static]
音频呼叫
Parameters:
remoteUri the remote party uri. Could be a SIP/TEL uri, nomadic number, MSISDN number, ... example:
sip:[email protected], tel:+33600000000, 78888667, ...
sipStack the SIP/IMS stack to use
static boolean org.doubango.ngn.sip.NgnAVSession.makeAudioVideoCall (String remoteUri, NgnSipStack sipStack) [static]
同上
boolean org.doubango.ngn.sip.NgnAVSession.makeCall (String remoteUri)
创建一个会话
Parameters:
remoteUri the remote party uri. Could be a SIP/TEL uri, nomadic number, MSISDN number, ... example:
sip:[email protected], tel:+33600000000, 78888667, ...
boolean org.doubango.ngn.sip.NgnAVSession.makeVideoSharingCall (String remoteUri)
开始视频分享
Parameters:
remoteUri the remote party uri. Could be a SIP/TEL uri, nomadic number, MSISDN number, ... example:
sip:[email protected], tel:+33600000000, 78888667, ...
boolean org.doubango.ngn.sip.NgnAVSession.resumeCall ()
恢复会议
boolean org.doubango.ngn.sip.NgnAVSession.sendDTMF (int digit)
发送dtmf数字信息
Parameters:数字
void org.doubango.ngn.sip.NgnAVSession.setContext (Context context)
设置句柄
void org.doubango.ngn.sip.NgnAVSession.setRotation (int rot)
设置本地视频的旋转角度
void org.doubango.ngn.sip.NgnAVSession.setSpeakerphoneOn (boolean speakerOn)
设置是否开启扬声器
void org.doubango.ngn.sip.NgnAVSession.setState (InviteState state)
设置会议状态
final View org.doubango.ngn.sip.NgnAVSession.startVideoConsumerPreview ()
启动视频
final View org.doubango.ngn.sip.NgnAVSession.startVideoProducerPreview ()
同上
void org.doubango.ngn.sip.NgnAVSession.toggleCamera ()
切换相机
void org.doubango.ngn.sip.NgnAVSession.toggleSpeakerphone ()
切换扬声器
synchronized boolean start ()
synchronized boolean stop ()
synchronized boolean isStarted ()
void setMainActivity (Activity mainActivity)
Activity getMainActivity ()
INgnConfigurationService getConfigurationService ()
INgnStorageService getStorageService ()
INgnNetworkService getNetworkService ()
INgnHttpClientService getHttpClientService ()
INgnContactService getContactService ()
INgnHistoryService getHistoryService ()
INgnSipService getSipService ()
INgnSoundService getSoundService ()
Class getNativeServiceClass ()
Static Public Member Functions
static NgnEngine getInstance ()
Protected Member Functions
NgnEngine ()
org.doubango.ngn.NgnEngine.NgnEngine () [protected]
默认构造
INgnConfigurationService org.doubango.ngn.NgnEngine.getConfigurationService ()
获取配置服务
INgnContactService org.doubango.ngn.NgnEngine.getContactService ()
获取联系人服务
INgnHistoryService org.doubango.ngn.NgnEngine.getHistoryService ()
获取记录服务
INgnHttpClientService org.doubango.ngn.NgnEngine.getHttpClientService ()
获取http交互服务
static NgnEngine org.doubango.ngn.NgnEngine.getInstance () [static]
获取ngn引擎实例
Activity org.doubango.ngn.NgnEngine.getMainActivity ()
获取主activity
Class extends NgnNativeService> org.doubango.ngn.NgnEngine.getNativeServiceClass ()
获取本地服务
INgnNetworkService org.doubango.ngn.NgnEngine.getNetworkService ()
获取网络服务
INgnSipService org.doubango.ngn.NgnEngine.getSipService ()
获取sip服务
INgnSoundService org.doubango.ngn.NgnEngine.getSoundService ()
获取声音服务
INgnStorageService org.doubango.ngn.NgnEngine.getStorageService ()
获取存贮服务
synchronized boolean org.doubango.ngn.NgnEngine.isStarted ()
是否开始
void org.doubango.ngn.NgnEngine.setMainActivity (Activity mainActivity)
synchronized boolean org.doubango.ngn.NgnEngine.start ()
开启引擎
synchronized boolean org.doubango.ngn.NgnEngine.stop ()
停止引擎
推荐文章:
http://www.cnblogs.com/DreamSea-for-Jimmy/archive/2011/07/28/2119877.html