Calling Card
8/28/2008
This code sample is named CallingCard. It demonstrates how to create an application that allows a user to make a calling-card phone call directly from the Contacts screen.
Feature Area |
---|
Relevant APIs |
---|
|
PhoneMakeCall function |
Procedures
To run the code sample
Navigate to the solution file (*.sln), and double-click it. By default, the solution file is copied to the following folder:
C:\Program Files\Windows Mobile 6 SDK\Samples\Common\CPP\Win32\CallingCard
Microsoft Visual Studio 2005 launches and loads the solution.
Build the solution (Ctrl+Shift+B).
Deploy the solution (F5).
Run the generated CAB file on the mobile device.
Reboot the mobile device so that the settings take effect.
If you have not installed the SamplePrivDeveloper certificate, you will need to so that your Dll and CAB projects are signed correctly.
To install the certificate from the windows desktop
Click Start > Run.
Type the path-name to SamplePrivDeveloper.pfx certificate, and click OK. By default, this is located in the following folder:
C:\Program Files\Windows Mobile 6 SDK\Tools\Security\SDK Development Certificates
Double-click the SamplePrivDeveloper.pfx certificate icon. The Certificate Import Wizard appears.
Click Next. The certificate path-name is filled-in.
Click Next.
Click Next (you do not need a password).
Click Next. Accept the default options; automatically select the certificate store based on certificate type.
9. Click Finish.
See Mobile device Security Model for further details on how to install the SDK certificates onto the mobile device, and how to use the privileged SDK certificate to sign this application.
Registry settings
The calling-card registry settings are automatically provisioned by the CAB file. They are stored under the following registry key:
HKCU\Software\Microsoft\CallingCard
There are four values under this key:
- Number
[REG_SZ] The calling-card phone number.
- Pin
[REG_SZ] The calling-card Personal Identification Number (PIN). This must be a numeric value.
- Pause1
[REG_DWORD] The number of pauses between connecting to the calling-card service and the prompt for the PIN. Each pause is about two seconds long. A value of zero indicates that the phone application will wait for you to press Talk before sending the PIN.
- Pause2
[REG_DWORD] The number of pauses between inputting the PIN and the prompt for the number being dialed. Each pause is about two seconds long. A value of zero indicates that the phone application will wait for you to press Talk before sending the PIN.
Development Environments
SDK: Windows Mobile 6 Professional SDK and Windows Mobile 6 Standard SDK
Development Environment: Visual Studio 2005.
ActiveSync: Version 4.5.
Comments
On a CDMA network, Pause1 should be zero because the phone transitions immediately into the Connected state.
You must press Talk to send the PIN to the calling card system.
The entire dial string is stored in the phone call history as clear text. Hence, there is no point in encrypting the PIN in the registry.
If any of these registry settings is missing or invalid, the softkey or context menus will not contain the new calling-card menu options.
You must install the SamplePrivDeveloper.pfx certificate so that your DLL and CAB projects are signed correctly.
It is assumed that the DLL is registered as a Contacts Menu Extension, and that the calling-card registry settings are stored in:
HKCU\Software\Microsoft\CallingCard