summaryrefslogtreecommitdiff
path: root/main/app.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2010-07-08 22:08:07 +0000
committerMark Michelson <mmichelson@digium.com>2010-07-08 22:08:07 +0000
commitcd4ebd336f6fdd1fe5d2ad57f06654a9678d88d4 (patch)
treec05335b563c3f7cb9a3edbf3e101d8e1b80e0be4 /main/app.c
parent816f26c16ce6cf03cf97b7d0e7af64837283e79d (diff)
Add IPv6 to Asterisk.
This adds a generic API for accommodating IPv6 and IPv4 addresses within Asterisk. While many files have been updated to make use of the API, chan_sip and the RTP code are the files which actually support IPv6 addresses at the time of this commit. The way has been paved for easier upgrading for other files in the near future, though. Big thanks go to Simon Perrault, Marc Blanchet, and Jean-Philippe Dionne for their hard work on this. (closes issue #17565) Reported by: russell Patches: asteriskv6-test-report.pdf uploaded by russell (license 2) Review: https://reviewboard.asterisk.org/r/743 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/app.c')
-rw-r--r--main/app.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/main/app.c b/main/app.c
index a171f2611..050c4e238 100644
--- a/main/app.c
+++ b/main/app.c
@@ -1190,7 +1190,7 @@ unsigned int __ast_app_separate_args(char *buf, char delim, int remove_chars, ch
{
int argc;
char *scan, *wasdelim = NULL;
- int paren = 0, quote = 0;
+ int paren = 0, quote = 0, bracket = 0;
if (!array || !arraylen) {
return 0;
@@ -1213,6 +1213,12 @@ unsigned int __ast_app_separate_args(char *buf, char delim, int remove_chars, ch
if (paren) {
paren--;
}
+ } else if (*scan == '[') {
+ bracket++;
+ } else if (*scan == ']') {
+ if (bracket) {
+ bracket--;
+ }
} else if (*scan == '"' && delim != '"') {
quote = quote ? 0 : 1;
if (remove_chars) {
@@ -1227,7 +1233,7 @@ unsigned int __ast_app_separate_args(char *buf, char delim, int remove_chars, ch
} else {
scan++;
}
- } else if ((*scan == delim) && !paren && !quote) {
+ } else if ((*scan == delim) && !paren && !quote && !bracket) {
wasdelim = scan;
*scan++ = '\0';
break;