]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Skinny: Handle backspace
authorMathieu Parent <math.parent@gmail.com>
Thu, 15 Apr 2010 08:54:01 +0000 (10:54 +0200)
committerMathieu Parent <math.parent@gmail.com>
Thu, 15 Apr 2010 08:54:01 +0000 (10:54 +0200)
src/mod/endpoints/mod_skinny/skinny_protocol.c
src/mod/endpoints/mod_skinny/skinny_protocol.h
src/mod/endpoints/mod_skinny/skinny_tables.c
src/mod/endpoints/mod_skinny/skinny_tables.h

index 94c61eb1dd7e28e813528b30399a943a773d70ba..51cbe9b60924257967960a11b05d3500a3873e7e 100644 (file)
@@ -606,6 +606,7 @@ switch_status_t skinny_session_process_dest(switch_core_session_t *session, list
        if (!dest) {
                if (backspace) { /* backspace */
                        *tech_pvt->caller_profile->destination_number++ = '\0';
+                       send_back_space_request(listener, line_instance, tech_pvt->call_id);
                }
            if (append_dest != '\0' && !backspace) {/* append digit */
                tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool,
@@ -615,7 +616,6 @@ switch_status_t skinny_session_process_dest(switch_core_session_t *session, list
                    send_start_tone(listener, SKINNY_TONE_DIALTONE, 0, line_instance, tech_pvt->call_id);
                    if(backspace) {
                                send_select_soft_keys(listener, line_instance, tech_pvt->call_id, SKINNY_KEY_SET_OFF_HOOK, 0xffff);
-                               /* TODO: How to clear the screen? */
                    }
                } else if (strlen(tech_pvt->caller_profile->destination_number) == 1) {/* first digit */
                send_stop_tone(listener, line_instance, tech_pvt->call_id);
@@ -1476,6 +1476,20 @@ switch_status_t send_activate_call_plane(listener_t *listener,
        return skinny_send_reply(listener, message);
 }
 
+switch_status_t send_back_space_request(listener_t *listener,
+    uint32_t line_instance,
+    uint32_t call_id)
+{
+       skinny_message_t *message;
+       message = switch_core_alloc(listener->pool, 12+sizeof(message->data.back_space_req));
+       message->type = BACK_SPACE_REQ_MESSAGE;
+       message->length = 4 + sizeof(message->data.back_space_req);
+       message->data.back_space_req.line_instance = line_instance;
+       message->data.back_space_req.call_id = call_id;
+       return skinny_send_reply(listener, message);
+
+}
+
 switch_status_t send_dialed_number(listener_t *listener,
        char called_party[24],
        uint32_t line_instance,
index 31997388564c4396908e72d3660ddd03e91c37bb..c038be5cc97df5612da2472aac7e0f3dabd8b96f 100644 (file)
@@ -457,6 +457,13 @@ struct unregister_ack_message {
     uint32_t unregister_status;
 };
 
+/* BackSpaceReqMessage */
+#define BACK_SPACE_REQ_MESSAGE 0x0119
+struct back_space_req_message {
+    uint32_t line_instance;
+    uint32_t call_id;
+};
+
 /* DialedNumberMessage */
 #define DIALED_NUMBER_MESSAGE 0x011D
 struct dialed_number_message {
@@ -540,6 +547,7 @@ union skinny_data {
     struct clear_prompt_status_message clear_prompt_status;
     struct activate_call_plane_message activate_call_plane;
     struct unregister_ack_message unregister_ack;
+    struct back_space_req_message back_space_req;
     struct dialed_number_message dialed_number;
     struct feature_stat_res_message feature_res;
     struct display_pri_notify_message display_pri_notify;
@@ -748,6 +756,9 @@ switch_status_t send_clear_prompt_status(listener_t *listener,
     uint32_t call_id);
 switch_status_t send_activate_call_plane(listener_t *listener,
     uint32_t line_instance);
+switch_status_t send_back_space_request(listener_t *listener,
+    uint32_t line_instance,
+    uint32_t call_id);
 switch_status_t send_dialed_number(listener_t *listener,
     char called_party[24],
     uint32_t line_instance,
index 5ddd53ac87bde13ed1966c9f00e1b7e6bc31ec26..b9d6a2e29b52b8b863282d5b5f93dccc2493c8bf 100644 (file)
@@ -86,6 +86,7 @@ struct skinny_table SKINNY_MESSAGE_TYPES[] = {
     {"ClearPromptStatusMessage", CLEAR_PROMPT_STATUS_MESSAGE},
     {"ActivateCallPlaneMessage", ACTIVATE_CALL_PLANE_MESSAGE},
     {"UnregisterAckMessage", UNREGISTER_ACK_MESSAGE},
+    {"BackSpaceReqMessage", BACK_SPACE_REQ_MESSAGE},
     {"DialedNumberMessage", DIALED_NUMBER_MESSAGE},
     {"FeatureResMessage", FEATURE_STAT_RES_MESSAGE},
     {"DisplayPriNotifyMessage", DISPLAY_PRI_NOTIFY_MESSAGE},
index 9e3ab3be4c5ca5538c3715a6081eed283e77711b..8db8209e872c96aa3f3b530223330b683b422996 100644 (file)
@@ -84,7 +84,7 @@ uint32_t func(const char *str)\
     }
 
 
-struct skinny_table SKINNY_MESSAGE_TYPES[56];
+struct skinny_table SKINNY_MESSAGE_TYPES[57];
 const char *skinny_message_type2str(uint32_t id);
 uint32_t skinny_str2message_type(const char *str);
 #define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)