improve voicemail

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6399 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-11-26 23:41:00 +00:00
parent 5dfde04160
commit f64d7e43ce
13 changed files with 1323 additions and 89 deletions
+1 -20
View File
@@ -878,25 +878,6 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_fd(int fd)
return &root->xml;
}
static switch_size_t read_line(int fd, char *buf, switch_size_t len)
{
char c, *p;
int cur;
switch_size_t total = 0;
p = buf;
while (total + sizeof(c) < len && (cur = read(fd, &c, sizeof(c))) > 0) {
total += cur;
*p++ = c;
if (c == '\n') {
break;
}
}
*p++ = '\0';
return total;
}
static char *expand_vars(char *buf, char *ebuf, switch_size_t elen, switch_size_t *newlen)
{
char *var, *val;
@@ -999,7 +980,7 @@ static int preprocess(const char *cwd, const char *file, int write_fd, int rleve
return -1;
}
while ((cur = read_line(read_fd, buf, sizeof(buf))) > 0) {
while ((cur = switch_fd_read_line(read_fd, buf, sizeof(buf))) > 0) {
char *arg, *e;
char *bp = expand_vars(buf, ebuf, sizeof(ebuf), &cur);