1
0
mirror of https://github.com/danog/php-libtgvoip.git synced 2024-11-30 04:19:26 +01:00

Just in case

This commit is contained in:
Daniil Gentili 2017-07-20 23:29:39 +01:00
parent 589e518d2f
commit 2cc8fcc1e2

View File

@ -94,21 +94,23 @@ void VoIP::deinitVoIPController() {
void VoIP::discard(Php::Parameters &params)
{
Php::Value self(this);
Php::Array reason;
Php::Array rating;
Php::Value debug;
if (params.size() > 0) {
reason = params[0];
} else {
reason["_"] = "phoneCallDiscardReasonDisconnect";
if (self["internalStorage"]["madeline"].value().instanceOf("danog\\MadelineProto\\MTProto")) {
Php::Array reason;
Php::Array rating;
Php::Value debug;
if (params.size() > 0) {
reason = params[0];
} else {
reason["_"] = "phoneCallDiscardReasonDisconnect";
}
if (params.size() > 1) {
rating = params[1];
}
if (params.size() > 2) {
debug = params[2];
} else debug = true;
self["internalStorage"]["madeline"].value().call("discard_call", self["internalStorage"]["callID"]["id"].value(), reason, rating, debug);
}
if (params.size() > 1) {
rating = params[1];
}
if (params.size() > 2) {
debug = params[2];
} else debug = true;
self["internalStorage"]["madeline"].value().call("discard_call", self["internalStorage"]["callID"]["id"].value(), reason, rating, debug);
deinitVoIPController();
}