]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[core, mod_verto] check for camera change and trigger new constraints
authorAnthony Minessale <anthm@signalwire.com>
Tue, 23 Jun 2020 05:52:14 +0000 (05:52 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:58 +0000 (22:00 +0300)
src/include/switch_types.h
src/mod/endpoints/mod_verto/mod_verto.c

index 0435a9f81f9140c3199ac655ab7f040ffbadf809..a4e40591760b93dbd66e4a7f499e0e7dde31bc4e 100644 (file)
@@ -1634,6 +1634,7 @@ typedef enum {
        CF_REATTACHED,
        CF_VIDEO_READ_TAPPED,
        CF_VIDEO_WRITE_TAPPED,
+       CF_DEVICES_CHANGED,
        /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
        /* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
        CF_FLAG_MAX
index 32480ac9cc5599520e267aacbe3c88860cf0f606..3fdf01b1869c53cbef82b5a2df099dc4dc21a606 100644 (file)
@@ -3611,7 +3611,7 @@ static switch_bool_t verto__ping_func(const char *method, cJSON *params, jsock_t
 static switch_bool_t verto__info_func(const char *method, cJSON *params, jsock_t *jsock, cJSON **response)
 {
        cJSON *msg = NULL, *dialog = NULL, *txt = NULL, *jevent = NULL;
-       const char *call_id = NULL, *dtmf = NULL;
+       const char *call_id = NULL, *dtmf = NULL, *type = NULL;
        switch_bool_t r = SWITCH_TRUE;
        char *proto = VERTO_CHAT_PROTO;
        char *pproto = NULL;
@@ -3624,9 +3624,12 @@ static switch_bool_t verto__info_func(const char *method, cJSON *params, jsock_t
                err = 1; goto cleanup;
        }
 
+       type = cJSON_GetObjectCstr(params, "type");
+
        if ((dialog = cJSON_GetObjectItem(params, "dialogParams")) && (call_id = cJSON_GetObjectCstr(dialog, "callID"))) {
                switch_core_session_t *session = NULL;
-
+               switch_channel_t *channel = NULL;
+               
                if ((session = switch_core_session_locate(call_id))) {
                        verto_pvt_t *tech_pvt = switch_core_session_get_private_class(session, SWITCH_PVT_SECONDARY);
 
@@ -3636,8 +3639,13 @@ static switch_bool_t verto__info_func(const char *method, cJSON *params, jsock_t
                                err = 1; goto cleanup;
                        }
 
+                       channel = switch_core_session_get_channel(session);
                        parse_user_vars(dialog, session);
 
+                       if (type && !strcasecmp(type, "mediaSettings")) {
+                               switch_channel_set_flag(channel, CF_DEVICES_CHANGED);
+                       }
+                       
                        if ((jevent = cJSON_GetObjectItem(params, "command"))) {
                                switch_event_t *event = NULL;