Commit 16fc2f08 authored by nicolas's avatar nicolas

fix(Cli): headers are now base64 encoded for cli uri except and ones, and cleaned from address.

parent 42e00a18
...@@ -144,12 +144,24 @@ void Cli::Command::execute (QHash<QString, QString> &args) const { ...@@ -144,12 +144,24 @@ void Cli::Command::execute (QHash<QString, QString> &args) const {
} }
} }
void Cli::Command::decode (QHash <QString,QString> &args) const{
QByteArray qa;
for (const auto &argName : args.keys()) {
if (argName != QString("sip-address")) {
qa.append(args[argName]);
args[argName] = QByteArray::fromBase64(qa);
qa.clear();
}
}
}
void Cli::Command::executeUri (const shared_ptr<linphone::Address> &address) const { void Cli::Command::executeUri (const shared_ptr<linphone::Address> &address) const {
QHash<QString, QString> args; QHash<QString, QString> args;
for (const auto &argName : mArgsScheme.keys()) for (const auto &argName : mArgsScheme.keys())
args[argName] = ::Utils::coreStringToAppString(address->getHeader(::Utils::appStringToCoreString(argName))); args[argName] = ::Utils::coreStringToAppString(address->getHeader(::Utils::appStringToCoreString(argName)));
address->clean();
args["sip-address"] = ::Utils::coreStringToAppString(address->asStringUriOnly()); args["sip-address"] = ::Utils::coreStringToAppString(address->asStringUriOnly());
decode(args);
execute(args); execute(args);
} }
......
...@@ -63,6 +63,7 @@ class Cli : public QObject { ...@@ -63,6 +63,7 @@ class Cli : public QObject {
const QHash<QString, Argument> &argsScheme const QHash<QString, Argument> &argsScheme
); );
void decode (QHash<QString, QString> &args) const;
void execute (QHash<QString, QString> &args) const; void execute (QHash<QString, QString> &args) const;
void executeUri (const std::shared_ptr<linphone::Address> &address) const; void executeUri (const std::shared_ptr<linphone::Address> &address) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment