utilities.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * CallingAPI.h
  3. * 对讲UI所有接口通过这个文件对接底层
  4. * Created on: 2021年12月10日
  5. * Author: Admin
  6. */
  7. #ifndef JNI_CALL_CALLINGAPI_H_
  8. #define JNI_CALL_CALLINGAPI_H_
  9. #include <system/Thread.h>
  10. #include "voip/telephone.h"
  11. #include "sip_config.h"
  12. #include "utils/Log.h"
  13. #include "storage/StoragePreferences.h"
  14. #include "base/prefs.hpp"
  15. #include "edge/ip_table.h"
  16. #define SETTINGS_SCREENSAVER_BRIGHTNESS "screensaver_brightness"
  17. #define SETTINGS_ADDRESS "address"
  18. #define SETTINGS_VOLUME_SIZE "volume_size"
  19. voip::Telephone* GetTelephone();
  20. void ReleaseTelephone();
  21. //自动测试
  22. class AutoDialTest : public Thread {
  23. virtual bool threadLoop() {
  24. sleep(3000);
  25. std::string domain = StoragePreferences::getString(SIP_REG_DOMAIN,
  26. SIP_REG_DOMAIN_DEFAULT);
  27. std::string door_number = StoragePreferences::getString(SIP_REG_DOOR_ACCOUNT,
  28. SIP_REG_DOOR_ACCOUNT_DEFAULT);
  29. std::string door_uri = URI(door_number, domain);
  30. if (base::startswith(door_number, "192.168")) {
  31. door_uri = std::string("sip:") + door_number;
  32. }
  33. voip::CallSetting setting;
  34. setting.enable_video = true;
  35. LOGD("make call %s, video %d", door_uri.c_str(), setting.enable_video);
  36. GetTelephone()->MakeCall(door_uri, setting);
  37. sleep(8000);
  38. GetTelephone()->Hangup();
  39. return true;
  40. }
  41. };
  42. std::string GetVersion();
  43. int GetVersionNo();
  44. std::string GetDeviceUid();
  45. void HeadSetting(voip::CallSetting& setting);
  46. //bool GetLocalAddress(j::house_setting* profile);
  47. //void SetLocalAddress(const j::house_setting& profile);
  48. #endif /* JNI_CALL_CALLINGAPI_H_ */