From fc03f8547b59aaa943ff1392e5a05da7a5e8de24 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 3 Aug 2017 17:30:54 +0200 Subject: [PATCH] Added setBitrate method --- main.cpp | 11 +++++++++-- main.h | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 058aee8..df2d7e3 100644 --- a/main.cpp +++ b/main.cpp @@ -392,9 +392,15 @@ Php::Value VoIP::setMicMute(Php::Parameters ¶ms) } -void VoIP::debugCtl(Php::Parameters ¶ms) +Php::Value VoIP::debugCtl(Php::Parameters ¶ms) { - inst->DebugCtl(params[0], params[1]); + inst->DebugCtl((int) params[0], (int) params[1]); + return this; +} +Php::Value VoIP::setBitrate(Php::Parameters ¶ms) +{ + inst->DebugCtl(1, (int) params[0]); + return this; } Php::Value VoIP::getDebugLog() @@ -563,6 +569,7 @@ extern "C" { voip.method<&VoIP::setOutputFile>("setOutputFile", Php::Public | Php::Final, {Php::ByVal("file", Php::Type::String)}); voip.method<&VoIP::unsetOutputFile>("unsetOutputFile", Php::Public | Php::Final); + voip.method<&VoIP::setBitrate>("setBitrate", Php::Public | Php::Final, {Php::ByVal("bitrate", Php::Type::Numeric)}); voip.property("configuration", 0, Php::Public); voip.property("storage", 0, Php::Public); diff --git a/main.h b/main.h index 4930c70..67d9ac6 100644 --- a/main.h +++ b/main.h @@ -72,7 +72,8 @@ public: Php::Value getStats(); Php::Value getDebugLog(); Php::Value getDebugString(); - void debugCtl(Php::Parameters ¶ms); + Php::Value debugCtl(Php::Parameters ¶ms); + Php::Value setBitrate(Php::Parameters ¶ms); void setOutputLevel(Php::Parameters ¶ms); Php::Value setMicMute(Php::Parameters ¶ms);