diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-06-30 13:53:47 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-06-30 13:53:47 +0000 |
commit | aa4f1f0840c92cc5af96be965099a6b7b1b1448b (patch) | |
tree | bb738899802e05d50612fa50d31e801a0bf829cf /pjsip | |
parent | 83f39ed8fcc0af2dce6898d3c5a2c1d0b46c0613 (diff) |
Related to #911:
- added subscription state name string in pjsua_buddy_info and display this in pjsua
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2824 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua.h | 5 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_pres.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index 8744e9a8..1ea6f9e4 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -2896,6 +2896,11 @@ typedef struct pjsua_buddy_info pjsip_evsub_state sub_state; /** + * String representation of subscription state. + */ + const char *sub_state_name; + + /** * Specifies the last presence subscription terminatino reason. If * presence subscription is currently active, the value will be empty. */ diff --git a/pjsip/src/pjsua-lib/pjsua_pres.c b/pjsip/src/pjsua-lib/pjsua_pres.c index 797fb84c..b9c11ae4 100644 --- a/pjsip/src/pjsua-lib/pjsua_pres.c +++ b/pjsip/src/pjsua-lib/pjsua_pres.c @@ -195,6 +195,7 @@ PJ_DEF(pj_status_t) pjsua_buddy_get_info( pjsua_buddy_id buddy_id, /* subscription state and termination reason */ if (buddy->sub) { info->sub_state = pjsip_evsub_get_state(buddy->sub); + info->sub_state_name = pjsip_evsub_get_state_name(buddy->sub); if (info->sub_state == PJSIP_EVSUB_STATE_TERMINATED && total < sizeof(info->buf_)) { @@ -207,11 +208,13 @@ PJ_DEF(pj_status_t) pjsua_buddy_get_info( pjsua_buddy_id buddy_id, info->sub_term_reason = pj_str(""); } } else if (total < sizeof(info->buf_)) { + info->sub_state_name = "NULL"; info->sub_term_reason.ptr = info->buf_ + total; pj_strncpy(&info->sub_term_reason, &buddy->term_reason, sizeof(info->buf_) - total); total += info->sub_term_reason.slen; } else { + info->sub_state_name = "NULL"; info->sub_term_reason = pj_str(""); } |