FS-3971 --resolve
This commit is contained in:
parent
ff3631b474
commit
455b22480c
|
@ -2898,7 +2898,7 @@ static int show_reg_callback_xml(void *pArg, int argc, char **argv, char **colum
|
|||
cb->stream->write_function(cb->stream, " <call-id>%s</call-id>\n", switch_str_nil(argv[0]));
|
||||
cb->stream->write_function(cb->stream, " <user>%s@%s</user>\n", switch_str_nil(argv[1]), switch_str_nil(argv[2]));
|
||||
cb->stream->write_function(cb->stream, " <contact>%s</contact>\n", switch_amp_encode(switch_str_nil(argv[3]), xmlbuf, buflen));
|
||||
cb->stream->write_function(cb->stream, " <agent>%s</agent>\n", switch_str_nil(argv[7]));
|
||||
cb->stream->write_function(cb->stream, " <agent>%s</agent>\n", switch_amp_encode(switch_str_nil(argv[7]), xmlbuf, buflen));
|
||||
cb->stream->write_function(cb->stream, " <status>%s(%s) exp(%s) expsecs(%d)</status>\n", switch_str_nil(argv[4]), switch_str_nil(argv[5]),
|
||||
exp_buf, exp_secs);
|
||||
cb->stream->write_function(cb->stream, " <host>%s</host>\n", switch_str_nil(argv[11]));
|
||||
|
|
|
@ -463,6 +463,42 @@ SWITCH_DECLARE(char *) switch_amp_encode(char *s, char *buf, switch_size_t len)
|
|||
|
||||
for (p = s; x < len; p++) {
|
||||
switch (*p) {
|
||||
|
||||
case '"':
|
||||
if (x + 6 > len - 1) {
|
||||
goto end;
|
||||
}
|
||||
*q++ = '&';
|
||||
*q++ = 'q';
|
||||
*q++ = 'u';
|
||||
*q++ = 'o';
|
||||
*q++ = 't';
|
||||
*q++ = ';';
|
||||
x += 6;
|
||||
break;
|
||||
case '\'':
|
||||
if (x + 6 > len - 1) {
|
||||
goto end;
|
||||
}
|
||||
*q++ = '&';
|
||||
*q++ = 'a';
|
||||
*q++ = 'p';
|
||||
*q++ = 'o';
|
||||
*q++ = 's';
|
||||
*q++ = ';';
|
||||
x += 6;
|
||||
break;
|
||||
case '&':
|
||||
if (x + 5 > len - 1) {
|
||||
goto end;
|
||||
}
|
||||
*q++ = '&';
|
||||
*q++ = 'a';
|
||||
*q++ = 'm';
|
||||
*q++ = 'p';
|
||||
*q++ = ';';
|
||||
x += 5;
|
||||
break;
|
||||
case '<':
|
||||
if (x + 4 > len - 1) {
|
||||
goto end;
|
||||
|
|
Loading…
Reference in New Issue