X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=route.c;h=e322774864d444fc8d5c8ab60784e0f0a5320182;hp=a7b141644576d6899b310cd33341710b59325a35;hb=258c2e57a441f1fd8ed779bb2d88992aba3c1e65;hpb=41f2c3714bf540be0b0f3228e6d52cbadf39ef2f diff --git a/route.c b/route.c index a7b1416..e322774 100644 --- a/route.c +++ b/route.c @@ -9,10 +9,6 @@ ** ** \*****************************************************************************/ -#include -#include -#include -#include #include "main.h" @@ -123,7 +119,7 @@ struct param_defs param_defs[] = { "capability=speech|audio|video|digital-restricted|digital-unrestricted|digital-unrestricted-tones", "Alter the service type of the call."}, { PARAM_BMODE, "bmode", PARAM_TYPE_BMODE, - "capability=transparent|hdlc", "Alter the bchannel mode of the call. Use hdlc for data calls."}, + "bmode=transparent|hdlc", "Alter the bchannel mode of the call. Use hdlc for data calls."}, { PARAM_INFO1, "infolayer1", PARAM_TYPE_INTEGER, "infolayer1=", "Alter the layer 1 information of a call. Use 3 for ALAW or 2 for uLAW."}, @@ -220,6 +216,9 @@ struct param_defs param_defs[] = { { PARAM_ROOM, "room", PARAM_TYPE_INTEGER, "room=", "Conference room number, must be greater 0, as in real life."}, + { PARAM_JINGLE, + "jingle", PARAM_TYPE_NULL, + "jingle", "Conference members will hear a jingle if a member joins."}, { PARAM_TIMEOUT, "timeout", PARAM_TYPE_INTEGER, "timeout=", "Timeout before continue with next action."}, @@ -231,7 +230,7 @@ struct param_defs param_defs[] = { "strip", "Remove digits that were required to match this rule."}, { PARAM_APPLICATION, "application",PARAM_TYPE_STRING, - "application", "Name of remote application to make call to."}, + "application=", "Name of remote application to make call to."}, { 0, NULL, 0, NULL, NULL} }; @@ -258,7 +257,7 @@ struct action_defs action_defs[] = { "Caller is routed to the voice box of given extension."}, { ACTION_PARTYLINE, "partyline",&EndpointAppPBX::action_init_partyline, NULL, &EndpointAppPBX::action_hangup_call, - PARAM_ROOM, + PARAM_ROOM | PARAM_JINGLE, "Caller is participating the conference with the given room number."}, { ACTION_LOGIN, "login", NULL, &EndpointAppPBX::action_dialing_login, NULL, @@ -283,7 +282,7 @@ struct action_defs action_defs[] = { { ACTION_REPLY, "reply", &EndpointAppPBX::action_init_redial_reply, &EndpointAppPBX::action_dialing_reply, NULL, PARAM_CONNECT | PARAM_SELECT, - "Caller replies. (last incomming call(s))"}, + "Caller replies. (last incoming call(s))"}, { ACTION_POWERDIAL, "powerdial", NULL, &EndpointAppPBX::action_dialing_powerdial, NULL, PARAM_CONNECT | PARAM_DELAY | PARAM_LIMIT | PARAM_TIMEOUT, @@ -329,11 +328,6 @@ struct action_defs action_defs[] = { "disconnect", NULL, &EndpointAppPBX::action_dialing_disconnect, NULL, PARAM_CONNECT | PARAM_CAUSE | PARAM_LOCATION | PARAM_SAMPLE | PARAM_DISPLAY, "Caller gets disconnected optionally with given cause and given sample and given display text."}, - { ACTION_HELP, - "help", NULL, &EndpointAppPBX::action_dialing_help, NULL, - PARAM_CONNECT | PARAM_TIMEOUT, - NULL}, -// "Caller will be able to select from current rules that would match. (using * and #)"}, { ACTION_DEFLECT, "deflect", NULL, &EndpointAppPBX::action_dialing_deflect, NULL, PARAM_DEST, @@ -848,6 +842,7 @@ struct route_ruleset *ruleset_parse(void) struct route_param *param; struct route_param **param_pointer = NULL; char failure[256]; + unsigned long long allowed_params; /* check the integrity of IDs for ACTION_* and PARAM_* */ i = 0; @@ -1461,6 +1456,7 @@ struct route_ruleset *ruleset_parse(void) SPRINT(failure, "Unknown action name '%s'.", key); goto parse_error; } + allowed_params = action_defs[index].params; /* alloc memory for action */ action = (struct route_action *)MALLOC(sizeof(struct route_action)); @@ -1510,6 +1506,13 @@ struct route_ruleset *ruleset_parse(void) goto parse_error; } + /* check if item is allowed for the action */ + if (!(param_defs[index].id & allowed_params)) + { + SPRINT(failure, "Param name '%s' exists, but not for this action.", key); + goto parse_error; + } + /* params without values must not have any parameter */ if (param_defs[index].type == PARAM_TYPE_NULL) {