diff options
author | fahris <support@tellu.com> | 2007-02-02 10:52:04 +0000 |
---|---|---|
committer | fahris <support@tellu.com> | 2007-02-02 10:52:04 +0000 |
commit | 7d60624b1e3b9651642cd4b7c52b8d2951606ce3 (patch) | |
tree | 756c94267430e472cb6feb935cf006042b0787f4 /pjsip-apps/src/py_pjsua/pjsua_app.py | |
parent | 3838854d1becf6befefe1efb9112f5db5e0c6740 (diff) |
py_pjsuaupdated 020207
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@926 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/py_pjsua/pjsua_app.py')
-rw-r--r-- | pjsip-apps/src/py_pjsua/pjsua_app.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pjsip-apps/src/py_pjsua/pjsua_app.py b/pjsip-apps/src/py_pjsua/pjsua_app.py index 5c8e6ed9..7aa7d3e9 100644 --- a/pjsip-apps/src/py_pjsua/pjsua_app.py +++ b/pjsip-apps/src/py_pjsua/pjsua_app.py @@ -73,6 +73,20 @@ def on_reg_state(acc_id): write_log(3, "Account successfully (un)registered") +def on_buddy_state(buddy_id): + write_log(3, "On Buddy state called") + buddy_info = py_pjsua.buddy_get_info(buddy_id) + if buddy_info.status != 0 and buddy_info.status != 200: + write_log(3, "Status of " + `buddy_info.uri` + " is " + `buddy_info.status_text`) + else: + write_log(3, "Status : " + `buddy_info.status`) + +def on_pager(call_id, strfrom, strto, contact, mime_type, text): + write_log(3, "MESSAGE from " + `strfrom` + " : " + `text`) + +def on_pager_status(call_id, strto, body, user_data, status, reason): + write_log(3, "MESSAGE to " + `strto` + " status " + `status` + " reason " + `reason`) + # Utility: display PJ error and exit # def err_exit(title, rc): @@ -117,6 +131,10 @@ def app_init(): ua_cfg.cb.on_call_media_state = on_call_media_state ua_cfg.cb.on_reg_state = on_reg_state ua_cfg.cb.on_call_state = on_call_state + ua_cfg.cb.on_buddy_state = on_buddy_state + ua_cfg.cb.on_pager = on_pager + ua_cfg.cb.on_pager_status = on_pager_status + # Create and initialize media config med_cfg = py_pjsua.media_config_default() |