hoiio.service.voice¶
- class hoiio.service.voice.Voice¶
Provide voice services such as making a call back, conference call, and query for calls.
Usage: Hoiio.voice.call(...), Hoiio.voice.conference(...), etc.
- call(dest1, dest2, **kwargs)¶
Call 2 phone numbers and connect them up
Parameters: - dest1 – The first phone number to call. If None, Hoiio will call the account’s registered mobile number.
- dest2 – The second phont number to call
- caller_id – The caller ID to show to dest2
- max_duration – Maximum duration (in seconds). Call will be hangup after max_duration
- tag – Your own reference tag for this transaction
- notify_url – A notification URL for Hoiio to call to your web server
Returns: Return hoiio.service.Response
- conference(*dests, **kwargs)¶
Call multiple phone numbers and connect them up in a conference call
Parameters: - dests – List of phone numbers to call
- room (string) – The conference room to transfer the callers to
- caller_id – The caller ID to show to dest2
- tag – Your own reference tag for this transaction
- notify_url – A notification URL for Hoiio to call to your web server
Returns: Return hoiio.service.Response
- hangup(txn_ref, **kwargs)¶
Hangup a call. For conference, you need to hangup for each of the participants.
Parameters: txn_ref – The transaction reference for the call to hangup Returns: Return hoiio.service.Response
- history(**kwargs)¶
Retrieve the history of calls. There is pagination, and each page returns up to 100 entries.
Parameters: - from (string) – Calls made after this date. In “YYYY-MM-DD HH:MM:SS” (GMT+8) format.
- to (string) – Calls made before this date. In “YYYY-MM-DD HH:MM:SS” (GMT+8) format.
- page (int) – The page number. Count starts from 1.
Returns: Return hoiio.service.Response
- rate(dest1, dest2, **kwargs)¶
Retrieve the cost of making a call
Parameters: - dest1 – The first phone number to call.
- dest2 – The second phont number to call
Returns: Return hoiio.service.Response
- status(txn_ref, **kwargs)¶
Retrieve the status and various information about a call
Parameters: txn_ref – The transaction reference for the call Returns: Return hoiio.service.Response