Add 'prefix' parameter to 'goto' action
authorAndreas Eversberg <jolly@eversberg.eu>
Thu, 19 Sep 2013 07:43:11 +0000 (09:43 +0200)
committerAndreas Eversberg <jolly@eversberg.eu>
Tue, 15 Dec 2015 19:54:48 +0000 (20:54 +0100)
action.cpp
apppbx.cpp
remote.cpp
route.c

index b42e301..5256543 100644 (file)
@@ -1596,6 +1596,14 @@ void EndpointAppPBX::_action_goto_menu(int mode)
                                SCPY(e_dialinginfo.id, e_extdialing);
                        e_extdialing = e_dialinginfo.id;
                }
                                SCPY(e_dialinginfo.id, e_extdialing);
                        e_extdialing = e_dialinginfo.id;
                }
+               /* add prefix */
+               if ((rparam = routeparam(e_action, PARAM_PREFIX))) {
+                       char extdialing[256];
+                       SCPY(extdialing, e_extdialing);
+                       SPRINT(e_dialinginfo.id, "%s%s", rparam->string_value, extdialing);
+                       e_extdialing = e_dialinginfo.id;
+               }
+
        }
 
        /* play sample */
        }
 
        /* play sample */
index 98e6e64..e96b54c 100644 (file)
@@ -5007,6 +5007,11 @@ void EndpointAppPBX::logmessage(int message_type, union parameter *param, unsign
                end_trace();
                break;
 
                end_trace();
                break;
 
+               case MESSAGE_ENABLEKEYPAD:
+               trace_header("ENABLEKEYPAD", dir);
+               end_trace();
+               break;
+
                default:
                PERROR("EPOINT(%d) message not of correct type (%d)\n", ea_endpoint->ep_serial, message_type);
        }
                default:
                PERROR("EPOINT(%d) message not of correct type (%d)\n", ea_endpoint->ep_serial, message_type);
        }
index cb6e528..f5105b6 100644 (file)
@@ -106,6 +106,12 @@ int Premote::message_epoint(unsigned int epoint_id, int message_type, union para
        case MESSAGE_CONNECT:
                memcpy(&p_connectinfo, &param->connectinfo, sizeof(p_connectinfo));
                new_state(PORT_STATE_CONNECT);
        case MESSAGE_CONNECT:
                memcpy(&p_connectinfo, &param->connectinfo, sizeof(p_connectinfo));
                new_state(PORT_STATE_CONNECT);
+               {
+                       union parameter newparam;
+                       memset(&newparam, 0, sizeof(union parameter));
+                       param->traffic.len = 160;
+                       admin_message_from_lcr(p_r_remote_id, p_r_ref, MESSAGE_TRAFFIC, param);
+               }
                break;
 
        case MESSAGE_DISCONNECT:
                break;
 
        case MESSAGE_DISCONNECT:
@@ -211,6 +217,12 @@ void Premote::message_remote(int message_type, union parameter *param)
        case MESSAGE_CONNECT:
                memcpy(&p_connectinfo, &param->connectinfo, sizeof(p_connectinfo));
                new_state(PORT_STATE_CONNECT);
        case MESSAGE_CONNECT:
                memcpy(&p_connectinfo, &param->connectinfo, sizeof(p_connectinfo));
                new_state(PORT_STATE_CONNECT);
+               {
+                       union parameter newparam;
+                       memset(&newparam, 0, sizeof(union parameter));
+                       param->traffic.len = 160;
+                       admin_message_from_lcr(p_r_remote_id, p_r_ref, MESSAGE_TRAFFIC, param);
+               }
                break;
 
        case MESSAGE_DISCONNECT:
                break;
 
        case MESSAGE_DISCONNECT:
diff --git a/route.c b/route.c
index 925bfe8..6fa0adb 100644 (file)
--- a/route.c
+++ b/route.c
@@ -339,7 +339,7 @@ struct action_defs action_defs[] = {
 //       "Caller calls the timer."},
        { ACTION_GOTO,
          "goto",       NULL, &EndpointAppPBX::action_dialing_goto, NULL,
 //       "Caller calls the timer."},
        { ACTION_GOTO,
          "goto",       NULL, &EndpointAppPBX::action_dialing_goto, NULL,
-         PARAM_PROCEEDING | PARAM_ALERTING | PARAM_CONNECT | PARAM_RULESET | PARAM_STRIP | PARAM_SAMPLE,
+         PARAM_PROCEEDING | PARAM_ALERTING | PARAM_CONNECT | PARAM_RULESET | PARAM_STRIP | PARAM_PREFIX | PARAM_SAMPLE,
          "Jump to given ruleset and optionally play sample. Dialed digits are not flushed."},
        { ACTION_MENU,
          "menu",       NULL, &EndpointAppPBX::action_dialing_menu, NULL,
          "Jump to given ruleset and optionally play sample. Dialed digits are not flushed."},
        { ACTION_MENU,
          "menu",       NULL, &EndpointAppPBX::action_dialing_menu, NULL,