Old revisions Add to book Export to PDF Book Creator Add this page to your book Book Creator Remove this page from your book Manage book (0 page(s)) Help This is an old revision of the document! Configuration API > BS2_SetVoipConfigExt BS2_SetVoipConfigExt [+ 2.8.3] Save the 'BioStation 3' extended VoIP settings. Compared to BS2VoipConfigvarious settings have been added, such as specifying outbound proxy or setting volume. 함수 #include "BS_API.h" int BS2_SetVoipConfigExt(void* context, uint32_t deviceId, const BS2VoipConfigExt* config); BS2VoipConfigExt 구조체 보기 파라미터 [In] context : Context [In] deviceId : 장치 식별자 [In] config : VoIP 설정 정보 포인터 반환값 성공적으로 수행될 경우 BS_SDK_SUCCESS를 반환하고, 에러가 발생할 경우 상응하는 에러 코드를 반환합니다. 샘플코드(C++) sample_setvoipconfigext.cpp BS2VoipConfigExt config = { 0, }; config.enabled = true; config.useOutboundProxy = false; config.registrationDuration = 300; string ipAddr = "192.168.0.9"; memcpy(config.address, ipAddr.c_str(), ipAddr.size()); config.port = 5060; config.volume.speaker = 50; config.volume.mic = 50; string sipID = "myAccount"; memcpy(config.id, sipID.c_str(), sipID.size()); string sipPW = "myPassword"; memcpy(config.password, sipPW.c_str(), sipPW.size()); string authCode = "1234"; memcpy(config.authorizationCode, authCode.c_str(), authCode.size()); config.exitButton = '0'; // keypad 0 config.showExtensionNumber = true; config.numPhoneBook = 2; string phoneNum = "600"; memcpy(config.phonebook[0].phoneNumber, phoneNum.c_str(), phoneNum.size()); string phoneDesc = "LB James"; memcpy(config.phonebook[0].description, phoneDesc.c_str(), phoneDesc.size()); phoneNum = "601"; memcpy(config.phonebook[1].phoneNumber, phoneNum.c_str(), phoneNum.size()); phoneDesc = "C Kershaw"; memcpy(config.phonebook[1].description, phoneDesc.c_str(), phoneDesc.size()); int sdkResult = BS2_SetVoipConfigExt(context, id, &config); if (BS_SDK_SUCCESS != sdkResult) printf("BS2_SetVoipConfigExt call failed: %d", sdkResult); 샘플코드(C#) sample_setvoipconfigext.cs BS2VoipConfigExt config = Util.AllocateStructure<BS2VoipConfigExt>(); config.enabled = Convert.ToByte(1); config.useOutboundProxy = Convert.ToByte(0); config.registrationDuration = 300; string strIpAddr = "192.168.0.9"; byte[] arrIpAddr = Encoding.UTF8.GetBytes(strIpAddr); Array.Clear(config.address, 0, BS2Environment.BS2_URL_SIZE); Array.Copy(arrIpAddr, 0, config.address, 0, arrIpAddr.Length); config.port = 5060; config.volume.speaker = 50; config.volume.mic = 50; string strSIPID = "myAccount"; byte[] arrSIPID = Encoding.UTF8.GetBytes(strSIPID); Array.Clear(config.id, 0, BS2Environment.BS2_USER_ID_SIZE); Array.Copy(arrSIPID, 0, config.id, 0, arrSIPID.Length); string strSIPPW = "myPassword"; byte[] arrSIPPW = Encoding.UTF8.GetBytes(strSIPPW); Array.Clear(config.password, 0, BS2Environment.BS2_USER_ID_SIZE); Array.Copy(arrSIPPW, 0, config.password, 0, arrSIPPW.Length); string strAuthCode = "1234"; byte[] arrAuthCode = Encoding.UTF8.GetBytes(strAuthCode); Array.Clear(config.authorizationCode, 0, BS2Environment.BS2_USER_ID_SIZE); Array.Copy(arrAuthCode, 0, config.authorizationCode, 0, arrAuthCode.Length); config.exitButton = Convert.ToByte('0'); // keypad 0 config.showExtensionNumber = Convert.ToByte(true); config.numPhoneBook = 2; string strPhoneNum = "600"; byte[] arrPhoneNum = Encoding.UTF8.GetBytes(strPhoneNum); Array.Clear(config.phonebook[0].phoneNumber, 0, BS2Environment.BS2_USER_ID_SIZE); Array.Copy(arrPhoneNum, 0, config.phonebook[0].phoneNumber, 0, arrPhoneNum.Length); string strPhoneDesc = "LB James"; byte[] arrPhoneDesc = Encoding.UTF8.GetBytes(strPhoneDesc); Array.Clear(config.phonebook[0].description, 0, BS2Environment.BS2_VOIP_MAX_DESCRIPTION_LEN_EXT); Array.Copy(arrPhoneDesc, 0, config.phonebook[0].description, 0, arrPhoneDesc.Length); strPhoneNum = "601"; arrPhoneNum = Encoding.UTF8.GetBytes(strPhoneNum); Array.Clear(config.phonebook[1].phoneNumber, 0, BS2Environment.BS2_USER_ID_SIZE); Array.Copy(arrPhoneNum, 0, config.phonebook[1].phoneNumber, 0, arrPhoneNum.Length); strPhoneDesc = "C Kershaw"; arrPhoneDesc = Encoding.UTF8.GetBytes(strPhoneDesc); Array.Clear(config.phonebook[1].description, 0, BS2Environment.BS2_VOIP_MAX_DESCRIPTION_LEN_EXT); Array.Copy(arrPhoneDesc, 0, config.phonebook[1].description, 0, arrPhoneDesc.Length); BS2ErrorCode result = (BS2ErrorCode)API.BS2_SetVoipConfigExt(sdkContext, deviceID, ref config); if (result != BS2ErrorCode.BS_SDK_SUCCESS) { Console.WriteLine("Got error({0}).", result); }