Ignore:
Timestamp:
Feb 2, 2007 10:52:04 AM (14 years ago)
Author:
fahris
Message:

py_pjsuaupdated 020207

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/py_pjsua/pjsua_app.py

    r916 r926  
    7373                write_log(3, "Account successfully (un)registered") 
    7474 
     75 
     76def on_buddy_state(buddy_id): 
     77        write_log(3, "On Buddy state called") 
     78        buddy_info = py_pjsua.buddy_get_info(buddy_id) 
     79        if buddy_info.status != 0 and buddy_info.status != 200: 
     80                write_log(3, "Status of " + `buddy_info.uri` + " is " + `buddy_info.status_text`) 
     81        else: 
     82                write_log(3, "Status : " + `buddy_info.status`) 
     83                 
     84def on_pager(call_id, strfrom, strto, contact, mime_type, text): 
     85        write_log(3, "MESSAGE from " + `strfrom` + " : " + `text`) 
     86         
     87def on_pager_status(call_id, strto, body, user_data, status, reason): 
     88        write_log(3, "MESSAGE to " + `strto` + " status " + `status` + " reason " + `reason`) 
    7589 
    7690# Utility: display PJ error and exit 
     
    118132        ua_cfg.cb.on_reg_state = on_reg_state 
    119133        ua_cfg.cb.on_call_state = on_call_state 
     134        ua_cfg.cb.on_buddy_state = on_buddy_state 
     135        ua_cfg.cb.on_pager = on_pager 
     136        ua_cfg.cb.on_pager_status = on_pager_status 
     137         
    120138 
    121139        # Create and initialize media config 
Note: See TracChangeset for help on using the changeset viewer.