diff --git a/apps/app_originate.c b/apps/app_originate.c index f924921..ba0fe12 100644 --- a/apps/app_originate.c +++ b/apps/app_originate.c @@ -70,6 +70,12 @@ static const char app_originate[] = "Originate"; If the type is exten, then this is the priority that the channel is sent to. If the type is app, then this parameter is ignored. + + Caller*ID number for the outgoing call. + + + Caller*ID name for the outgoing call. + Timeout in seconds. Default is 30 seconds. @@ -104,6 +110,8 @@ static int originate_exec(struct ast_channel *chan, const char *data) AST_APP_ARG(arg1); AST_APP_ARG(arg2); AST_APP_ARG(arg3); + AST_APP_ARG(cid_num); + AST_APP_ARG(cid_name); AST_APP_ARG(timeout); ); char *parse; @@ -162,7 +170,7 @@ static int originate_exec(struct ast_channel *chan, const char *data) int priority = 1; /* Initialized in case priority not specified */ const char *exten = args.arg2; - if (args.argc == 5) { + if (args.argc == 7) { /* Context/Exten/Priority all specified */ if (sscanf(args.arg3, "%30d", &priority) != 1) { ast_log(LOG_ERROR, "Invalid priority: '%s'\n", args.arg3); @@ -177,15 +185,15 @@ static int originate_exec(struct ast_channel *chan, const char *data) chantech, chandata, args.arg1, exten, priority); ast_pbx_outgoing_exten(chantech, cap_slin, chandata, - timeout * 1000, args.arg1, exten, priority, &outgoing_status, 0, NULL, - NULL, NULL, NULL, NULL, 0); + timeout * 1000, args.arg1, exten, priority, &outgoing_status, 0, args.cid_num, + args.cid_name, NULL, NULL, NULL, 0); } else if (!strcasecmp(args.type, "app")) { ast_debug(1, "Originating call to '%s/%s' and connecting them to %s(%s)\n", chantech, chandata, args.arg1, S_OR(args.arg2, "")); ast_pbx_outgoing_app(chantech, cap_slin, chandata, - timeout * 1000, args.arg1, args.arg2, &outgoing_status, 0, NULL, - NULL, NULL, NULL, NULL); + timeout * 1000, args.arg1, args.arg2, &outgoing_status, 0, args.cid_num, + args.cid_name, NULL, NULL, NULL); } else { ast_log(LOG_ERROR, "Incorrect type, it should be 'exten' or 'app': %s\n", args.type);