]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_verto] send last known display info on re-attach
authorAnthony Minessale <anthm@signalwire.com>
Fri, 22 May 2020 00:37:09 +0000 (00:37 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:24 +0000 (22:00 +0300)
src/mod/endpoints/mod_verto/mod_verto.c

index dfcdde25f379b94c490ba9f26a7b19690dc19dc0..a91c484f1bf75d95c946b3c3813e92d697c224d1 100644 (file)
@@ -3553,6 +3553,19 @@ static switch_bool_t verto__attach_func(const char *method, cJSON *params, jsock
        }
 
        if (!err) {
+               const char *cid_name, *cid_num;
+               switch_core_session_message_t msg = { 0 };
+
+               cid_name = switch_channel_get_variable(tech_pvt->channel, "last_sent_display_name");
+               cid_num = switch_channel_get_variable(tech_pvt->channel, "last_sent_display_number");
+               
+               msg.from = __FILE__;
+               msg.string_array_arg[0] = cid_name;
+               msg.string_array_arg[1] = cid_num;
+
+               msg.message_id = SWITCH_MESSAGE_INDICATE_DISPLAY;
+               switch_core_session_receive_message(session, &msg);
+
                return SWITCH_TRUE;
        }