Search code examples
ruby-on-railsapiivrplivo

Plivo IVR with Rails integration


I am using the Plivo IVR. I have created a class with a method that looks like this (as in Plivo example)

def get_phone_ivr
r = Response.new()

getdigits_action_url = "https://example.com/api/v1/post_phone_ivr"
begin
params = {
    'action' => getdigits_action_url,
    'method' => 'POST',
    'timeout' => '7',
    'numDigits' => '1',
    'retries' => '1'
}
getDigits = r.GetDigits(params)

r.addSpeak($IVR_MESSAGE1)
r.addSpeak($NO_INPUT_MESSAGE)

puts r.to_xml()
content_type 'text/xml'
return r.to_s()
end

When I am testing the method via a call I got the status USER_BUSY, and the call finish. The IVR is not answering. I tried several examples but no success.

Any idea?


Solution

  • Plivo Sales Engineer here.

    Couple of things to check:

    1. Is your Ruby application returning a valid XML?
    2. Are you using the correct HTTP method (GET or POST) to invoke the answer URL?
    3. Have you attached this application to a Plivo Number?

    If the issue persists, do raise a support ticket by writing to [email protected].