Ignore:
Timestamp:
Sep 17, 2007 3:44:47 PM (15 years ago)
Author:
bennylp
Message:

Updated pjsua_app.py Python sample application to the new changes in Python module (thanks Gideon Klompje)

File:
1 edited

Legend:

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

    r1430 r1438  
    2020# Set C_STUN_HOST to the address:port of the STUN server to enable STUN 
    2121# 
    22 #C_STUN_HOST = "" 
    23 C_STUN_HOST = "192.168.0.2" 
     22C_STUN_HOST = "" 
     23#C_STUN_HOST = "192.168.0.2" 
    2424#C_STUN_HOST = "stun.iptel.org:3478" 
    2525 
     
    268268        acc_cfg.id = "sip:" + acc_username + "@" + acc_domain 
    269269        acc_cfg.reg_uri = "sip:" + acc_domain 
    270         acc_cfg.cred_count = 1 
    271         acc_cfg.cred_info[0].realm = acc_domain 
    272         acc_cfg.cred_info[0].scheme = "digest" 
    273         acc_cfg.cred_info[0].username = acc_username 
    274         acc_cfg.cred_info[0].data_type = 0 
    275         acc_cfg.cred_info[0].data = acc_passwd 
     270 
     271        cred_info = py_pjsua.Pjsip_Cred_Info() 
     272        cred_info.realm = "*" 
     273        cred_info.scheme = "digest" 
     274        cred_info.username = acc_username 
     275        cred_info.data_type = 0 
     276        cred_info.data = acc_passwd 
     277 
     278        acc_cfg.cred_info.append(1) 
     279        acc_cfg.cred_info[0] = cred_info 
    276280 
    277281        # Add new SIP account 
     
    339343                info = py_pjsua.conf_get_port_info(port) 
    340344                txlist = "" 
    341                 for i in range(info.listener_cnt): 
    342                         txlist = txlist + "#" + `info.listeners[i]` + " " 
     345                for listener in info.listeners: 
     346                        txlist = txlist + "#" + `listener` + " " 
    343347                 
    344348                print "Port #" + `info.slot_id` + "[" + `(info.clock_rate/1000)` + "KHz/" + `(info.samples_per_frame * 1000 / info.clock_rate)` + "ms] " + info.name + " transmitting to: " + txlist 
Note: See TracChangeset for help on using the changeset viewer.