com.hoiio.sdk.services
Class VoiceService

java.lang.Object
  extended by com.hoiio.sdk.services.HttpService
      extended by com.hoiio.sdk.services.VoiceService

public class VoiceService
extends HttpService

The Voice API provides developers access to telephony services in more than 200 countries around the world. You will be able to initiate phone calls to any mobile phones, land lines or create call conferences just by making an API request to our servers.

For more info please refer to: http://developer.hoiio.com/docs/voice.html


Constructor Summary
VoiceService(String appId, String accessToken)
          Constructs the service to make all Voice requests
 
Method Summary
 Conference createConference(List<String> dests)
          Dials out to a list of destination numbers and place them together in a conference call.
 Conference createConference(List<String> dests, String room, String callerId, String tag, String notifyUrl)
          Dials out to a list of destination numbers and place them together in a conference call.
 Conference createConference(String dest)
          Dials out to a list of destination numbers and place them together in a conference call.
 Conference createConference(String dest, String room, String callerId, String tag, String notifyUrl)
          Dials out to a list of destination numbers and place them together in a conference call.
 Call fetchCall(String txnRef)
          Fetches the current status of a call made previously
 CallHistory fetchHistory()
          Retrieves the history of calls made by this application.
 CallHistory fetchHistory(Date from, Date to, Integer page)
          Retrieves the history of calls made by this application.
 CallRate fetchRate(String dest1, String dest2)
          Retrieves the billable rate that will be charged for calls made
 CallHangUp hangup(String txnRef)
          Hangs up a call that is currently in progress
 CallTxn makeCall(String dest2)
          Dials out to 2 destination numbers and connect them together in a phone conversation.
 CallTxn makeCall(String dest1, String dest2, String callerId, String tag, String notifyUrl)
          Dials out to 2 destination numbers and connect them together in a phone conversation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VoiceService

public VoiceService(String appId,
                    String accessToken)
Constructs the service to make all Voice requests

Parameters:
appId - AppID of the developer
accessToken - AccessToken of the developer
Method Detail

createConference

public Conference createConference(List<String> dests)
                            throws HoiioException
Dials out to a list of destination numbers and place them together in a conference call.

Parameters:
dests - List of destination numbers in E.164 format (start with a "+" and country code) to be called and placed in the conference room. A maximum of 8 numbers are allowed.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

createConference

public Conference createConference(List<String> dests,
                                   String room,
                                   String callerId,
                                   String tag,
                                   String notifyUrl)
                            throws HoiioException
Dials out to a list of destination numbers and place them together in a conference call.

Parameters:
dests - List of destination numbers in E.164 format (start with a "+" and country code) to be called and placed in the conference room. A maximum of 8 numbers are allowed.
room - (optional) A text string representing the conference room ID. Valid characters are a-z, A-Z, 0-9, period (.) and underscore (_) characters. Max 32 characters.
callerId - (optional) This is the Caller ID that each destination number will see on their incoming call.
tag - (optional) This is a text string containing your own reference ID for this transaction. This value will be included in the response for Notification, FetchVoice and FetchHistory for your reference. Max 256 characters.
notifyUrl - (optional) A fully-qualified HTTP/S callback URL on your web server to be notified when a call ends
Returns:
Object containing all the responses from the server
Throws:
HoiioException

createConference

public Conference createConference(String dest)
                            throws HoiioException
Dials out to a list of destination numbers and place them together in a conference call.

Parameters:
dest - A comma-seperated list of destination numbers in E.164 format (start with a "+" and country code) to be called and placed in the conference room. A maximum of 8 numbers are allowed. E.g. +6511111111,+6522222222,+6533333333
Returns:
Object containing all the responses from the server
Throws:
HoiioException

createConference

public Conference createConference(String dest,
                                   String room,
                                   String callerId,
                                   String tag,
                                   String notifyUrl)
                            throws HoiioException
Dials out to a list of destination numbers and place them together in a conference call.

Parameters:
dest - A comma-seperated list of destination numbers in E.164 format (start with a "+" and country code) to be called and placed in the conference room. A maximum of 8 numbers are allowed. E.g. +6511111111,+6522222222,+6533333333
room - (optional) A text string representing the conference room ID. Valid characters are a-z, A-Z, 0-9, period (.) and underscore (_) characters. Max 32 characters.
callerId - (optional) This is the Caller ID that each destination number will see on their incoming call.
tag - (optional) This is a text string containing your own reference ID for this transaction. This value will be included in the response for Notification, FetchVoice and FetchHistory for your reference. Max 256 characters.
notifyUrl - (optional) A fully-qualified HTTP/S callback URL on your web server to be notified when a call ends
Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchCall

public Call fetchCall(String txnRef)
               throws HoiioException
Fetches the current status of a call made previously

Parameters:
txnRef - The unique reference ID for the required transaction.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchHistory

public CallHistory fetchHistory()
                         throws HoiioException
Retrieves the history of calls made by this application.

Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchHistory

public CallHistory fetchHistory(Date from,
                                Date to,
                                Integer page)
                         throws HoiioException
Retrieves the history of calls made by this application.

Parameters:
from - (optional) Retrieve call history made by this app starting from this date/time in "YYYY-MM-DD HH:MM:SS" (GMT+8) format. E.g. "2010-01-01 00:00:00". If omitted, call history will be retrieved from the earliest transaction.
to - (optional) Retrieve call history made by this app before this date/time in "YYYY-MM-DD HH:MM:SS" (GMT+8) format. E.g. "2010-01-01 00:00:00". If omitted, call history will be retrieved up to the current point of time.
page - (optional) Each request returns a maximum of 100 entries. This parameter indicates which subset of entries to return.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

fetchRate

public CallRate fetchRate(String dest1,
                          String dest2)
                   throws HoiioException
Retrieves the billable rate that will be charged for calls made

Parameters:
dest1 - The first number to call. Phone numbers should start with a "+" and country code (E.164 format), e.g. +6511111111.
dest2 - The second number to call. Phone numbers should start with a "+" and country code (E.164 format), e.g. +6511111111.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

hangup

public CallHangUp hangup(String txnRef)
                  throws HoiioException
Hangs up a call that is currently in progress

Parameters:
txnRef - The unique reference ID for the call you want to hangup.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

makeCall

public CallTxn makeCall(String dest2)
                 throws HoiioException
Dials out to 2 destination numbers and connect them together in a phone conversation.

Parameters:
dest2 - The second number to call. Phone numbers should start with a "+" and country code (E.164 format), e.g. +6511111111. This cannot be the same as your mobile number.
Returns:
Object containing all the responses from the server
Throws:
HoiioException

makeCall

public CallTxn makeCall(String dest1,
                        String dest2,
                        String callerId,
                        String tag,
                        String notifyUrl)
                 throws HoiioException
Dials out to 2 destination numbers and connect them together in a phone conversation.

Parameters:
dest1 - (optional) The first number to call. Phone numbers should start with a "+" and country code (E.164 format), e.g. +6511111111. This cannot be the same as dest2 parameter.
dest2 - The second number to call. Phone numbers should start with a "+" and country code (E.164 format), e.g. +6511111111. This cannot be the same as dest1 parameter.
callerId - (optional) This is the Caller ID that dest2 will see on their incoming call
tag - (optional) This is a text string containing your own reference ID for this transaction. This value will be included in the response for Notification, FetchVoice and FetchHistory for your reference. Max 256 characters.
notifyUrl - (optional) A fully-qualified HTTP/S callback URL on your web server to be notified when the call ends.
Returns:
Object containing all the responses from the server
Throws:
HoiioException