diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/app.c | 40 | ||||
-rw-r--r-- | main/channel.c | 2 | ||||
-rw-r--r-- | main/loader.c | 4 | ||||
-rw-r--r-- | main/rtp.c | 6 |
4 files changed, 46 insertions, 6 deletions
diff --git a/main/app.c b/main/app.c index 52536abc5..f46cb9b9a 100644 --- a/main/app.c +++ b/main/app.c @@ -1457,3 +1457,43 @@ int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags return res; } +/* the following function will probably only be used in app_dial, until app_dial is reorganized to + better handle the large number of options it provides. After it is, you need to get rid of this variant + -- unless, of course, someone else digs up some use for large flag fields. */ + +int ast_app_parse_options64(const struct ast_app_option *options, struct ast_flags64 *flags, char **args, char *optstr) +{ + char *s, *arg; + int curarg, res = 0; + unsigned int argloc; + + flags->flags = 0; + + if (!optstr) + return 0; + + s = optstr; + while (*s) { + curarg = *s++ & 0x7f; /* the array (in app.h) has 128 entries */ + ast_set_flag64(flags, options[curarg].flag); + argloc = options[curarg].arg_index; + if (*s == '(') { + /* Has argument */ + arg = ++s; + if ((s = strchr(s, ')'))) { + if (argloc) + args[argloc - 1] = arg; + *s++ = '\0'; + } else { + ast_log(LOG_WARNING, "Missing closing parenthesis for argument '%c' in string '%s'\n", curarg, arg); + res = -1; + break; + } + } else if (argloc) { + args[argloc - 1] = NULL; + } + } + + return res; +} + diff --git a/main/channel.c b/main/channel.c index 4acfe9fb3..105dc030e 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2454,7 +2454,7 @@ done: int ast_internal_timing_enabled(struct ast_channel *chan) { int ret = ast_opt_internal_timing && chan->timingfd > -1; - ast_debug(5, "Internal timing is %s (option_internal_timing=%lld chan->timingfd=%d)\n", ret? "enabled": "disabled", (unsigned long long)ast_opt_internal_timing, chan->timingfd); + ast_debug(5, "Internal timing is %s (option_internal_timing=%d chan->timingfd=%d)\n", ret? "enabled": "disabled", ast_opt_internal_timing, chan->timingfd); return ret; } diff --git a/main/loader.c b/main/loader.c index 1100a460f..2e6457285 100644 --- a/main/loader.c +++ b/main/loader.c @@ -86,8 +86,8 @@ struct ast_module { int usecount; /* the number of 'users' currently in this module */ struct module_user_list users; /* the list of users in the module */ struct { - uint64_t running:1; - uint64_t declined:1; + unsigned int running:1; + unsigned int declined:1; } flags; AST_LIST_ENTRY(ast_module) entry; char resource[0]; diff --git a/main/rtp.c b/main/rtp.c index 403e5ea0a..8aa86a613 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -152,7 +152,7 @@ struct ast_rtp { int send_payload; int send_duration; int nat; - uint64_t flags; + unsigned int flags; struct sockaddr_in us; /*!< Socket representation of the local endpoint. */ struct sockaddr_in them; /*!< Socket representation of the remote endpoint. */ struct timeval rxcore; @@ -845,7 +845,7 @@ static struct ast_frame *process_cisco_dtmf(struct ast_rtp *rtp, unsigned char * char resp = 0; struct ast_frame *f = NULL; unsigned char seq; - uint64_t flags; + unsigned int flags; unsigned int power; /* We should have at least 4 bytes in RTP data */ @@ -888,7 +888,7 @@ static struct ast_frame *process_cisco_dtmf(struct ast_rtp *rtp, unsigned char * event = data[3] & 0x1f; if (option_debug > 2 || rtpdebug) - ast_debug(0, "Cisco DTMF Digit: %02x (len=%d, seq=%d, flags=%02llx, power=%d, history count=%d)\n", event, len, seq, (unsigned long long)flags, power, (len - 4) / 2); + ast_debug(0, "Cisco DTMF Digit: %02x (len=%d, seq=%d, flags=%02x, power=%d, history count=%d)\n", event, len, seq, flags, power, (len - 4) / 2); if (event < 10) { resp = '0' + event; } else if (event < 11) { |