FS-6290 --resolve
This commit is contained in:
parent
ef278822d4
commit
8b57411bdd
|
@ -179,11 +179,6 @@ static switch_status_t v8_mod_load_file(const char *filename)
|
||||||
|
|
||||||
v8_mod_init = (v8_mod_init_t) (intptr_t) function_handle;
|
v8_mod_init = (v8_mod_init_t) (intptr_t) function_handle;
|
||||||
|
|
||||||
if (v8_mod_init == NULL) {
|
|
||||||
err = "Cannot Load";
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (v8_mod_init(&module_interface) != SWITCH_STATUS_SUCCESS) {
|
if (v8_mod_init(&module_interface) != SWITCH_STATUS_SUCCESS) {
|
||||||
err = "Module load routine returned an error";
|
err = "Module load routine returned an error";
|
||||||
goto err;
|
goto err;
|
||||||
|
|
|
@ -101,13 +101,14 @@ void *FSCoreDB::Construct(const v8::FunctionCallbackInfo<Value>& info)
|
||||||
int FSCoreDB::Callback(void *pArg, int argc, char **argv, char **columnNames)
|
int FSCoreDB::Callback(void *pArg, int argc, char **argv, char **columnNames)
|
||||||
{
|
{
|
||||||
FSCoreDB *dbo = static_cast<FSCoreDB *>(pArg);
|
FSCoreDB *dbo = static_cast<FSCoreDB *>(pArg);
|
||||||
HandleScope handle_scope(dbo->GetIsolate());
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
|
|
||||||
if (!dbo) {
|
if (!dbo) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HandleScope handle_scope(dbo->GetIsolate());
|
||||||
|
|
||||||
if (dbo->_callback.IsEmpty()) {
|
if (dbo->_callback.IsEmpty()) {
|
||||||
dbo->GetIsolate()->ThrowException(String::NewFromUtf8(dbo->GetIsolate(), "No callback specified"));
|
dbo->GetIsolate()->ThrowException(String::NewFromUtf8(dbo->GetIsolate(), "No callback specified"));
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -60,7 +60,6 @@ string FSCURL::GetJSClassName()
|
||||||
size_t FSCURL::FileCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
size_t FSCURL::FileCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||||
{
|
{
|
||||||
FSCURL *obj = static_cast<FSCURL *>(data);
|
FSCURL *obj = static_cast<FSCURL *>(data);
|
||||||
HandleScope handle_scope(obj->GetIsolate());
|
|
||||||
register unsigned int realsize = (unsigned int) (size * nmemb);
|
register unsigned int realsize = (unsigned int) (size * nmemb);
|
||||||
uint32_t argc = 0;
|
uint32_t argc = 0;
|
||||||
Handle<Value> argv[4];
|
Handle<Value> argv[4];
|
||||||
|
@ -69,6 +68,7 @@ size_t FSCURL::FileCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HandleScope handle_scope(obj->GetIsolate());
|
||||||
Handle<Function> func;
|
Handle<Function> func;
|
||||||
|
|
||||||
if (!obj->_function.IsEmpty()) {
|
if (!obj->_function.IsEmpty()) {
|
||||||
|
|
|
@ -694,6 +694,10 @@ JS_SESSION_FUNCTION_IMPL(SayPhrase)
|
||||||
|
|
||||||
bool FSSession::CheckHangupHook(FSSession *obj, bool *ret)
|
bool FSSession::CheckHangupHook(FSSession *obj, bool *ret)
|
||||||
{
|
{
|
||||||
|
if (!obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
Isolate *isolate = obj->GetIsolate();
|
Isolate *isolate = obj->GetIsolate();
|
||||||
HandleScope handle_scope(isolate);
|
HandleScope handle_scope(isolate);
|
||||||
Handle<Value> argv[2];
|
Handle<Value> argv[2];
|
||||||
|
@ -701,7 +705,7 @@ bool FSSession::CheckHangupHook(FSSession *obj, bool *ret)
|
||||||
bool res = true;
|
bool res = true;
|
||||||
string resp;
|
string resp;
|
||||||
|
|
||||||
if (obj && !obj->_check_state && !obj->_on_hangup.IsEmpty() && (obj->_hook_state == CS_HANGUP || obj->_hook_state == CS_ROUTING)) {
|
if (!obj->_check_state && !obj->_on_hangup.IsEmpty() && (obj->_hook_state == CS_HANGUP || obj->_hook_state == CS_ROUTING)) {
|
||||||
obj->_check_state++;
|
obj->_check_state++;
|
||||||
argv[argc++] = Local<Object>::New(obj->GetOwner()->GetIsolate(), obj->GetJavaScriptObject());
|
argv[argc++] = Local<Object>::New(obj->GetOwner()->GetIsolate(), obj->GetJavaScriptObject());
|
||||||
|
|
||||||
|
@ -1499,18 +1503,14 @@ JS_SESSION_GET_PROPERTY_IMPL(GetProperty)
|
||||||
if (!strcmp(prop, "cause")) {
|
if (!strcmp(prop, "cause")) {
|
||||||
if (channel) {
|
if (channel) {
|
||||||
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_cause2str(switch_channel_get_cause(channel))));
|
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_cause2str(switch_channel_get_cause(channel))));
|
||||||
} else if (this) {
|
|
||||||
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_cause2str(this->_cause)));
|
|
||||||
} else {
|
} else {
|
||||||
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), ""));
|
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_cause2str(this->_cause)));
|
||||||
}
|
}
|
||||||
} else if (!strcmp(prop, "causecode")) {
|
} else if (!strcmp(prop, "causecode")) {
|
||||||
if (channel) {
|
if (channel) {
|
||||||
info.GetReturnValue().Set(Integer::New(info.GetIsolate(), switch_channel_get_cause(channel)));
|
info.GetReturnValue().Set(Integer::New(info.GetIsolate(), switch_channel_get_cause(channel)));
|
||||||
} else if (this) {
|
|
||||||
info.GetReturnValue().Set(Integer::New(info.GetIsolate(), this->_cause));
|
|
||||||
} else {
|
} else {
|
||||||
info.GetReturnValue().Set(Integer::New(info.GetIsolate(), 0));
|
info.GetReturnValue().Set(Integer::New(info.GetIsolate(), this->_cause));
|
||||||
}
|
}
|
||||||
} else if (!strcmp(prop, "name")) {
|
} else if (!strcmp(prop, "name")) {
|
||||||
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_get_name(channel)));
|
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_get_name(channel)));
|
||||||
|
|
|
@ -304,7 +304,7 @@ JS_TELETONE_FUNCTION_IMPL(Generate)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((write_frame.datalen = (uint32_t) switch_buffer_read_loop(_audio_buffer,
|
if (!_audio_buffer || (write_frame.datalen = (uint32_t) switch_buffer_read_loop(_audio_buffer,
|
||||||
fdata, write_frame.codec->implementation->decoded_bytes_per_packet)) <= 0) {
|
fdata, write_frame.codec->implementation->decoded_bytes_per_packet)) <= 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue