Esempio n. 1
0
    r = Rtp_proxy_client(gc)
    t = Timeout(waitonline, 0.1, 10, r)
    ED2.loop(2.0)
    assert (r.online)
    t.cancel()

    gc['rtp_proxy_client'] = r
    rs = Rtp_proxy_session(gc, 'call_id1', 'from_tag1', 'to_tag1')
    rs.version(display)
    ED2.loop()

    rs.start_recording('bogus', result_callback=display)
    print(1)
    ED2.loop()
    print(2)
    rs.play_callee('bogus', result_callback=display)
    ED2.loop()
    print(3)
    rs.stop_play_callee(result_callback=display)
    ED2.loop()
    print(4)
    rs.play_caller('bogus', result_callback=display)
    ED2.loop()
    print(5)
    rs.stop_play_caller(result_callback=display)
    ED2.loop()
    print(6)
    del rs
    r.shutdown()
    print(7, 'passed')
Esempio n. 2
0
            continue
        if o == '-i':
            fname = a.strip()
            if fname == '-':
                file_in = sys.stdin
            else:
                file_in = file(fname, 'r')
        if o == '-o':
           fname = a.strip()
           if fname == '-':
               file_out = sys.stdout
           else:
               file_out = file(fname, 'w')
        if o == '-b':
           no_rtpp_version_check = True

    if len(args) > 0:
        commands = args

    if sippy_path != None:
        sys.path.insert(0, sippy_path)

    from sippy.Rtp_proxy_client import Rtp_proxy_client

    rc = Rtp_proxy_client(global_config, spath = spath, no_version_check = no_rtpp_version_check)
    #commands = ('VF 123456', 'G nsess_created', 'G ncmds_rcvd')
    crun = command_runner(rc, commands, file_in, file_out)
    reactor.run(installSignalHandlers = 1)
    rc.shutdown()
    sys.exit(crun.rval)
Esempio n. 3
0
           if fname == '-':
               file_out = sys.stdout
           else:
               file_out = open(fname, 'w')
        elif o == '-b':
           no_rtpp_version_check = True
        elif o == '-n':
           nwrks = int(a)
        elif o == '-t':
           timeout = float(a.strip())

    if len(args) > 0:
        commands = args

    if sippy_path != None:
        sys.path.insert(0, sippy_path)

    from sippy.Rtp_proxy_client import Rtp_proxy_client
    from sippy.Time.Timeout import Timeout
    from sippy.Core.EventDispatcher import ED2

    rc = Rtp_proxy_client(global_config, spath = spath, nworkers = nwrks, \
      no_version_check = no_rtpp_version_check)
    #commands = ('VF 123456', 'G nsess_created', 'G ncmds_rcvd')
    crun = command_runner(rc, commands, file_in, file_out)
    if timeout != None:
        Timeout(crun.timeout, timeout)
    ED2.loop(freq = 100.0)
    rc.shutdown()
    sys.exit(crun.rval)
Esempio n. 4
0
    r = Rtp_proxy_client(gc)
    t = Timeout(waitonline, 0.1, 10, r)
    ED2.loop(2.0)
    assert(r.online)
    t.cancel()

    gc['rtp_proxy_client'] = r
    rs = Rtp_proxy_session(gc, 'call_id1', 'from_tag1', 'to_tag1')
    rs.version(display)
    ED2.loop()

    rs.start_recording('bogus', result_callback = display)
    print(1)
    ED2.loop()
    print(2)
    rs.play_callee('bogus', result_callback = display)
    ED2.loop()
    print(3)
    rs.stop_play_callee(result_callback = display)
    ED2.loop()
    print(4)
    rs.play_caller('bogus', result_callback = display)
    ED2.loop()
    print(5)
    rs.stop_play_caller(result_callback = display)
    ED2.loop()
    print(6)
    del rs
    r.shutdown()
    print(7, 'passed')