]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9997: [mod_verto] Invalid JSON-RPC Response to an incorrect JSON-RPC Request....
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 3 Feb 2017 16:57:01 +0000 (10:57 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 3 Feb 2017 16:57:08 +0000 (10:57 -0600)
src/mod/endpoints/mod_verto/mod_verto.c

index dfefe66177a7fa1f03b080d94c9540c6c3bf8322..ad440a8fae4b67c9fc9c6aef2074cf9aeca7b2ec 100644 (file)
@@ -2726,6 +2726,9 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
                }
 
                switch_core_session_rwunlock(session);
+       } else {
+               err = 1;
+               cJSON_AddItemToObject(obj, "message", cJSON_CreateString("CALL DOES NOT EXIST"));
        }
 
  cleanup:
@@ -2733,7 +2736,7 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
        
        if (!err) return SWITCH_TRUE;
 
-       cJSON_AddItemToObject(obj, "message", cJSON_CreateString("CALL DOES NOT EXIST"));
+
        cJSON_AddItemToObject(obj, "code", cJSON_CreateNumber(CODE_SESSION_ERROR));
 
 
@@ -2783,6 +2786,7 @@ static switch_bool_t verto__bye_func(const char *method, cJSON *params, jsock_t
                cJSON_AddItemToObject(obj, "cause", cJSON_CreateString(switch_channel_cause2str(cause)));
                switch_core_session_rwunlock(session);
        } else {
+               cJSON_AddItemToObject(obj, "message", cJSON_CreateString("CALL DOES NOT EXIST"));
                err = 1;
        }
 
@@ -2791,7 +2795,7 @@ static switch_bool_t verto__bye_func(const char *method, cJSON *params, jsock_t
        
        if (!err) return SWITCH_TRUE;
 
-       cJSON_AddItemToObject(obj, "message", cJSON_CreateString("CALL DOES NOT EXIST"));
+
        cJSON_AddItemToObject(obj, "code", cJSON_CreateNumber(CODE_SESSION_ERROR));
 
 
@@ -3154,6 +3158,7 @@ static switch_bool_t verto__modify_func(const char *method, cJSON *params, jsock
                
                switch_core_session_rwunlock(session);
        } else {
+               cJSON_AddItemToObject(obj, "message", cJSON_CreateString("CALL DOES NOT EXIST"));
                err = 1;
        }
 
@@ -3162,7 +3167,7 @@ static switch_bool_t verto__modify_func(const char *method, cJSON *params, jsock
        
        if (!err) return SWITCH_TRUE;
 
-       cJSON_AddItemToObject(obj, "message", cJSON_CreateString("CALL DOES NOT EXIST"));
+
        cJSON_AddItemToObject(obj, "code", cJSON_CreateNumber(CODE_SESSION_ERROR));
 
 
@@ -3197,7 +3202,7 @@ static switch_bool_t verto__attach_func(const char *method, cJSON *params, jsock
        }
 
        if (!(session = switch_core_session_locate(call_id))) {
-               cJSON_AddItemToObject(obj, "message", cJSON_CreateString("Call does not exist"));
+               cJSON_AddItemToObject(obj, "message", cJSON_CreateString("CALL DOES NOT EXIST"));
                err = 1; goto cleanup;
        }