Menu
  • HOME
  • TAGS

using ruby and sinatra, and the Phony gem how can I find the alpha2 code from a phone number?

ruby,sinatra,plivo

With a little testing, it looks like the national_prefix value (in the countries gem) of Hong Kong is "None". You may want to use Country#find_country_by_country_code like so: Country.find_country_by_country_code('852') and that will return Hong Kong, which you can then call #alpha2 on. On a side note, you may want to check...

Plivo get calls info issue

plivo

The issue was on the Plivo side. Support helped to find a solution

RestSharp Serialize/Deserialize Naming Conversion

c#,json,serialization,restsharp,plivo

Unfortunately it looks as though JSON property renaming is not implemented out of the box in RestSharp. You have a couple of options: Download Restsharp from https://github.com/restsharp/RestSharp and rebuild it yourself enabling the compiler option SIMPLE_JSON_DATACONTRACT. Then you will be able to rename properties using data contract attributes. For more,...

Services (such as Twilo, Plivo, Nexmo) to verify phone numbers in Rails app

ruby-on-rails-4,twilio,plivo,nexmo

Your title lists three main SMS APIs, so for services available you already have a good understanding. But there are also APIs that focus exclusively on 2FA / Verification. Here is a list of some, worth noting that it tends to be focused on the user side of the equation...

Using a module's methods inside a class

ruby-on-rails,api,module,plivo

You should be able to access RestAPI class after including Plivo module. Make sure you have installed plivo gem correctly. Here is more rubyish version of your code: class PlivoNumber < ActiveRecord::Base include Plivo def delete_number api.unrent_number('number' => number) end private def api @api ||= RestAPI.new(ENV['PLIVO_AUTH_ID'], ENV['PLIVO_AUTH_TOKEN']) end end Also...

Threaded group SMS conversations

sms,twilio,plivo,nexmo

SMS is stateless, and there's no way to tie two messages to each other (as a thread) other than match meta data (the pairing of a to / from). For what you're trying to do, you'll need multiple virtual numbers, as this is limitation of SMS itself....

How to create a conference call in Plivo with Java?

java,plivo

Call to restAPI.makeCall shuts down connection manager and restAPI instance becomes unusable. To fix your error create brand new instance of RestAPI before each call.

using jquery getJSON, how can I access a json array to select one element?

jquery,getjson,plivo

Just do: this.numbers.number or this["numbers"].number instead of what you are doing...

Plivo call transfers

sip,voip,plivo

Transfer works in potentially two different ways: 1) End-point based In this mode: A transfer B to C by requesting (REFER) B to establish a new call to C. If Plivo is B, it needs to support REFER for this to work. A B C <=conversation=> ----REFER------> <-202 Accepted-- ----INVITE----->...

how to call a class function of an included php file Laravel 4

object,laravel-4,plivo

As your class is not namespaced - try and call it like this: $auth_id = "Your AUTH_ID"; $auth_token = "Your AUTH_TOKEN"; $p = new \RestAPI($auth_id, $auth_token); Notice the \ before RestAPI...