From: Andreas Eversberg Date: Thu, 19 Sep 2013 07:43:11 +0000 (+0200) Subject: Add 'prefix' parameter to 'goto' action X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=commitdiff_plain;h=3fcc26b0ec05e189135938a26f0467275d2f0632 Add 'prefix' parameter to 'goto' action --- diff --git a/action.cpp b/action.cpp index b42e301..5256543 100644 --- a/action.cpp +++ b/action.cpp @@ -1596,6 +1596,14 @@ void EndpointAppPBX::_action_goto_menu(int mode) 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 */ diff --git a/apppbx.cpp b/apppbx.cpp index 98e6e64..e96b54c 100644 --- a/apppbx.cpp +++ b/apppbx.cpp @@ -5007,6 +5007,11 @@ void EndpointAppPBX::logmessage(int message_type, union parameter *param, unsign 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); } diff --git a/remote.cpp b/remote.cpp index cb6e528..f5105b6 100644 --- a/remote.cpp +++ b/remote.cpp @@ -106,6 +106,12 @@ int Premote::message_epoint(unsigned int epoint_id, int message_type, union para case MESSAGE_CONNECT: memcpy(&p_connectinfo, ¶m->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: @@ -211,6 +217,12 @@ void Premote::message_remote(int message_type, union parameter *param) case MESSAGE_CONNECT: memcpy(&p_connectinfo, ¶m->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: diff --git a/route.c b/route.c index 925bfe8..6fa0adb 100644 --- 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, - 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,