]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Skinny: using labels for display text
authorMathieu Parent <math.parent@gmail.com>
Wed, 12 May 2010 21:51:48 +0000 (23:51 +0200)
committerMathieu Parent <math.parent@gmail.com>
Tue, 18 May 2010 08:49:00 +0000 (10:49 +0200)
Based on chan-sccp-b (file src/sccp_labels.h)

src/mod/endpoints/mod_skinny/skinny_labels.h [new file with mode: 0644]
src/mod/endpoints/mod_skinny/skinny_protocol.c

diff --git a/src/mod/endpoints/mod_skinny/skinny_labels.h b/src/mod/endpoints/mod_skinny/skinny_labels.h
new file mode 100644 (file)
index 0000000..3e495c1
--- /dev/null
@@ -0,0 +1,168 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2010, Mathieu Parent <math.parent@gmail.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Mathieu Parent <math.parent@gmail.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Mathieu Parent <math.parent@gmail.com>
+ *
+ * Based on chan-sccp-b (file src/sccp_labels.h)
+ *
+ * skinny_labels.h -- Skinny Call Control Protocol (SCCP) Endpoint Module
+ *
+ */
+#ifndef _SKINNY_LABELS_H
+#define _SKINNY_LABELS_H
+
+#define SKINNY_DISP_EMPTY                                              ""
+#define SKINNY_DISP_REDIAL                                             "\200\1"
+#define SKINNY_DISP_NEWCALL                                            "\200\2"
+#define SKINNY_DISP_HOLD                                               "\200\3"
+#define SKINNY_DISP_TRANSFER                                           "\200\4"
+#define SKINNY_DISP_CFWDALL                                            "\200\5"
+#define SKINNY_DISP_CFWDBUSY                                           "\200\6"
+#define SKINNY_DISP_CFWDNOANSWER                                       "\200\7"
+#define SKINNY_DISP_BACKSPACE                                          "\200\10"
+#define SKINNY_DISP_ENDCALL                                            "\200\11"
+#define SKINNY_DISP_RESUME                                             "\200\12"
+#define SKINNY_DISP_ANSWER                                             "\200\13"
+#define SKINNY_DISP_INFO                                               "\200\14"
+#define SKINNY_DISP_CONFRM                                             "\200\15"
+#define SKINNY_DISP_PARK                                               "\200\16"
+#define SKINNY_DISP_JOIN                                               "\200\17"
+#define SKINNY_DISP_MEETME                                             "\200\20"
+#define SKINNY_DISP_CALLPICKUP                                         "\200\21"
+#define SKINNY_DISP_GRPCALLPICKUP                                      "\200\22"
+#define SKINNY_DISP_YOUR_CURRENT_OPTIONS                               "\200\23"
+#define SKINNY_DISP_OFF_HOOK                                           "\200\24"
+#define SKINNY_DISP_ON_HOOK                                            "\200\25"
+#define SKINNY_DISP_RING_OUT                                           "\200\26"
+#define SKINNY_DISP_FROM                                               "\200\27"
+#define SKINNY_DISP_CONNECTED                                          "\200\30"
+#define SKINNY_DISP_BUSY                                               "\200\31"
+#define SKINNY_DISP_LINE_IN_USE                                        "\200\32"
+#define SKINNY_DISP_CALL_WAITING                                       "\200\33"
+#define SKINNY_DISP_CALL_TRANSFER                                      "\200\34"
+#define SKINNY_DISP_CALL_PARK                                          "\200\35"
+#define SKINNY_DISP_CALL_PROCEED                                       "\200\36"
+#define SKINNY_DISP_IN_USE_REMOTE                                      "\200\37"
+#define SKINNY_DISP_ENTER_NUMBER                                       "\200\40"
+#define SKINNY_DISP_CALL_PARK_AT                                       "\200\41"
+#define SKINNY_DISP_PRIMARY_ONLY                                       "\200\42"
+#define SKINNY_DISP_TEMP_FAIL                                          "\200\43"
+#define SKINNY_DISP_YOU_HAVE_VOICEMAIL                                 "\200\44"
+#define SKINNY_DISP_FORWARDED_TO                                       "\200\45"
+#define SKINNY_DISP_CAN_NOT_COMPLETE_CONFERENCE                        "\200\46"
+#define SKINNY_DISP_NO_CONFERENCE_BRIDGE                               "\200\47"
+#define SKINNY_DISP_CAN_NOT_HOLD_PRIMARY_CONTROL                       "\200\50"
+#define SKINNY_DISP_INVALID_CONFERENCE_PARTICIPANT                     "\200\51"
+#define SKINNY_DISP_IN_CONFERENCE_ALREADY                              "\200\52"
+#define SKINNY_DISP_NO_PARTICIPANT_INFO                                "\200\53"
+#define SKINNY_DISP_EXCEED_MAXIMUM_PARTIES                             "\200\54"
+#define SKINNY_DISP_KEY_IS_NOT_ACTIVE                                  "\200\55"
+#define SKINNY_DISP_ERROR_NO_LICENSE                                   "\200\56"
+#define SKINNY_DISP_ERROR_DBCONFIG                                     "\200\57"
+#define SKINNY_DISP_ERROR_DATABASE                                     "\200\60"
+#define SKINNY_DISP_ERROR_PASS_LIMIT                                   "\200\61"
+#define SKINNY_DISP_ERROR_UNKNOWN                                      "\200\62"
+#define SKINNY_DISP_ERROR_MISMATCH                                     "\200\63"
+#define SKINNY_DISP_CONFERENCE                                         "\200\64"
+#define SKINNY_DISP_PARK_NUMBER                                        "\200\65"
+#define SKINNY_DISP_PRIVATE                                            "\200\66"
+#define SKINNY_DISP_NOT_ENOUGH_BANDWIDTH                               "\200\67"
+#define SKINNY_DISP_UNKNOWN_NUMBER                                     "\200\70"
+#define SKINNY_DISP_RMLSTC                                             "\200\71"
+#define SKINNY_DISP_VOICEMAIL                                          "\200\72"
+#define SKINNY_DISP_IMMDIV                                             "\200\73"
+#define SKINNY_DISP_INTRCPT                                            "\200\74"
+#define SKINNY_DISP_SETWTCH                                            "\200\75"
+#define SKINNY_DISP_TRNSFVM                                            "\200\76"
+#define SKINNY_DISP_DND                                                "\200\77"
+#define SKINNY_DISP_DIVALL                                             "\200\100"
+#define SKINNY_DISP_CALLBACK                                           "\200\101"
+#define SKINNY_DISP_NETWORK_CONGESTION_REROUTING                       "\200\102"
+#define SKINNY_DISP_BARGE                                              "\200\103"
+#define SKINNY_DISP_FAILED_TO_SETUP_BARGE                              "\200\104"
+#define SKINNY_DISP_ANOTHER_BARGE_EXISTS                               "\200\105"
+#define SKINNY_DISP_INCOMPATIBLE_DEVICE_TYPE                           "\200\106"
+#define SKINNY_DISP_NO_PARK_NUMBER_AVAILABLE                           "\200\107"
+#define SKINNY_DISP_CALLPARK_REVERSION                                 "\200\110"
+#define SKINNY_DISP_SERVICE_IS_NOT_ACTIVE                              "\200\111"
+#define SKINNY_DISP_HIGH_TRAFFIC_TRY_AGAIN_LATER                       "\200\112"
+#define SKINNY_DISP_QRT                                                "\200\113"
+#define SKINNY_DISP_MCID                                               "\200\114"
+#define SKINNY_DISP_DIRTRFR                                            "\200\115"
+#define SKINNY_DISP_SELECT                                             "\200\116"
+#define SKINNY_DISP_CONFLIST                                           "\200\117"
+#define SKINNY_DISP_IDIVERT                                            "\200\120"
+#define SKINNY_DISP_CBARGE                                             "\200\121"
+#define SKINNY_DISP_CAN_NOT_COMPLETE_TRANSFER                          "\200\122"
+#define SKINNY_DISP_CAN_NOT_JOIN_CALLS                                 "\200\123"
+#define SKINNY_DISP_MCID_SUCCESSFUL                                    "\200\124"
+#define SKINNY_DISP_NUMBER_NOT_CONFIGURED                              "\200\125"
+#define SKINNY_DISP_SECURITY_ERROR                                     "\200\126"
+#define SKINNY_DISP_VIDEO_BANDWIDTH_UNAVAILABLE                        "\200\127"
+#define SKINNY_DISP_VIDMODE                                            "\200\130"
+#define SKINNY_DISP_MAX_CALL_DURATION_TIMEOUT                          "\200\131"
+#define SKINNY_DISP_MAX_HOLD_DURATION_TIMEOUT                          "\200\132"
+#define SKINNY_DISP_OPICKUP                                            "\200\133"
+#define SKINNY_DISP_EXTERNAL_TRANSFER_RESTRICTED                       "\200\141"
+#define SKINNY_DISP_MAC_ADDRESS                                                "\200\145"
+#define SKINNY_DISP_HOST_NAME                                          "\200\146"
+#define SKINNY_DISP_DOMAIN_NAME                                                "\200\147"
+#define SKINNY_DISP_IP_ADDRESS                                         "\200\150"
+#define SKINNY_DISP_SUBNET_MASK                                                "\200\151"
+#define SKINNY_DISP_TFTP_SERVER_1                                      "\200\152"
+#define SKINNY_DISP_DEFAULT_ROUTER_1                                   "\200\153"
+#define SKINNY_DISP_DEFAULT_ROUTER_2                                   "\200\154"
+#define SKINNY_DISP_DEFAULT_ROUTER_3                                   "\200\155"
+#define SKINNY_DISP_DEFAULT_ROUTER_4                                   "\200\156"
+#define SKINNY_DISP_DEFAULT_ROUTER_5                                   "\200\157"
+#define SKINNY_DISP_DNS_SERVER_1                                       "\200\160"
+#define SKINNY_DISP_DNS_SERVER_2                                       "\200\161"
+#define SKINNY_DISP_DNS_SERVER_3                                       "\200\162"
+#define SKINNY_DISP_DNS_SERVER_4                                       "\200\163"
+#define SKINNY_DISP_DNS_SERVER_5                                       "\200\164"
+#define SKINNY_DISP_OPERATIONAL_VLAN_ID                                        "\200\165"
+#define SKINNY_DISP_ADMIN_VLAN_ID                                      "\200\166"
+#define SKINNY_DISP_CALL_MANAGER_1                                     "\200\167"
+#define SKINNY_DISP_CALL_MANAGER_2                                     "\200\170"
+#define SKINNY_DISP_CALL_MANAGER_3                                     "\200\171"
+#define SKINNY_DISP_CALL_MANAGER_4                                     "\200\172"
+#define SKINNY_DISP_CALL_MANAGER_5                                     "\200\173"
+#define SKINNY_DISP_INFORMATION_URL                                    "\200\174"
+#define SKINNY_DISP_DIRECTORIES_URL                                    "\200\175"
+#define SKINNY_DISP_MESSAGES_URL                                       "\200\176"
+#define SKINNY_DISP_SERVICES_URL                                       "\200\177"
+
+#endif /* _SKINNY_LABELS_H */
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
index 569a2a96240b236072de19de5da5a0e4ae15c222..e7e64d7fdff6d034934cfb47d07137d4f9c0771b 100644 (file)
 #include "mod_skinny.h"
 #include "skinny_protocol.h"
 #include "skinny_tables.h"
+#include "skinny_labels.h"
 
 skinny_globals_t globals;
 
 struct soft_key_template_definition soft_key_template_default[] = {
-       { "\200\001", SOFTKEY_REDIAL },
-       { "\200\002", SOFTKEY_NEWCALL },
-       { "\200\003", SOFTKEY_HOLD },
-       { "\200\004", SOFTKEY_TRANSFER },
-       { "\200\005", SOFTKEY_CFWDALL },
-       { "\200\006", SOFTKEY_CFWDBUSY },
-       { "\200\007", SOFTKEY_CFWDNOANSWER },
-       { "\200\010", SOFTKEY_BACKSPACE },
-       { "\200\011", SOFTKEY_ENDCALL },
-       { "\200\012", SOFTKEY_RESUME },
-       { "\200\013", SOFTKEY_ANSWER },
-       { "\200\014", SOFTKEY_INFO },
-       { "\200\015", SOFTKEY_CONFRM },
-       { "\200\016", SOFTKEY_PARK },
-       { "\200\017", SOFTKEY_JOIN },
-       { "\200\020", SOFTKEY_MEETMECONFRM },
-       { "\200\021", SOFTKEY_CALLPICKUP },
-       { "\200\022", SOFTKEY_GRPCALLPICKUP },
-       { "\200\077", SOFTKEY_DND },
-       { "\200\120", SOFTKEY_IDIVERT },
+       { SKINNY_DISP_REDIAL, SOFTKEY_REDIAL },
+       { SKINNY_DISP_NEWCALL, SOFTKEY_NEWCALL },
+       { SKINNY_DISP_HOLD, SOFTKEY_HOLD },
+       { SKINNY_DISP_TRANSFER, SOFTKEY_TRANSFER },
+       { SKINNY_DISP_CFWDALL, SOFTKEY_CFWDALL },
+       { SKINNY_DISP_CFWDBUSY, SOFTKEY_CFWDBUSY },
+       { SKINNY_DISP_CFWDNOANSWER, SOFTKEY_CFWDNOANSWER },
+       { SKINNY_DISP_BACKSPACE, SOFTKEY_BACKSPACE },
+       { SKINNY_DISP_ENDCALL, SOFTKEY_ENDCALL },
+       { SKINNY_DISP_RESUME, SOFTKEY_RESUME },
+       { SKINNY_DISP_ANSWER, SOFTKEY_ANSWER },
+       { SKINNY_DISP_INFO, SOFTKEY_INFO },
+       { SKINNY_DISP_CONFRM, SOFTKEY_CONFRM },
+       { SKINNY_DISP_PARK, SOFTKEY_PARK },
+       { SKINNY_DISP_JOIN, SOFTKEY_JOIN },
+       { SKINNY_DISP_MEETME, SOFTKEY_MEETMECONFRM },
+       { SKINNY_DISP_CALLPICKUP, SOFTKEY_CALLPICKUP },
+       { SKINNY_DISP_GRPCALLPICKUP, SOFTKEY_GRPCALLPICKUP },
+       { SKINNY_DISP_DND, SOFTKEY_DND },
+       { SKINNY_DISP_IDIVERT, SOFTKEY_IDIVERT },
 };
 
 /*****************************************************************************/
@@ -403,7 +404,7 @@ int skinny_ring_lines_callback(void *pArg, int argc, char **argv, char **columnN
                helper->lines_count++;
                skinny_line_set_state(listener, line_instance, helper->tech_pvt->call_id, SKINNY_RING_IN);
                send_select_soft_keys(listener, line_instance, helper->tech_pvt->call_id, SKINNY_KEY_SET_RING_IN, 0xffff);
-           if ((tmp = switch_mprintf("\200\027%s", helper->tech_pvt->caller_profile->destination_number))) {
+           if ((tmp = switch_mprintf("%s%s", SKINNY_DISP_FROM, helper->tech_pvt->caller_profile->destination_number))) {
                send_display_prompt_status(listener, 0, tmp, line_instance, helper->tech_pvt->call_id);
                    switch_safe_free(tmp);
            }
@@ -665,7 +666,7 @@ int skinny_session_process_dest_callback(void *pArg, int argc, char **argv, char
                        send_set_lamp(listener, SKINNY_BUTTON_LINE, line_instance, SKINNY_LAMP_ON);
                        skinny_line_set_state(listener, line_instance, helper->tech_pvt->call_id, SKINNY_IN_USE_REMOTELY);
                        send_select_soft_keys(listener, line_instance, helper->tech_pvt->call_id, 10, 0xffff);
-                       send_display_prompt_status(listener, 0, "\200\037",
+                       send_display_prompt_status(listener, 0, SKINNY_DISP_IN_USE_REMOTE,
                                line_instance, helper->tech_pvt->call_id);
                        skinny_session_send_call_info(helper->tech_pvt->session, listener, line_instance);
            }