BS2VoipConfigExt config = Util.AllocateStructure(); 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); }