123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- /*
- * CallingAPI.h
- * 对讲UI所有接口通过这个文件对接底层
- * Created on: 2021年12月10日
- * Author: Admin
- */
- #ifndef JNI_CALL_CALLINGAPI_H_
- #define JNI_CALL_CALLINGAPI_H_
- #include <system/Thread.h>
- #include "voip/telephone.h"
- #include "sip_config.h"
- #include "utils/Log.h"
- #include "storage/StoragePreferences.h"
- #include "base/prefs.hpp"
- #include "edge/ip_table.h"
- #define SETTINGS_SCREENSAVER_BRIGHTNESS "screensaver_brightness"
- #define SETTINGS_ADDRESS "address"
- #define SETTINGS_VOLUME_SIZE "volume_size"
- voip::Telephone* GetTelephone();
- void ReleaseTelephone();
- //自动测试
- class AutoDialTest : public Thread {
- virtual bool threadLoop() {
- sleep(3000);
- std::string domain = StoragePreferences::getString(SIP_REG_DOMAIN,
- SIP_REG_DOMAIN_DEFAULT);
- std::string door_number = StoragePreferences::getString(SIP_REG_DOOR_ACCOUNT,
- SIP_REG_DOOR_ACCOUNT_DEFAULT);
- std::string door_uri = URI(door_number, domain);
- if (base::startswith(door_number, "192.168")) {
- door_uri = std::string("sip:") + door_number;
- }
- voip::CallSetting setting;
- setting.enable_video = true;
- LOGD("make call %s, video %d", door_uri.c_str(), setting.enable_video);
- GetTelephone()->MakeCall(door_uri, setting);
- sleep(8000);
- GetTelephone()->Hangup();
- return true;
- }
- };
- std::string GetVersion();
- int GetVersionNo();
- std::string GetDeviceUid();
- void HeadSetting(voip::CallSetting& setting);
- //bool GetLocalAddress(j::house_setting* profile);
- //void SetLocalAddress(const j::house_setting& profile);
- #endif /* JNI_CALL_CALLINGAPI_H_ */
|