diff --git a/daemon/src/account_schema.h b/daemon/src/account_schema.h index 91359c1d3f243b5a0fdd30cc831a62c81f3d6505..5e72f5f39b6ca1d3eef84f770c8448d448f609f2 100644 --- a/daemon/src/account_schema.h +++ b/daemon/src/account_schema.h @@ -67,6 +67,10 @@ static const char *const CONFIG_ACCOUNT_PASSWORD = "Account.passw static const char *const CONFIG_ACCOUNT_REALM = "Account.realm"; static const char *const CONFIG_ACCOUNT_DEFAULT_REALM = "*"; static const char *const CONFIG_ACCOUNT_USERAGENT = "Account.useragent"; +static const char *const CONFIG_ACCOUNT_AUDIO_PORT_MIN = "Account.audioPortMin"; +static const char *const CONFIG_ACCOUNT_AUDIO_PORT_MAX = "Account.audioPortMax"; +static const char *const CONFIG_ACCOUNT_VIDEO_PORT_MIN = "Account.videoPortMin"; +static const char *const CONFIG_ACCOUNT_VIDEO_PORT_MAX = "Account.videoPortMax"; static const char *const CONFIG_LOCAL_INTERFACE = "Account.localInterface"; static const char *const CONFIG_INTERFACE = "Account.interface"; diff --git a/daemon/src/sip/sipaccount.cpp b/daemon/src/sip/sipaccount.cpp index 1beb715ecd2a00f9eb7417cbf2268db1fd517787..44a7aca2f2893ee404c6e1f71262668f6d733b58 100644 --- a/daemon/src/sip/sipaccount.cpp +++ b/daemon/src/sip/sipaccount.cpp @@ -577,6 +577,21 @@ void SIPAccount::setAccountDetails(std::map<std::string, std::string> details) userAgent_ = details[CONFIG_ACCOUNT_USERAGENT]; keepAliveEnabled_ = details[CONFIG_KEEP_ALIVE_ENABLED] == TRUE_STR; + int tmp = atoi(details[CONFIG_ACCOUNT_AUDIO_PORT_MIN].c_str()); + if (tmp > 0) + audioPortRange_.first = tmp; + tmp = atoi(details[CONFIG_ACCOUNT_AUDIO_PORT_MAX].c_str()); + if (tmp > 0) + audioPortRange_.second = tmp; +#ifdef SFL_VIDEO + tmp = atoi(details[CONFIG_ACCOUNT_VIDEO_PORT_MIN].c_str()); + if (tmp > 0) + videoPortRange_.first = tmp; + tmp = atoi(details[CONFIG_ACCOUNT_VIDEO_PORT_MAX].c_str()); + if (tmp > 0) + videoPortRange_.second = tmp; +#endif + // srtp settings srtpEnabled_ = details[CONFIG_SRTP_ENABLE] == TRUE_STR; srtpFallback_ = details[CONFIG_SRTP_RTP_FALLBACK] == TRUE_STR; @@ -632,6 +647,17 @@ static std::string retrievePassword(const std::map<std::string, std::string>& ma return ""; } +void +addRangeToDetails(std::map<std::string, std::string> &a, const char *minKey, const char *maxKey, const std::pair<uint16_t, uint16_t> &range) +{ + std::ostringstream os; + os << range.first; + a[minKey] = os.str(); + os.str(""); + os << range.second; + a[maxKey] = os.str(); +} + std::map<std::string, std::string> SIPAccount::getAccountDetails() const { std::map<std::string, std::string> a; @@ -685,6 +711,11 @@ std::map<std::string, std::string> SIPAccount::getAccountDetails() const a[CONFIG_ACCOUNT_ROUTESET] = serviceRoute_; a[CONFIG_ACCOUNT_USERAGENT] = userAgent_; + addRangeToDetails(a, CONFIG_ACCOUNT_AUDIO_PORT_MIN, CONFIG_ACCOUNT_AUDIO_PORT_MAX, audioPortRange_); +#ifdef SFL_VIDEO + addRangeToDetails(a, CONFIG_ACCOUNT_VIDEO_PORT_MIN, CONFIG_ACCOUNT_VIDEO_PORT_MAX, videoPortRange_); +#endif + std::stringstream registrationExpireStr; registrationExpireStr << registrationExpire_; a[CONFIG_ACCOUNT_REGISTRATION_EXPIRE] = registrationExpireStr.str(); diff --git a/gnome/src/account_schema.h b/gnome/src/account_schema.h index 008c5776129a2760b96f870280e94cfaa926995f..5e72f5f39b6ca1d3eef84f770c8448d448f609f2 100644 --- a/gnome/src/account_schema.h +++ b/gnome/src/account_schema.h @@ -45,6 +45,7 @@ static const char *const CONFIG_ACCOUNT_TYPE = "Account.type" static const char *const CONFIG_ACCOUNT_ALIAS = "Account.alias"; static const char *const CONFIG_ACCOUNT_MAILBOX = "Account.mailbox"; static const char *const CONFIG_ACCOUNT_ENABLE = "Account.enable"; +static const char *const CONFIG_ACCOUNT_AUTOANSWER = "Account.autoAnswer"; static const char *const CONFIG_ACCOUNT_REGISTRATION_EXPIRE = "Account.registrationExpire"; static const char *const CONFIG_ACCOUNT_REGISTRATION_STATUS = "Account.registrationStatus"; static const char *const CONFIG_ACCOUNT_REGISTRATION_STATE_CODE = "Account.registrationCode"; @@ -57,6 +58,7 @@ static const char *const CONFIG_KEEP_ALIVE_ENABLED = "Account.keepA static const char *const CONFIG_DEFAULT_REGISTRATION_EXPIRE = "60"; +static const char *const CONFIG_DEFAULT_RINGTONE_ENABLED = "true"; static const char *const CONFIG_ACCOUNT_HOSTNAME = "Account.hostname"; static const char *const CONFIG_ACCOUNT_USERNAME = "Account.username"; @@ -65,7 +67,10 @@ static const char *const CONFIG_ACCOUNT_PASSWORD = "Account.passw static const char *const CONFIG_ACCOUNT_REALM = "Account.realm"; static const char *const CONFIG_ACCOUNT_DEFAULT_REALM = "*"; static const char *const CONFIG_ACCOUNT_USERAGENT = "Account.useragent"; -static const char *const CONFIG_ACCOUNT_AUTOANSWER = "Account.autoAnswer"; +static const char *const CONFIG_ACCOUNT_AUDIO_PORT_MIN = "Account.audioPortMin"; +static const char *const CONFIG_ACCOUNT_AUDIO_PORT_MAX = "Account.audioPortMax"; +static const char *const CONFIG_ACCOUNT_VIDEO_PORT_MIN = "Account.videoPortMin"; +static const char *const CONFIG_ACCOUNT_VIDEO_PORT_MAX = "Account.videoPortMax"; static const char *const CONFIG_LOCAL_INTERFACE = "Account.localInterface"; static const char *const CONFIG_INTERFACE = "Account.interface";