summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsip-simple/xpidf.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-02-19 15:37:19 +0000
committerBenny Prijono <bennylp@teluu.com>2006-02-19 15:37:19 +0000
commit51f0bc5a46378786d98caf84df2cf31bb169e45b (patch)
treee17a65e4ebdf98d4f46857f51d26afe7f1fb2aa7 /pjsip/src/pjsip-simple/xpidf.c
parentc1fa8a21eda0357a8c25a63b634615f6785e4d48 (diff)
SIMPLE test with FWD, and added more info in UI
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@201 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip-simple/xpidf.c')
-rw-r--r--pjsip/src/pjsip-simple/xpidf.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/pjsip/src/pjsip-simple/xpidf.c b/pjsip/src/pjsip-simple/xpidf.c
index 12024827..1bd719c4 100644
--- a/pjsip/src/pjsip-simple/xpidf.c
+++ b/pjsip/src/pjsip-simple/xpidf.c
@@ -29,6 +29,7 @@ static pj_str_t CLOSED = { "closed", 6 };
static pj_str_t URI = { "uri", 3 };
static pj_str_t ATOM = { "atom", 4 };
static pj_str_t ATOMID = { "atomid", 6 };
+static pj_str_t ID = { "id", 2 };
static pj_str_t ADDRESS = { "address", 7 };
static pj_str_t SUBSCRIBE_PARAM = { ";method=SUBSCRIBE", 17 };
static pj_str_t PRESENTITY = { "presentity", 10 };
@@ -126,20 +127,23 @@ PJ_DEF(pjxpidf_pres*) pjxpidf_parse(pj_pool_t *pool, char *text, pj_size_t len)
/* Validate <presence> */
if (pj_stricmp(&pres->name, &PRESENCE) != 0)
return NULL;
- if (pj_xml_find_attr(pres, &URI, NULL) == NULL)
- return NULL;
/* Validate <presentity> */
node = pj_xml_find_node(pres, &PRESENTITY);
if (node == NULL)
return NULL;
+ if (pj_xml_find_attr(node, &URI, NULL) == NULL)
+ return NULL;
/* Validate <atom> */
node = pj_xml_find_node(pres, &ATOM);
if (node == NULL)
return NULL;
- if (pj_xml_find_attr(node, &ATOMID, NULL) == NULL)
+ if (pj_xml_find_attr(node, &ATOMID, NULL) == NULL &&
+ pj_xml_find_attr(node, &ID, NULL) == NULL)
+ {
return NULL;
+ }
/* Address */
node = pj_xml_find_node(node, &ADDRESS);
@@ -246,7 +250,7 @@ PJ_DEF(pj_bool_t) pjxpidf_get_status(pjxpidf_pres *pres)
pj_assert(0);
return PJ_FALSE;
}
- status = pj_xml_find_node(atom, &STATUS);
+ status = pj_xml_find_node(addr, &STATUS);
if (!status) {
pj_assert(0);
return PJ_FALSE;
@@ -257,7 +261,7 @@ PJ_DEF(pj_bool_t) pjxpidf_get_status(pjxpidf_pres *pres)
return PJ_FALSE;
}
- return pj_stricmp(&attr->value, &OPEN) ? PJ_TRUE : PJ_FALSE;
+ return pj_stricmp(&attr->value, &OPEN)==0 ? PJ_TRUE : PJ_FALSE;
}