Bandwidth PHP SDK
  • Namespace
  • Class

Namespaces

  • Catapult
  • None

Classes

  • Account
  • AnswerCallEvent
  • Application
  • ApplicationCollection
  • AudioMixin
  • BaML
  • BaMLAssert
  • BaMLAttribute
  • BaMLContainer
  • BaMLGather
  • BaMLGeneric
  • BaMLHangup
  • BaMLPlayAudio
  • BaMLRedirect
  • BaMLResource
  • BaMLSendMessage
  • BaMLSpeakSentence
  • BaMLText
  • BaMLTransfer
  • BaMLVerb
  • BaMLVerbGather
  • BaMLVerbHangup
  • BaMLVerbPlayAudio
  • BaMLVerbRecord
  • BaMLVerbRedirect
  • BaMLVerbSendMessage
  • BaMLVerbSpeakSentence
  • BaMLVerbTransfer
  • BaseResource
  • BaseUtilities
  • Bridge
  • BridgeCollection
  • Call
  • Callback
  • CallCollection
  • CallCombo
  • CallEvent
  • CallEvents
  • CallEventsCollection
  • Cleaner
  • Client
  • ClientResource
  • CollectionIterator
  • CollectionObject
  • CollectionSequence
  • Conference
  • ConferenceEventMixin
  • ConferenceMember
  • ConferenceMemberEvent
  • ConferencePlaybackEvent
  • Constructor
  • Converter
  • Credentials
  • CredentialsUser
  • DataPacket
  • DataPacketCollection
  • Date
  • DependsObject
  • DependsResource
  • Domains
  • DomainsCollection
  • DTMF
  • DtmfCallEvent
  • Endpoints
  • EndpointsCollection
  • EndpointsCredentials
  • EndpointsMulti
  • EndpointsToken
  • Ensure
  • EnsureResource
  • ErrorCallEvent
  • Event
  • EventAssert
  • EventCollection
  • EventResource
  • EventType
  • FileHandler
  • Gather
  • GatherCallEvent
  • GatherCollection
  • GenericResource
  • HangupCallEvent
  • Id
  • IncomingCallEvent
  • LoadsResource
  • Locator
  • Log
  • Media
  • MediaCollection
  • MediaURL
  • Message
  • MessageCollection
  • MessageEvent
  • MessageMulti
  • MetaResource
  • Multi
  • NumberInfo
  • Page
  • Parameters
  • PathResource
  • PhoneCombo
  • PhoneNumber
  • PhoneNumbers
  • PhoneNumbersCollection
  • PlaybackCallEvent
  • PrototypeUtility
  • Recording
  • RecordingCallEvent
  • RecordingCollection
  • RejectCallEvent
  • RemoveResource
  • Resolver
  • ResolverResource
  • RESTClient
  • SchemaResource
  • Sentence
  • SIP
  • SIPRealm
  • Size
  • SpeakCallEvent
  • StringifyResource
  • SubfunctionObject
  • SubFunctionResource
  • TextMessage
  • Timeout
  • TimeoutCallEvent
  • TitleUtility
  • Transaction
  • TransactionCollection
  • Transcription
  • TranscriptionCallEvent
  • TranscriptionCollection
  • Types
  • URIResource
  • UserError
  • UserErrorCollection
  • VerifyResource
  • Voice
  • XMLUtility

Interfaces

  • API
  • API_MODE
  • BAML_SETTINGS
  • BAML_VERBS
  • BAML_XML_HANDLERS
  • BAML_XML_METHODS
  • BAML_XML_OPTIONS
  • CALL_ERROR
  • CALL_STATES
  • CONFERENCE_MEMBER_STATES
  • CONFERENCE_SPEAK_STATES
  • CONFERENCE_STATES
  • DEFAULTS
  • EXCEPTIONS
  • GATHER_REASONS
  • GATHER_STATES
  • MESSAGE_DIRECTIONS
  • MESSAGE_STATES
  • NUMBER_STATES
  • PATHS
  • PLAYBACK_STATES
  • RECORDING_STATES
  • RECORDING_STATUSES
  • SPEAK_STATES
  • TRANSCRIPTION_STATES
  • WARNINGS

Class Media

GenericResource is the class every model should use for initialization. It provides the functions to check the mandatory, optional arguments provided

Catapult\GenericResource
Extended by Catapult\Media
Final
Namespace: Catapult
Located at models/Media.php

Methods summary

public
# __construct( )

Construct a media object where data must be a blob in binary. Store in memory until store/1 is called if data is passed use this as object otherwise initialize from passed id. In rare cases when media is called only to list or create disregard both data and id

Construct a media object where data must be a blob in binary. Store in memory until store/1 is called if data is passed use this as object otherwise initialize from passed id. In rare cases when media is called only to list or create disregard both data and id

Init Forms: GET Media('media-id')

PUT Media(array)

public
# create( )

Overrides

Catapult\GenericResource::create
public
# get( id: $mediaName = null )

get/1 should find the media contents and set in the contents

get/1 should find the media contents and set in the contents

see getMediaContents for the file fetching

Parameters

$mediaName
to load

Overrides

Catapult\GenericResource::get
public the
# getMediaContents( mediaName $mediaName )

get the media contents

get the media contents

TODO get/0 needs reimplementation see: http://ap.bandwidth.com/docs/rest-api/media/#resource441

Parameters

$mediaName
media you uploaded

Returns

the
media content either wav/mp3
public
# upload( args $args )

Upload new media.

Upload new media.

In remaking we need the url. As this is a PUT request no 'location' header would be present [spec]

we will need both the mediaName and url

Parameters

$args
contain fileName and file(path to file)
public
# setData( data: $data )

Set the data. Input needs raw string usually called by recording

Set the data. Input needs raw string usually called by recording

Parameters

$data
contents
public
# store( filename: $filename, extention: $filext = DEFAULTS::EXTENSION )

Store media as file on the fs

Store media as file on the fs

By default create a directory if not currently available

Parameters

$filename
file name
$filext
to save in

Methods inherited from Catapult\GenericResource

__call(), __toString(), _init(), _list(), check(), delete(), getAudioUrl(), getObjClass(), getPath(), getSchemaString(), get_sub_function(), load(), reload(), toArray(), update()

Properties summary

Properties inherited from Catapult\GenericResource

$lastUpdate, $paths

Bandwidth PHP SDK API documentation generated by ApiGen