]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3971 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 4 Sep 2012 17:29:58 +0000 (12:29 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 4 Sep 2012 17:30:23 +0000 (12:30 -0500)
src/mod/endpoints/mod_sofia/mod_sofia.c
src/switch_utils.c

index f7bfc6cb59019f7890845650c4338271552e0e66..a5f8d8d11f6c45f29f5a57f337227752d4c6537f 100644 (file)
@@ -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]));
index d877061e398ec1c04428207b36d90ad7ff52aaec..3961d89089770616b2bc1140f0ba23cd134cbf04 100644 (file)
@@ -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;