Hide

gapi.hangout.telephone

Note: The Telephone API requires that you include additional scopes to the Google Developers Console project as described in OAuth Requirements.

Classes

Functions

Events

Enums

Classes in gapi.hangout.telephone

Class Description
class Call(
  onCallStateChanged
)
Represents the metadata of a call in a hangout

Jump to instance methods

Jump to instance event functions


onCallStateChanged : undefined
An event fired when a call’s state changes.
class CallInitiatedEvent(
  call
)
An event fired when a call is initiated (starts ringing).
call : Call
Information about the call that initiated.
class CallStateChangedEvent(
  call,
  oldState,
  newState
)
An event fired when a call’s state changes.
call : Call
Information about the call that connected.
oldState : string
The previous state of the call.
newState : string
The new state of the call.
class RateResponseEvent(
  phoneNumber,
  rate,
  successful
)
An event fired when the server responds to a rate lookup.
phoneNumber : undefined
The phone number as it was sent in the request.
rate : undefined
The cost of the call per minute. Null if the lookup was not successful.
successful : undefined
Whether the rate request was successful. Will be false if the user doesn't have a Google Voice account.

Call Instance Methods in gapi.hangout.telephone

Instance Method Returns Description & Parameter
endCall() undefined Terminates the phone call.
getDuration() number|undefined
getParticipantId() string|undefined
getPhoneNumber() string|undefined
getRate() string|undefined
getState() CallState
sendTone(
  tone
)
undefined Dials a tone on the call. The participant does not need to have been initially called by this user. Throws an exception if the tone is invalid.
tone : string
The tone to send. Only 0-9, A-D, *, # are valid. Only one tone may be sent at a time.
wasStartedByLocalParticipant() boolean

Instance Event Functions in gapi.hangout.telephone.Call

Event Function Description
gapi.hangout.telephone.Call#onCallStateChanged
onCallStateChanged.add(
  callback
)
Adds a callback to be called whenever a call’s state changes.
callback : function(CallStateChangedEvent)
The callback to add.
onCallStateChanged.remove(
  callback
)
Removes a callback previously added by gapi.hangout.telephone.Call.prototype.onCallStateChanged.add.
callback : function(CallStateChangedEvent)
The callback to remove.

Functions in gapi.hangout.telephone

Function Returns Description & Parameter
beginCall(
  phoneNumber
)
Call Invites the given phone number to the hangout. May show the Google Voice terms of service if the user does not yet have an account.
phoneNumber : string
The number to call.
canLocalParticipantMakeCalls() boolean
getCalls() Array.<Call>
isValidNumber(
  phoneNumber
)
boolean Checks if a phone number is syntactically correct.
phoneNumber : string
The phone number to validate.
requestCallRate(
  phoneNumber
)
undefined Looks up the rate to call a number. When a response has been received from the server a #RateResponseEvent will be fired.
phoneNumber : string
The phone number to check the rate for.

Event Functions in gapi.hangout.telephone

Event Function Description
gapi.hangout.telephone.onCallInitiated
onCallInitiated.add(
  callback
)
Adds a callback to be called whenever a call is initiated by any participant in the Hangout.
callback : function(CallInitiatedEvent)
The callback to add.
onCallInitiated.remove(
  callback
)
Removes a callback previously added by gapi.hangout.telephone.onCallInitiated.add.
callback : function(CallInitiatedEvent)
The callback to remove.
gapi.hangout.telephone.onRateResponse
onRateResponse.add(
  callback
)
Adds a callback to be called whenever a balance response is received from the server.
callback : function(RateResponseEvent)
The callback to add.
onRateResponse.remove(
  callback
)
Removes a callback previously added by gapi.hangout.telephone.onRateResponse.add.
callback : function(RateResponseEvent)
The callback to remove.

Enums in gapi.hangout.telephone

Enum Description
CallState The different states of a gapi.hangout.telephone.Call.
RINGING
CONNECTED
ENDED

Send feedback about...

Google+ Hangouts API