Ignore:
Timestamp:
Dec 28, 2006 3:13:48 AM (17 years ago)
Author:
fahris
Message:

py_pjsua.c and pjsua.py updated until lib call

File:
1 edited

Legend:

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

    • Property svn:eol-style deleted
    r851 r869  
    118118bcfg = py_pjsua.Buddy_Config() 
    119119status, id = py_pjsua.buddy_add(bcfg) 
     120acc_id = id 
    120121print "py buddy add status " + `status` + " id " + `id` 
    121122bool = py_pjsua.buddy_is_valid(id) 
     
    124125print "buddy count " + `count` 
    125126binfo = py_pjsua.buddy_get_info(id) 
    126 ids = py_pjsua.enum_buddies(3) 
     127ids = py_pjsua.enum_buddies() 
    127128status = py_pjsua.buddy_del(id) 
    128129print "py buddy del status " + `status` 
     
    138139#end of lib buddy 
    139140 
     141#lib media 
     142count = py_pjsua.conf_get_max_ports() 
     143print "py media conf get max ports " + `count` 
     144count = py_pjsua.conf_get_active_ports() 
     145print "py media conf get active ports " + `count` 
     146ids = py_pjsua.enum_conf_ports() 
     147for id in ids: 
     148        print "py media conf ports " + `id` 
     149        cp_info = py_pjsua.conf_get_port_info(id) 
     150        print "port info name " + cp_info.name 
     151pool = py_pjsua.PJ_Pool() 
     152port = py_pjsua.PJMedia_Port() 
     153status, id = py_pjsua.conf_add_port(pool,port) 
     154print "py media conf add port status " + `status` + " id " + `id` 
     155if status != 0 : 
     156        py_pjsua.perror("py_pjsua","add port",status) 
     157status = py_pjsua.conf_remove_port(id) 
     158print "py media conf remove port status " + `status` 
     159if status != 0 : 
     160        py_pjsua.perror("py_pjsua","remove port",status) 
     161status = py_pjsua.conf_connect(id, id) 
     162print "py media conf connect status " + `status` 
     163if status != 0 : 
     164        py_pjsua.perror("py_pjsua","connect",status) 
     165status = py_pjsua.conf_disconnect(id, id) 
     166print "py media conf disconnect status " + `status` 
     167if status != 0 : 
     168        py_pjsua.perror("py_pjsua","disconnect",status) 
     169status, id = py_pjsua.player_create("test.wav", 0) 
     170print "py media player create status " + `status` + " id " + `id` 
     171if status != 0 : 
     172        py_pjsua.perror("py_pjsua","player create",status) 
     173c_id = py_pjsua.player_get_conf_port(id) 
     174print "py media player get conf port id " + `c_id` 
     175status = py_pjsua.player_set_pos(id, 10) 
     176if status != 0 : 
     177        py_pjsua.perror("py_pjsua","player set pos",status) 
     178status = py_pjsua.player_destroy(id) 
     179if status != 0 : 
     180        py_pjsua.perror("py_pjsua","player destroy",status) 
     181status, id = py_pjsua.recorder_create("rec.wav", 0, "None", 1000, 0) 
     182print "py media recorder create status " + `status` + " id " + `id` 
     183if status != 0 : 
     184        py_pjsua.perror("py_pjsua","recorder create",status) 
     185status = py_pjsua.recorder_get_conf_port(id) 
     186print "py media recorder get conf port status " + `status` 
     187if status != 0 : 
     188        py_pjsua.perror("py_pjsua","recorder get conf port",status) 
     189status = py_pjsua.recorder_destroy(id) 
     190print "py media recorder destroy status " + `status` 
     191if status != 0 : 
     192        py_pjsua.perror("py_pjsua","recorder destroy",status) 
     193#cdev, pdev = py_pjsua.get_snd_dev() 
     194#print "py media get snd dev capture dev " + `cdev` + " playback dev " + `pdev` 
     195status = py_pjsua.set_snd_dev(0,1) 
     196print "py media set snd dev status " + `status` 
     197if status != 0 : 
     198        py_pjsua.perror("py_pjsua","set snd dev",status) 
     199status = py_pjsua.set_null_snd_dev() 
     200print "py media set null snd dev status " + `status` 
     201if status != 0 : 
     202        py_pjsua.perror("py_pjsua","set null snd dev",status) 
     203port = py_pjsua.set_no_snd_dev() 
     204status = py_pjsua.set_ec(0,0) 
     205print "py media set ec status " + `status` 
     206if status != 0 : 
     207        py_pjsua.perror("py_pjsua","set ec",status) 
     208tail = py_pjsua.get_ec_tail() 
     209print "py media get ec tail " + `tail` 
     210infos = py_pjsua.enum_codecs() 
     211for info in infos: 
     212        print "py media enum codecs " + `info` 
     213status = py_pjsua.codec_set_priority("coba", 0) 
     214print "py media codec set priority " + `status` 
     215if status != 0 : 
     216        py_pjsua.perror("py_pjsua","codec set priority",status) 
     217c_param = py_pjsua.codec_get_param("coba") 
     218status = py_pjsua.codec_set_param("coba", c_param) 
     219print "py media codec set param " + `status` 
     220if status != 0 : 
     221        py_pjsua.perror("py_pjsua","codec set param",status) 
     222         
     223#end of lib media 
     224 
     225#lib call 
     226 
     227count = py_pjsua.call_get_max_count() 
     228print "py call get max count " + `count` 
     229count = py_pjsua.call_get_count() 
     230print "py call get count " + `count` 
     231ids = py_pjsua.enum_calls() 
     232for id in ids: 
     233        print "py enum calls id " + `id` 
     234msg_data = py_pjsua.Msg_Data() 
     235status, id = py_pjsua.call_make_call(-1, "sip:bulukucing1@iptel.org", 0, 0, msg_data) 
     236print "py call make call " + `status` + " id " + `id` 
     237if status != 0 : 
     238        py_pjsua.perror("py_pjsua","call make call",status) 
     239bool = py_pjsua.call_is_active(id) 
     240print "py call is active " + `bool` 
     241bool = py_pjsua.call_has_media(id) 
     242print "py call has media " + `bool` 
     243cp_id = py_pjsua.call_get_conf_port(id) 
     244print "py call get conf port " + `cp_id` 
     245info = py_pjsua.call_get_info(id) 
     246if info != None : 
     247        print "py info id " + `info.id` 
     248status = py_pjsua.call_set_user_data(id, 0) 
     249print "py call set user data status " + `status` 
     250if status != 0 : 
     251        py_pjsua.perror("py_pjsua","set user data",status) 
     252user_data = py_pjsua.call_get_user_data(id) 
     253print "py call get user data " + `user_data` 
     254 
     255 
     256 
     257#end of lib call 
     258 
    140259py_pjsua.perror("saya","hallo",70006) 
    141260 
Note: See TracChangeset for help on using the changeset viewer.