diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-07-08 22:08:07 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-07-08 22:08:07 +0000 |
commit | c3c2e5edfd715b3a99aac1567623a0b1b7d49de0 (patch) | |
tree | c05335b563c3f7cb9a3edbf3e101d8e1b80e0be4 /main/app.c | |
parent | af344f1a5be5b43f1d10b95ea6e57ebfa761cf50 (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: http://svn.digium.com/svn/asterisk/trunk@274783 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/app.c')
-rw-r--r-- | main/app.c | 10 |
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; |