[This is preliminary documentation and is subject to change.]

Delivers a ringtone or wallpaper to a user's phone via SMS/WAP/MMS.
**This function incurs a 2 credit usage charge.

Namespace:  PhoneSherpa.Services
Assembly:  App_Code.fxrph_yi (in App_Code.fxrph_yi)
Version: 0.0.0.0

Syntax

C#
public WS..::.SendContentToPhoneResult SendContentToPhone(
	string AccessKey,
	WS..::.UserPhoneInformation UserPhoneInfo,
	string SourceFile,
	string FriendlyFileName
)
Visual Basic (Declaration)
Public Function SendContentToPhone ( _
	AccessKey As String, _
	UserPhoneInfo As WS..::.UserPhoneInformation, _
	SourceFile As String, _
	FriendlyFileName As String _
) As WS..::.SendContentToPhoneResult
JScript
public function SendContentToPhone(
	AccessKey : String, 
	UserPhoneInfo : WS..::.UserPhoneInformation, 
	SourceFile : String, 
	FriendlyFileName : String
) : WS..::.SendContentToPhoneResult

Parameters

AccessKey
Type: System..::.String
Security key allocated to a developer enabling access to the web service API.
UserPhoneInfo
Type: PhoneSherpa.Services..::.WS..::.UserPhoneInformation
UserPhoneInformation structure containing the user's phone delivery information
SourceFile
Type: System..::.String
Internal source file name within Phone Sherpa system. Expressed as a random and unique file name without a path. Typically the output of an API editor function, but can be any internal SourceFile handle.
FriendlyFileName
Type: System..::.String
A user friendly representation of the SourceFile name. This name will become the file name seen on the user's phone.

Passed in names are truncated to 16 characters before the file extension, to ensure name portability across all phone models. Non alpha-numeric characters are converted to underscores "_". Files generated for the same user using the same friendly file name are given unique version numbers to ensure name collision and overwritting will not occur on the handset after delivery (this feature only present if files are created within the same 24 hour block).

Ex: "A Song From My Band.mp3" becomes "A_Song_From_My_B.mp3" on the user's phone. Making another ringtone with the same name within 24 hours will yield "A_Song_From_My_1.mp3".

Return Value

Function success or failure.

Remarks

SendContentToPhone takes any internal source file, publishes the file for download by the end user, and delivers a link to retrieve the file to the user's cell phone (or via the message if MMS is supported). Internal source files are not accessible outside of the Phone Sherpa system. They are used as the source for editing, content delivery, and are the result of editing. Typcially this function is called after an editing API call, such as EditAudioContentForPhone(...). The file sent to the phone should already be in a format supported by the phone natively. SendContentToPhone(...) does not convert or transcode files; it delivers them to the end user.

Files are available for pickup by the end user for a period of 24 hours. After this time, the pubished files are removed from the public pickup location. This location is not indended to be a mechanism to host files indefinately.

The content sent to the user's phone is DRM protected using OMA 2.0 forward locking, if the phone model supports this feature. GCD and similar content wrappers are automatically generated for carriers that require them.

This function incurs a 2 credit usage charge. Prepay customers must have credits in thier account to successfully call this function. Postpay customers will be metered 2 credits on thier monthly billing statement for each call to this function.

Any given phone number is limited to receiving a combination of 20 tests or content links sent to them per 24 hour period. This is to prevent fraud situations. Functions that trip the 20 usage meter in a 24 hour period will still return function success, however.

Below is an example of how to use this function:

CopyVB.NET
Public Sub EditAndDeliverRingtone(ByVal UserPhoneInfo As PhoneSherpa.Services.UserPhoneInformation, ByVal SourceFile As String, ByVal FriendlyFileName As String, ByVal StartSec As Double, ByVal EndSec As Double, ByVal FadeInSec As Double, ByVal FadeOutSec As Double)
   Dim SherpaService As New PhoneSherpa.Services.WS

   'Take the editor parameters and clip/convert the source file for the user's phone model.  
   Dim RingtoneEdit_Response As New PhoneSherpa.Services.EditAudioContentResult

   RingtoneEdit_Response = SherpaService.EditAudioContentForPhone("My_WSAccessKey", SourceFile, StartSec, EndSec, UserPhoneInfo.PhoneModelId, 0, FadeInSec, FadeOutSec)

   'Check the response to ensure the call worked
   If RingtoneEdit_Response.Result.ErrorCode = 0 Then
       'Bill the user or take some other action within the host application code
        '[host actions here]

        'Deliver the converted ringtone clip the the user's phone
        'This assumes that host applicatoin has presented a UI for selecting phone model or is pulling this information from its 
        'own account system
        Dim SendToPhone_Response As New PhoneSherpa.Services.SendContentToPhoneResult

        SendToPhone_Response = SherpaService.SendContentToPhone("My_WSAccessKey", UserPhoneInfo, RingtoneEdit_Response.ConvertedFile, FriendlyFileName)

        If SendToPhone_Response.Result.ErrorCode = 0 Then
            'ringtone delivery succeeded, redirect user to a success page and display ringtone install instructions
            '...
        Else
            'error - the send ringtone to phone call failed, redirect to an error handler
        End If
    Else
        'error - the ringtone edit call failed, redirect to an error handler
    End If
End Sub

See Also