-1

私はRubyの初心者で、rubyphoneコードを見つけて、xmlで動作させようとしました。私はxmlを見るためにそれを手に入れました。唯一の部分は、次のエラーです: test.rb:17: undefined local variable or method `tsapi' for main:Object (NameError)

17行目 tsapi.new と tsapi = tsapi.new で試してみました

どんな助けでも素晴らしいでしょう。

require "Win32API"
require "tsapi"
require 'rexml/document'
include REXML
file = File.new("tsapi.xml")
#doc = Document.new(file)
doc = REXML::Document.new('tsapi.xml')
    root=doc.root
    $server = ["section[@name='config']/server"]
    $username = ["section[@name='config']/username"]
    $password = ["section[@name='config']/password"]
    $app = ["section[@name='config']/app"]
    $tracing = ["section[@name='config']/tracing"]


 tsapi.new($extension, $server, $username, $password, $app)
  result == tsapi.open
  if result == true
    #Win32API.new("user32", "MessageBox", ['i','p','p','i'], 'i').call(0, "Calling Voice Mail.", "Calling VMail", 0) if result == true

   result = tsapi.call("12345")
  end
  tsapi.close
4

1 に答える 1