|
@@ -67,12 +67,6 @@ static void __on_video_box_move(int imessagetype, int ivideotype, int ileft, int
|
|
|
}
|
|
|
|
|
|
|
|
|
-CSIPPhoneSession::CSIPPhoneSession(CSIPEntity *pEntity) : m_pEntity(pEntity), m_pCall(NULL), m_iLastState(0)
|
|
|
-{
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
static void __on_call_state(int state, const char *state_desc, const char *phrase, void *user_data)
|
|
|
{
|
|
|
CSIPPhoneSession *pThis = static_cast<CSIPPhoneSession*>(user_data);
|
|
@@ -160,6 +154,61 @@ static int __on_window_type_callback(void* user_data)
|
|
|
return pThis->m_stVideoParam.bShowPersonArea;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+static CSimpleStringA generateAudioInfoJson(const char* handfreeIn, const char* handfreeOut, const char* pickupIn, const char* pickupOut)
|
|
|
+{
|
|
|
+ return CSimpleStringA::Format("{\"handfree_in_dev\":\"%s\",\"handfree_out_dev\":\"%s\",\"pickup_in_dev\":\"%s\",\"pickup_out_dev\":\"%s\"}",
|
|
|
+ handfreeIn, handfreeOut, pickupIn, pickupOut);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+static CSimpleStringA generateVolumeJson(int ihandfreeIn, int ihandfreeOut, int ipickupIn, int ipickupOut)
|
|
|
+{
|
|
|
+ return CSimpleStringA::Format("{\"handfree_in_volume\":\"%d\",\"handfree_out_volume\":\"%d\",\"pickup_in_volume\":\"%d\",\"pickup_out_volume\":\"%d\"}",
|
|
|
+ ihandfreeIn, ihandfreeOut, ipickupIn, ipickupOut);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+static CSimpleStringA generateAudioDspFlags(endpoint_audiodsp_config_t conf)
|
|
|
+{
|
|
|
+ int ipickup_in_agc = 0;
|
|
|
+ int ipickup_out_agc = 0;
|
|
|
+ int ihandfree_in_agc = 0;
|
|
|
+ int ihandfree_out_agc = 0;
|
|
|
+
|
|
|
+ int ipickup_in_ns = 0;
|
|
|
+ int ipickup_out_ns = 0;
|
|
|
+ int ihandfree_in_ns = 0;
|
|
|
+ int ihandfree_out_ns = 0;
|
|
|
+
|
|
|
+ int ipickup_aec = 0;
|
|
|
+ int ihandfree_aec = 0;
|
|
|
+
|
|
|
+ conf.audio_pickup_in_agc ? ipickup_in_agc = 1 : ipickup_in_agc = 0;
|
|
|
+ conf.audio_pickup_out_agc ? ipickup_out_agc = 1 : ipickup_out_agc = 0;
|
|
|
+ conf.audio_handfree_in_agc ? ihandfree_in_agc = 1 : ihandfree_in_agc = 0;
|
|
|
+ conf.audio_handfree_out_agc ? ihandfree_out_agc = 1 : ihandfree_out_agc = 0;
|
|
|
+ conf.audio_pickup_in_ns ? ipickup_in_ns = 1 : ipickup_in_ns = 0;
|
|
|
+ conf.audio_pickup_out_ns ? ipickup_out_ns = 1 : ipickup_out_ns = 0;
|
|
|
+ conf.audio_handfree_in_ns ? ihandfree_in_ns = 1 : ihandfree_in_ns = 0;
|
|
|
+ conf.audio_handfree_out_ns ? ihandfree_out_ns = 1 : ihandfree_out_ns = 0;
|
|
|
+ conf.audio_pickup_aec ? ipickup_aec = 1 : ipickup_aec = 0;
|
|
|
+ conf.audio_handfree_aec ? ihandfree_aec = 1 : ihandfree_aec = 0;
|
|
|
+
|
|
|
+ return CSimpleStringA::Format("{\"handfree_in_agc\":\"%d\",\"handfree_out_agc\":\"%d\",\"pickup_in_agc\":\"%d\",\"pickup_out_agc\":\"%d\",\"handfree_in_ns\":\"%d\",\"handfree_out_ns\":\"%d\",\"pickup_in_ns\":\"%d\",\"pickup_out_ns\":\"%d\",\"handfree_aec\":\"%d\",\"pickup_aec\":\"%d\"}",
|
|
|
+ ihandfree_in_agc, ihandfree_out_agc, ipickup_in_agc, ipickup_out_agc,
|
|
|
+ ihandfree_in_ns, ihandfree_out_ns, ipickup_in_ns, ipickup_out_ns,
|
|
|
+ ihandfree_aec, ipickup_aec);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+CSIPPhoneSession::CSIPPhoneSession(CSIPEntity* pEntity) : m_pEntity(pEntity), m_pCall(NULL), m_iLastState(0)
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
CSIPEntity::CSIPEntity() : m_pCurrentSession(NULL), m_state(INIT),m_iPickupPhoneState(ePickupMicrophoneState_Off)
|
|
|
{
|
|
|
m_kept_volume_in[0] = m_kept_volume_in[1] = 0;
|
|
@@ -715,12 +764,15 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
}
|
|
|
|
|
|
Error = LoadConfig(&conf);
|
|
|
- if (Error != Error_Succeed)
|
|
|
- {
|
|
|
+ if (Error != Error_Succeed) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("load config failed!");
|
|
|
return Error;
|
|
|
}
|
|
|
|
|
|
+ if (IsPostAudioConfigInfo()) {
|
|
|
+ LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_AUDIO_DEVICE_INFO, generateAudioInfoJson(conf.audio_handfree_in_dev, conf.audio_handfree_out_dev, conf.audio_pickup_in_dev, conf.audio_pickup_out_dev).GetData());
|
|
|
+ }
|
|
|
+
|
|
|
int nhandfreeout = 0;
|
|
|
int npickupout = 0;
|
|
|
int nhanfreein = 0;
|
|
@@ -1320,6 +1372,23 @@ ErrorCodeEnum CSIPEntity::AudioDspFlagsUseCentersetting(endpoint_conf_t* conf)
|
|
|
return Error;
|
|
|
}
|
|
|
|
|
|
+bool CSIPEntity::IsPostAudioConfigInfo()
|
|
|
+{
|
|
|
+ bool bRet = false;
|
|
|
+ if (eStand2sType == m_eDeviceType || eStand1SPlusType == m_eDeviceType) {
|
|
|
+ if (strlen(conf.audio_handfree_in_dev) && strlen(conf.audio_handfree_out_dev) && strlen(conf.audio_pickup_in_dev) && strlen(conf.audio_pickup_out_dev)) {
|
|
|
+ bRet = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (strlen(conf.audio_handfree_in_dev) && strlen(conf.audio_handfree_out_dev)) {
|
|
|
+ bRet = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return bRet;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
ErrorCodeEnum CSIPEntity::GetLocalIP()
|
|
|
{
|
|
@@ -1934,50 +2003,6 @@ void CSIPEntity::InitFreshTimeConfig()
|
|
|
m_iremotevideo_freshtime = irightvideo;
|
|
|
}
|
|
|
|
|
|
-static CSimpleStringA generateAudioInfoJson(const char* handfreeIn, const char* handfreeOut, const char* pickupIn, const char* pickupOut)
|
|
|
-{
|
|
|
- return CSimpleStringA::Format("{\"handfree_in_dev\":\"%s\",\"handfree_out_dev\":\"%s\",\"pickup_in_dev\":\"%s\",\"pickup_out_dev\":\"%s\"}",
|
|
|
- handfreeIn, handfreeOut, pickupIn, pickupOut);
|
|
|
-}
|
|
|
-
|
|
|
-static CSimpleStringA generateVolumeJson(int ihandfreeIn, int ihandfreeOut, int ipickupIn, int ipickupOut)
|
|
|
-{
|
|
|
- return CSimpleStringA::Format("{\"handfree_in_volume\":\"%d\",\"handfree_out_volume\":\"%d\",\"pickup_in_volume\":\"%d\",\"pickup_out_volume\":\"%d\"}",
|
|
|
- ihandfreeIn, ihandfreeOut, ipickupIn, ipickupOut);
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-static CSimpleStringA generateAudioDspFlags(endpoint_audiodsp_config_t conf)
|
|
|
-{
|
|
|
- int ipickup_in_agc = 0;
|
|
|
- int ipickup_out_agc = 0;
|
|
|
- int ihandfree_in_agc = 0;
|
|
|
- int ihandfree_out_agc = 0;
|
|
|
-
|
|
|
- int ipickup_in_ns = 0;
|
|
|
- int ipickup_out_ns = 0;
|
|
|
- int ihandfree_in_ns = 0;
|
|
|
- int ihandfree_out_ns = 0;
|
|
|
-
|
|
|
- int ipickup_aec = 0;
|
|
|
- int ihandfree_aec = 0;
|
|
|
-
|
|
|
- conf.audio_pickup_in_agc ? ipickup_in_agc = 1 : ipickup_in_agc = 0;
|
|
|
- conf.audio_pickup_out_agc ? ipickup_out_agc = 1 : ipickup_out_agc = 0;
|
|
|
- conf.audio_handfree_in_agc ? ihandfree_in_agc = 1 : ihandfree_in_agc = 0;
|
|
|
- conf.audio_handfree_out_agc ? ihandfree_out_agc = 1 : ihandfree_out_agc = 0;
|
|
|
- conf.audio_pickup_in_ns ? ipickup_in_ns = 1 : ipickup_in_ns = 0;
|
|
|
- conf.audio_pickup_out_ns ? ipickup_out_ns = 1 : ipickup_out_ns = 0;
|
|
|
- conf.audio_handfree_in_ns ? ihandfree_in_ns = 1 : ihandfree_in_ns = 0;
|
|
|
- conf.audio_handfree_out_ns ? ihandfree_out_ns = 1 : ihandfree_out_ns = 0;
|
|
|
- conf.audio_pickup_aec ? ipickup_aec = 1 : ipickup_aec = 0;
|
|
|
- conf.audio_handfree_aec ? ihandfree_aec = 1 : ihandfree_aec = 0;
|
|
|
-
|
|
|
- return CSimpleStringA::Format("{\"handfree_in_agc\":\"%d\",\"handfree_out_agc\":\"%d\",\"pickup_in_agc\":\"%d\",\"pickup_out_agc\":\"%d\",\"handfree_in_ns\":\"%d\",\"handfree_out_ns\":\"%d\",\"pickup_in_ns\":\"%d\",\"pickup_out_ns\":\"%d\",\"handfree_aec\":\"%d\",\"pickup_aec\":\"%d\"}",
|
|
|
- ihandfree_in_agc, ihandfree_out_agc, ipickup_in_agc, ipickup_out_agc,
|
|
|
- ihandfree_in_ns, ihandfree_out_ns, ipickup_in_ns, ipickup_out_ns,
|
|
|
- ihandfree_aec, ipickup_aec);
|
|
|
-}
|
|
|
|
|
|
ErrorCodeEnum CSIPEntity::LoadConfig(endpoint_conf_t *conf)
|
|
|
{
|
|
@@ -2019,7 +2044,6 @@ ErrorCodeEnum CSIPEntity::LoadConfig(endpoint_conf_t *conf)
|
|
|
|
|
|
int id;
|
|
|
|
|
|
- LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_AUDIO_DEVICE_INFO, generateAudioInfoJson(conf->audio_handfree_in_dev, conf->audio_handfree_out_dev, conf->audio_pickup_in_dev, conf->audio_pickup_out_dev).GetData());
|
|
|
LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_AUDIO_VOLUME_INFO, generateVolumeJson(m_kept_volume_in[DEV_HANDFREE], m_kept_volume_out[DEV_HANDFREE], m_kept_volume_in[DEV_PICKUP], m_kept_volume_out[DEV_PICKUP]));
|
|
|
LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_AUDIO_DSP_INFO, generateAudioDspFlags(conf->audio_dsp).GetData());
|
|
|
|