diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-10-09 13:17:56 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-10-09 13:17:56 +0000 |
commit | b65d7573e4d0c58580900439a67269e60e71ff10 (patch) | |
tree | 64cb48e409e40b908b735ffd052911dbe9b8527c /pjsip/src/pjsip-simple/rpid.c | |
parent | 4fb4185ce6120e5f344ac82f4d360704e3e422a0 (diff) |
Ticket #966: Bad RPID <person> id attribute generation (thanks Filipe Figueiredo for the report)
- make sure the id starts with letter
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2935 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip-simple/rpid.c')
-rw-r--r-- | pjsip/src/pjsip-simple/rpid.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pjsip/src/pjsip-simple/rpid.c b/pjsip/src/pjsip-simple/rpid.c index 2ad36a9f..df15c6ab 100644 --- a/pjsip/src/pjsip-simple/rpid.c +++ b/pjsip/src/pjsip-simple/rpid.c @@ -21,6 +21,7 @@ #include <pjsip-simple/errno.h> #include <pj/assert.h> #include <pj/guid.h> +#include <pj/pool.h> #include <pj/string.h> @@ -146,7 +147,16 @@ PJ_DEF(pj_status_t) pjrpid_add_element(pjpidf_pres *pres, attr = pj_xml_attr_new(pool, &ID, &elem->id); } else { pj_str_t person_id; - pj_create_unique_string(pool, &person_id); + /* xs:ID must start with letter */ + //pj_create_unique_string(pool, &person_id); + person_id.ptr = (char*)pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH+2); + person_id.ptr += 2; + pj_generate_unique_string(&person_id); + person_id.ptr -= 2; + person_id.ptr[0] = 'p'; + person_id.ptr[1] = 'j'; + person_id.slen += 2; + attr = pj_xml_attr_new(pool, &ID, &person_id); } pj_xml_add_attr(nd_person, attr); |