Revision
17300
Author
math.parent
Date
2010-04-15 03:54:01 -0500 (Thu, 15 Apr 2010)

Log Message

Skinny: Handle backspace

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c (17299 => 17300)


--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c	2010-04-15 07:20:06 UTC (rev 17299)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.c	2010-04-15 08:54:01 UTC (rev 17300)
@@ -606,6 +606,7 @@
 	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 @@
 		    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 @@
 	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,

Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.h (17299 => 17300)


--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.h	2010-04-15 07:20:06 UTC (rev 17299)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_protocol.h	2010-04-15 08:54:01 UTC (rev 17300)
@@ -457,6 +457,13 @@
     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 @@
     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 @@
     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,

Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.c (17299 => 17300)


--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.c	2010-04-15 07:20:06 UTC (rev 17299)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.c	2010-04-15 08:54:01 UTC (rev 17300)
@@ -86,6 +86,7 @@
     {"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},

Modified: freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.h (17299 => 17300)


--- freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.h	2010-04-15 07:20:06 UTC (rev 17299)
+++ freeswitch/trunk/src/mod/endpoints/mod_skinny/skinny_tables.h	2010-04-15 08:54:01 UTC (rev 17300)
@@ -84,7 +84,7 @@
     }
 
 
-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)