Skip to content
Browse files

Speech Custom Sample App

  • Loading branch information...
1 parent 228033b commit 01c527fd4b1a8a9ac821e698437ea9262bb58074 attdevsupport committed Jul 2, 2013
Showing with 2,142 additions and 482 deletions.
  1. +2 −0 MSSDK/csharp/ad/App1/README.txt
  2. +15 −14 MSSDK/csharp/dc/App1/Default.aspx
  3. +7 −20 MSSDK/csharp/dc/App1/Default.aspx.cs
  4. +9 −9 MSSDK/csharp/dc/App1/README.txt
  5. +6 −5 MSSDK/csharp/mim/app1/Default.aspx
  6. +8 −8 MSSDK/csharp/mim/app1/Default.aspx.cs
  7. +7 −7 MSSDK/csharp/mim/app1/README.txt
  8. +0 −6 MSSDK/csharp/mms/app1/README.txt
  9. +8 −7 MSSDK/csharp/{immn → mobo}/app1/Default.aspx
  10. +19 −19 MSSDK/csharp/{immn → mobo}/app1/Default.aspx.cs
  11. 0 MSSDK/csharp/{immn → mobo}/app1/MOBO_App1.sln
  12. +13 −13 MSSDK/csharp/{immn → mobo}/app1/README.txt
  13. +1 −1 MSSDK/{vb/immn → csharp/mobo}/app1/Web.config
  14. 0 MSSDK/{vb/immn → csharp/mobo}/app1/images/Thumbs.db
  15. 0 MSSDK/{vb/immn → csharp/mobo}/app1/images/att.gif
  16. 0 MSSDK/{vb/immn → csharp/mobo}/app1/style/common.css
  17. +4 −3 MSSDK/csharp/notary/app1/Default.aspx
  18. +2 −2 MSSDK/csharp/notary/app1/Default.aspx.cs
  19. +8 −8 MSSDK/csharp/notary/app1/README.txt
  20. +6 −5 MSSDK/csharp/payment/app1/Default.aspx
  21. +4 −23 MSSDK/csharp/payment/app1/Default.aspx.cs
  22. +8 −8 MSSDK/csharp/payment/app1/README.txt
  23. +0 −6 MSSDK/csharp/payment/app1/Web.config
  24. +2 −2 MSSDK/csharp/payment/app1/listener/Default.aspx.cs
  25. +6 −5 MSSDK/csharp/payment/app2/Default.aspx
  26. +4 −23 MSSDK/csharp/payment/app2/Default.aspx.cs
  27. +8 −8 MSSDK/csharp/payment/app2/README.txt
  28. +0 −6 MSSDK/csharp/payment/app2/Web.config
  29. +2 −2 MSSDK/csharp/payment/app2/listener/Default.aspx.cs
  30. +0 −4 MSSDK/csharp/sms/app1/README.txt
  31. +6 −6 MSSDK/csharp/speech/app1/Web.config
  32. +266 −0 MSSDK/csharp/speechCustom/app1/Default.aspx
  33. +395 −0 MSSDK/csharp/speechCustom/app1/Default.aspx.cs
  34. +115 −0 MSSDK/csharp/speechCustom/app1/README.txt
  35. +6 −6 MSSDK/csharp/{immn/app1/IMMN_App1.sln → speechCustom/app1/SpeechCustom_App1.sln}
  36. +51 −0 MSSDK/csharp/speechCustom/app1/Web.config
  37. BIN MSSDK/csharp/speechCustom/app1/audio/bostonseltics-8khz-wav.wav
  38. BIN MSSDK/csharp/speechCustom/app1/audio/pizza-en-US.wav
  39. BIN MSSDK/csharp/speechCustom/app1/default.wav
  40. +7 −0 MSSDK/csharp/speechCustom/app1/dictionary.txt
  41. +16 −0 MSSDK/csharp/speechCustom/app1/grammar.txt
  42. 0 MSSDK/csharp/{immn → speechCustom}/app1/images/Thumbs.db
  43. 0 MSSDK/csharp/{immn → speechCustom}/app1/images/att.gif
  44. +51 −0 MSSDK/csharp/speechCustom/app1/style/Web.config
  45. +39 −0 MSSDK/csharp/speechCustom/app1/style/common.css
  46. +4 −3 MSSDK/csharp/tl/app1/Default.aspx
  47. +2 −2 MSSDK/csharp/tl/app1/Default.aspx.cs
  48. +8 −8 MSSDK/csharp/tl/app1/README.txt
  49. +3 −0 MSSDK/vb/ad/App1/README.txt
  50. +12 −11 MSSDK/vb/dc/app1/Default.aspx
  51. +3 −13 MSSDK/vb/dc/app1/Default.aspx.vb
  52. +9 −9 MSSDK/vb/dc/app1/README.txt
  53. +6 −5 MSSDK/vb/mim/app1/Default.aspx
  54. +8 −8 MSSDK/vb/mim/app1/Default.aspx.vb
  55. +7 −7 MSSDK/vb/mim/app1/README.txt
  56. +0 −5 MSSDK/vb/mms/app1/README.txt
  57. +6 −5 MSSDK/vb/{immn → mobo}/app1/Default.aspx
  58. +16 −16 MSSDK/vb/{immn → mobo}/app1/Default.aspx.vb
  59. 0 MSSDK/vb/{immn → mobo}/app1/MOBO_App1.sln
  60. +13 −13 MSSDK/vb/{immn → mobo}/app1/README.txt
  61. +1 −1 MSSDK/{csharp/immn → vb/mobo}/app1/Web.config
  62. BIN MSSDK/vb/mobo/app1/images/Thumbs.db
  63. BIN MSSDK/vb/mobo/app1/images/att.gif
  64. 0 MSSDK/{csharp/immn → vb/mobo}/app1/style/common.css
  65. +4 −3 MSSDK/vb/notary/app1/Default.aspx
  66. +2 −2 MSSDK/vb/notary/app1/Default.aspx.vb
  67. +8 −8 MSSDK/vb/notary/app1/README.txt
  68. +6 −5 MSSDK/vb/payment/app1/Default.aspx
  69. +5 −21 MSSDK/vb/payment/app1/Default.aspx.vb
  70. +8 −8 MSSDK/vb/payment/app1/README.txt
  71. +0 −6 MSSDK/vb/payment/app1/Web.config
  72. +3 −3 MSSDK/vb/payment/app1/listener/Default.aspx.vb
  73. +6 −5 MSSDK/vb/payment/app2/Default.aspx
  74. +6 −23 MSSDK/vb/payment/app2/Default.aspx.vb
  75. +7 −9 MSSDK/vb/payment/app2/README.txt
  76. +0 −7 MSSDK/vb/payment/app2/Web.config
  77. +30 −30 MSSDK/vb/payment/app2/listener/Default.aspx.vb
  78. +1 −1 MSSDK/vb/speech/app1/Web.config
  79. +263 −0 MSSDK/vb/speechCustom/app1/Default.aspx
  80. +352 −0 MSSDK/vb/speechCustom/app1/Default.aspx.vb
  81. +115 −0 MSSDK/vb/speechCustom/app1/README.txt
  82. +6 −6 MSSDK/vb/{immn/app1/IMMN_App1.sln → speechCustom/app1/SpeechCustom_App1.sln}
  83. +45 −0 MSSDK/vb/speechCustom/app1/Web.config
  84. BIN MSSDK/vb/speechCustom/app1/audio/pizza-en-US.wav
  85. +7 −0 MSSDK/vb/speechCustom/app1/dictionary.txt
  86. +16 −0 MSSDK/vb/speechCustom/app1/grammar.txt
  87. BIN MSSDK/vb/speechCustom/app1/images/Thumbs.db
  88. BIN MSSDK/vb/speechCustom/app1/images/att.gif
  89. +39 −0 MSSDK/vb/speechCustom/app1/style/common.css
  90. +4 −3 MSSDK/vb/tl/app1/Default.aspx
  91. +2 −2 MSSDK/vb/tl/app1/Default.aspx.vb
  92. +8 −8 MSSDK/vb/tl/app1/README.txt
View
2 MSSDK/csharp/ad/App1/README.txt
@@ -90,6 +90,8 @@ web.config as specified below:
5) udid : The UDID Parameter is used for ad tracking purpose and
should be atleast 30 characters.
+6) Psedo_zone : This parameter specifies the mapping between API Gateway
+ and south bound enabler.
Note: If your application is promoted from Sandbox environment to Production
environment and you decide to use production application settings, you must update
View
29 MSSDK/csharp/dc/App1/Default.aspx
@@ -13,32 +13,32 @@
<!-- open HEADER -->
<div id="header">
<div>
- <div class="hcLeft">
- Server Time:</div>
<div class="hcRight">
- <asp:Label ID="lblServerTime" runat="server" Text="Label"></asp:Label>
+ <asp:Label ID="lblServerTime" runat="server"></asp:Label>
</div>
+ <div class="hcLeft">
+ Server Time:</div>
</div>
<div>
- <div class="hcLeft">
- Client Time:</div>
<div class="hcRight">
- <script language="JavaScript" type="text/javascript">
+ <script language="JavaScript" type="text/javascript">
var myDate = new Date();
document.write(myDate);
</script>
</div>
+ <div class="hcLeft">
+ Client Time:</div>
</div>
<div>
- <div class="hcLeft">
- User Agent:</div>
<div class="hcRight">
- <script language="JavaScript" type="text/javascript">
- document.write("" + navigator.userAgent);
+ <script language="JavaScript" type="text/javascript">
+ document.write("" + navigator.userAgent);
</script>
</div>
+ <div class="hcLeft">
+ User Agent:</div>
</div>
- <br style="clear: both;" />
+ <br clear="all" />
</div>
<!-- close HEADER -->
<div>
@@ -197,16 +197,17 @@
<div style="float: right; width: 20%; font-size: 9px; text-align: right">
Powered by AT&amp;T Cloud Architecture</div>
<p>
- &#169; 2012 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
+ &#169; 2013 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
target="_blank">http://developer.att.com</a>
<br />
The Application hosted on this site are working examples intended to be used for
reference in creating products to consume AT&amp;T Services and not meant to be
used as part of your product. The data in these pages is for test purposes only
and intended only for use as a reference in how the services perform.
<br />
- For download of tools and documentation, please go to <a href="https://devconnect-api.att.com/"
- target="_blank">https://devconnect-api.att.com</a>
+ For download of tools and documentation, please go to <a href="http://developer.att.com/SDK"
+ target="_blank">https://developer.att.com/SDK</a> and <a href="http://developer.att.com/docs"
+ target="_blank">https://developer.att.com/docs</a>
<br />
For more information contact <a href="mailto:developer.support@att.com">developer.support@att.com</a></p>
</div>
View
27 MSSDK/csharp/dc/App1/Default.aspx.cs
@@ -1,6 +1,6 @@
// <copyright file="Default.aspx.cs" company="AT&amp;T Intellectual Property">
-// Licensed by AT&amp;T under 'Software Development Kit Tools Agreement.' 2013
-// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
+// Licensed by AT&amp;T under 'AT&T SDK Tools Agreement' 2013
+// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
// Copyright 2013 AT&amp;T Intellectual Property. All rights reserved. http://developer.att.com
// For more information contact developer.support@att.com
// </copyright>
@@ -15,7 +15,6 @@
using System.Web.UI;
using ATT_MSSDK;
using ATT_MSSDK.DeviceCapabilitiesv2;
-using System.Web;
#endregion
/// <summary>
@@ -51,9 +50,6 @@ public partial class DC_App1 : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
{
BypassCertificateError();
- HttpContext.Current.Response.AddHeader("p3p", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
- DateTime currentServerTime = DateTime.UtcNow;
- lblServerTime.Text = String.Format("{0:ddd, MMM dd, yyyy HH:mm:ss}", currentServerTime) + " UTC";
bool ableToReadConfigFile = this.ReadConfigFile();
if (!ableToReadConfigFile)
{
@@ -75,14 +71,6 @@ protected void Page_Load(object sender, EventArgs e)
Session["CSDC_ACCESS_TOKEN"] = this.requestFactory.AuthorizeCredential;
}
}
- if (Request.QueryString["error"] != null && Session["mssdk_cs_dc_state"] != null)
- {
- Session["mssdk_cs_dc_state"] = null;
- string errorString = Request.Url.Query.Remove(0, 1);
- lblErrorMessage.Text = HttpUtility.UrlDecode(errorString);
- tbDeviceCapabError.Visible = true;
- return;
- }
}
this.GetDeviceCapabilities();
@@ -137,10 +125,10 @@ private bool ReadConfigFile()
this.apiKey = ConfigurationManager.AppSettings["apiKey"];
if (string.IsNullOrEmpty(this.apiKey))
{
- lblErrorMessage.Text = "apiKey is not defined in configuration file";
+ lblErrorMessage.Text = "apiKey is not defined in configuration file";
return false;
}
-
+
this.secretKey = ConfigurationManager.AppSettings["secretKey"];
if (string.IsNullOrEmpty(this.secretKey))
{
@@ -151,11 +139,11 @@ private bool ReadConfigFile()
this.redirectUrl = ConfigurationManager.AppSettings["redirectUrl"];
if (string.IsNullOrEmpty(this.redirectUrl))
{
- lblErrorMessage.Text = "redirectUrl is not defined in configuration file";
+ lblErrorMessage.Text = "redirectUrl is not defined in configuration file";
return false;
}
- return true;
+ return true;
}
/// <summary>
@@ -187,10 +175,9 @@ private void GetDeviceCapabilities()
if (this.requestFactory.AuthorizeCredential == null)
{
- Session["mssdk_cs_dc_state"] = "FetchAuthCode";
Response.Redirect(this.requestFactory.GetOAuthRedirect().ToString());
}
- Session["mssdk_cs_dc_state"] = null;
+
DeviceCapabilities deviceCapabilities = this.requestFactory.GetDeviceCapabilities();
this.DisplayDeviceCapabilities(deviceCapabilities);
}
View
18 MSSDK/csharp/dc/App1/README.txt
@@ -1,6 +1,6 @@
******************************************************************************************
-* Licensed by AT&T under 'Software Development Kit Tools Agreement.' 2013
-* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
+* Licensed by AT&T under 'AT&T SDK Tools Agreement' 2013
+* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
* Copyright 2013 AT&T Intellectual Property. All rights reserved. http://developer.att.com
* For more information contact developer.support@att.com<mailto:developer.support@att.com>
******************************************************************************************
@@ -14,7 +14,7 @@ developer to insert the advertisements into their application.
This file describes how to set up, configure and run the C# Applications of the
AT&T API Platform sample applications. It covers all steps required to register the
-application on DevConnect and, based on the generated API keys and secrets,
+application on https://developer.att.com/ and, based on the generated API keys and secrets,
create and run one's own full-fledged sample applications.
1. Configuration
@@ -26,10 +26,10 @@ create and run one's own full-fledged sample applications.
1. Configuration
Configuration consists of a few steps necessary to get an application registered
- on DevConnect with the proper services and endpoints, depending on the type of
+ on https://developer.att.com/ with the proper services and endpoints, depending on the type of
client-side application (autonomous/non-autonomous).
- To register an application, go to https://devconnect-api.att.com/ and login with
+ To register an application, go to https://developer.att.com/ and login with
your valid username and password. Next, choose "My Apps" from the bar at the top
of the page and click the "Setup a New Application" button.
@@ -52,10 +52,10 @@ create and run one's own full-fledged sample applications.
secret, so these values in your application should be adjusted accordingly.
Depending on the kind of authentication used, an application may be based on either
- the Autonomous Client or the Web-Server Client OAuth flow (see
- https://devconnect-api.att.com/docs/oauth20/autonomous-client-application-oauth-flow or
- https://devconnect-api.att.com/docs/oauth20/web-server-client-application-oauth-flow
- respectively).
+ the Autonomous Client or the Web-Server Client OAuth flow (see OAuth section in
+ https://developer.att.com/docs).
+
+
2. Installation
View
11 MSSDK/csharp/mim/app1/Default.aspx
@@ -1,6 +1,6 @@
<!--
-Licensed by AT&T under 'Software Development Kit Tools Agreement.' 2013
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
+Licensed by AT&T under 'AT&T SDK Tools Agreement' 2013
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
Copyright 2013 AT&T Intellectual Property. All rights reserved. http://developer.att.com
For more information contact developer.support@att.com
-->
@@ -208,16 +208,17 @@ For more information contact developer.support@att.com
<div style="float: right; width: 20%; font-size: 9px; text-align: right">
Powered by AT&amp;T Cloud Architecture</div>
<p>
- &#169; 2012 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
+ &#169; 2013 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
target="_blank">http://developer.att.com</a>
<br />
The Application hosted on this site are working examples intended to be used for
reference in creating products to consume AT&amp;T Services and not meant to be
used as part of your product. The data in these pages is for test purposes only
and intended only for use as a reference in how the services perform.
<br />
- For download of tools and documentation, please go to <a href="https://devconnect-api.att.com/"
- target="_blank">https://devconnect-api.att.com</a>
+ For download of tools and documentation, please go to <a href="http://developer.att.com/SDK"
+ target="_blank">https://developer.att.com/SDK</a> and <a href="http://developer.att.com/docs"
+ target="_blank">https://developer.att.com/docs</a>
<br />
For more information contact <a href="mailto:developer.support@att.com">developer.support@att.com</a></p>
</div>
View
16 MSSDK/csharp/mim/app1/Default.aspx.cs
@@ -1,6 +1,6 @@
// <copyright file="Default.aspx.cs" company="AT&amp;T Intellectual Property">
-// Licensed by AT&amp;T under 'Software Development Kit Tools Agreement.' 2013
-// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
+// Licensed by AT&amp;T under 'AT&T SDK Tools Agreement' 2013
+// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
// Copyright 2013 AT&amp;T Intellectual Property. All rights reserved. http://developer.att.com
// For more information contact developer.support@att.com
// </copyright>
@@ -293,27 +293,27 @@ private void GetMessageHeaders()
}
catch (TokenExpiredException te)
{
- this.DrawPanelForFailure(statusPanel, te.Message);
+ this.DrawPanelForFailure(ContentPanelStatus, te.Message);
}
catch (UnauthorizedRequest ur)
{
- this.DrawPanelForFailure(statusPanel, ur.Message);
+ this.DrawPanelForFailure(ContentPanelStatus, ur.Message);
}
catch (InvalidResponseException ie)
{
- this.DrawPanelForFailure(statusPanel, ie.Body);
+ this.DrawPanelForFailure(ContentPanelStatus, ie.Body);
}
catch (ArgumentNullException are)
{
- this.DrawPanelForFailure(statusPanel, are.Message);
+ this.DrawPanelForFailure(ContentPanelStatus, are.Message);
}
catch (ArgumentException ae)
{
- this.DrawPanelForFailure(statusPanel, ae.Message);
+ this.DrawPanelForFailure(ContentPanelStatus, ae.Message);
}
catch (Exception ex)
{
- this.DrawPanelForFailure(statusPanel, ex.Message);
+ this.DrawPanelForFailure(ContentPanelStatus, ex.Message);
}
}
View
14 MSSDK/csharp/mim/app1/README.txt
@@ -1,5 +1,5 @@
******************************************************************************************
-* Licensed by AT&T under 'Software Development Kit Tools Agreement.' 2013
+* Licensed by AT&T under 'AT&T SDK Tools Agreement' 2013
* Copyright 2013 AT&T Intellectual Property. All rights reserved. http://developer.att.com
* For more information contact developer.support@att.com<mailto:developer.support@att.com>
******************************************************************************************
@@ -12,7 +12,7 @@ stored in the AT&T Messages environment.
This file describes how to set up, configure and run AT&T MSSDK C#.NET sample
applications. It covers all steps required to register the application on
-DevConnect and, based on the generated API keys and secrets, create and run
+https://developer.att.com/ and, based on the generated API keys and secrets, create and run
one's own full-fledged sample applications.
1. Configuration
@@ -24,10 +24,10 @@ one's own full-fledged sample applications.
1. Configuration
Configuration consists of a few steps necessary to get an application registered
- on DevConnect with the proper services and endpoints, depending on the type of
+ on https://developer.att.com/ with the proper services and endpoints, depending on the type of
client-side application (autonomous/non-autonomous).
- To register an application, go to https://devconnect-api.att.com/ and login with
+ To register an application, go to https://developer.att.com/ and login with
your valid username and password. Next, choose "My Apps" from the bar at the top
of the page and click the "Setup a New Application" button.
@@ -47,9 +47,9 @@ field 'Services' in order to use this sample application code.
Depending on the kind of authentication used, an application may be based on
either the Autonomous Client or the Web-Server Client OAuth flow
- (see https://devconnect-api.att.com/docs/oauth20/autonomous-client-application-oauth-flow or
- https://devconnect-api.att.com/docs/oauth20/web-server-client-application-oauth-flow
- respectively).
+ (see https://developer.att.com/docs).
+
+
View
6 MSSDK/csharp/mms/app1/README.txt
@@ -82,12 +82,6 @@ web.config as specified below:
3) endPoint : This is mandatory parameter, Set it to the end point
URI of AT&T Service.
-4) deiveryStatusFilePath : This is mandatory key, which will point to the file, which is
- used by application to store the received online delivery status messages.
-
-5) numberOfDeliveryStatusToStore : This is optional parameter, these many records will be stored in file
-
-
Note: If your application is promoted from Sandbox environment to Production environment
and you decide to use production application settings, you must update parameters 1-2
as per production application details.
View
15 MSSDK/csharp/immn/app1/Default.aspx → MSSDK/csharp/mobo/app1/Default.aspx
@@ -1,6 +1,6 @@
<!--
-Licensed by AT&T under 'Software Development Kit Tools Agreement.' 2013
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
+Licensed by AT&T under 'AT&T SDK Tools Agreement' 2013
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
Copyright 2013 AT&T Intellectual Property. All rights reserved. http://developer.att.com
For more information contact developer.support@att.com
-->
@@ -10,7 +10,7 @@ For more information contact developer.support@att.com
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
- <title>AT&amp;T IMMN Service Application</title>
+ <title>AT&amp;T Sample Mobo Application 1- Sample Mobo Service Application</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<link rel="stylesheet" type="text/css" href="style/common.css" />
</head>
@@ -51,7 +51,7 @@ For more information contact developer.support@att.com
<div>
<div class="content">
<h1>
- AT&amp;T IMMN Service Sample Application</h1>
+ AT&amp;T Sample Mobo Application 1 - Basic Mobo Service Application</h1>
<h2>
Feature 1: Send Message</h2>
</div>
@@ -167,16 +167,17 @@ For more information contact developer.support@att.com
<div style="float: right; width: 20%; font-size: 9px; text-align: right">
Powered by AT&amp;T Cloud Architecture</div>
<p>
- &#169; 2012 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
+ &#169; 2013 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
target="_blank">http://developer.att.com</a>
<br />
The Application hosted on this site are working examples intended to be used for
reference in creating products to consume AT&amp;T Services and not meant to be
used as part of your product. The data in these pages is for test purposes only
and intended only for use as a reference in how the services perform.
<br />
- For download of tools and documentation, please go to <a href="https://devconnect-api.att.com/"
- target="_blank">https://devconnect-api.att.com</a>
+ For download of tools and documentation, please go to <a href="http://developer.att.com/SDK"
+ target="_blank">https://developer.att.com/SDK</a> and <a href="http://developer.att.com/docs"
+ target="_blank">https://developer.att.com/docs</a>
<br />
For more information contact <a href="mailto:developer.support@att.com">developer.support@att.com</a></p>
</div>
View
38 MSSDK/csharp/immn/app1/Default.aspx.cs → MSSDK/csharp/mobo/app1/Default.aspx.cs
@@ -1,6 +1,6 @@
// <copyright file="Default.aspx.cs" company="AT&amp;T Intellectual Property">
-// Licensed by AT&amp;T under 'Software Development Kit Tools Agreement.' 2013
-// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
+// Licensed by AT&amp;T under 'AT&T SDK Tools Agreement' 2013
+// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
// Copyright 2013 AT&amp;T Intellectual Property. All rights reserved. http://developer.att.com
// For more information contact developer.support@att.com
// </copyright>
@@ -20,17 +20,17 @@
/*
* This Application demonstrates usage of AT&T MS SDK wrapper library for utilizing the usage of
- * In App Messaging from Mobile Number Api send message.
+ * Message On Behalf Of (MOBO) Api.
*
* Pre-requisite:
* --------------
* The developer has to register his application in AT&T Developer Platform website, for the scope
* of AT&T services to be used by application. AT&T Developer Platform website provides a ClientId
* and client secret on registering the application.
*
- * Steps to be followed by the application to invoke IMMN APIs exposed by MS SDK wrapper library:
+ * Steps to be followed by the application to invoke MOBO APIs exposed by MS SDK wrapper library:
* --------------------------------------------------------------------------------------------
- * 1. Import ATT_MSSDK and ATT_MSSDK.IMMNv1 NameSpace.
+ * 1. Import ATT_MSSDK and ATT_MSSDK.MOBOv1 NameSpace.
* 2. Create an instance of RequestFactory class provided in MS SDK library. The RequestFactory manages
* the connections and calls to the AT&T API Platform.Pass clientId, ClientSecret and scope as arguments
* while creating RequestFactory instance.
@@ -45,44 +45,44 @@
* 4. Retrive the 'code' query parameter from AT&T platform response and Invoke GetAuthorizeCredentials() on requestFactory
* by passing 'code' as the argument.
*
- * 5. Invoke the IMMN related APIs exposed in the RequestFactory class of MS SDK library.
+ * 5. Invoke the MOBO related APIs exposed in the RequestFactory class of MS SDK library.
*
- * For IMMN services MS SDK library provides APIs SendIMMN().
+ * For MOBO services MS SDK library provides APIs SendMessage().
* These methods returns SendMessageResponse object.
* Sample code for sending message:
* --------------------------------
- SendMessageResponse resp = requestFactory.SendIMMN(addresses, attachments, text, subject, groupMessage, maxAddressCount);
+ SendMessageResponse resp = requestFactory.SendMessage(addresses, attachments, text, subject, groupMessage, maxAddressCount);
*
*/
/// <summary>
/// This application allows the user to send SMS and MMS on behalf of subscriber,
-/// with subscriber’s consent, using the IMMN API.
+/// with subscriber’s consent, using the MOBO API.
/// </summary>
public partial class MOBO_app1 : System.Web.UI.Page
{
- /** \addtogroup IMMN_App1
- * Description of the application can be referred at \ref IMMN_app1 example
+ /** \addtogroup MOBO_App1
+ * Description of the application can be referred at \ref MOBO_app1 example
* @{
*/
- /** \example IMMN_app1 immn\app1\Default.aspx.cs
- * \n \n This application allows the user to send SMS and MMS on behalf of subscriber, with subscriber's consent, using the IMMN API
+ /** \example MOBO_app1 mobo\app1\Default.aspx.cs
+ * \n \n This application allows the user to send SMS and MMS on behalf of subscriber, with subscriber's consent, using the MOBO API
* <ul>
* <li>SDK methods showcased by the application:</li>
* \n \n <b>Send Messages:</b>
* \n This method is used to send SMS or MMS to maximum of ten recipients or configured number of recipients. The recipients can be email address, short code or mobile numbers or combination of email address, short code or/and mobile numbers.
* These Messages are processed synchronously by the AT&T system and are sent asynchronously to the destination.
* \n \n Steps followed in the app to invoke the method:
- * <ul><li>Import \c ATT_MSSDK and \c ATT_MSSDK.IMMNv1 NameSpace.</li>
+ * <ul><li>Import \c ATT_MSSDK and \c ATT_MSSDK.MOBOv1 NameSpace.</li>
* <li>Create an instance of \c RequestFactory class provided in MS SDK library. The \c RequestFactory manages the connections and calls to the AT&T API Platform.
* Pass clientId, ClientSecret and scope as arguments while creating \c RequestFactory instance.</li>
* <li>Invoke GetOAuthRedirect() on requestFactory to get redirectUrl(Url for authorization endpoint of AT&T platform).
* Redirect the user to authorization endpoint of AT&T platform for getting user authentication and authorization.
* \n AT&T displays the login and consent page. After getting the consent from the user, AT&T platform returns 'code' as a query parameter.</li>
* <li>Retrive the 'code' query parameter from AT&T platform response and Invoke GetAuthorizeCredentials() on requestFactory by passing 'code' as the argument.</li>
- * <li>Invoke \c SendIMMN() exposed in the \c RequestFactory class of MS SDK library.</li></ul>
+ * <li>Invoke \c SendMessage() exposed in the \c RequestFactory class of MS SDK library.</li></ul>
* \n Sample code:
* <ul>
* <li>Initializing \c RequestFactory instance:</li>
@@ -103,7 +103,7 @@ public partial class MOBO_app1 : System.Web.UI.Page
* }</pre>
* <li>Sending Message:</li>
* <pre>
- * SendMessageResponse response = requestFactory.SendIMMN(addresses, attachments, text, subject, groupMessage, maxAddressCount);</pre></ul>
+ * SendMessageResponse response = requestFactory.SendMessage(addresses, attachments, text, subject, groupMessage, maxAddressCount);</pre></ul>
* <li>For Registration, Installation, Configuration and Execution, refer \ref Application </li> \n
* \n <li>Additional configuration to be done:</li> \n
* \n Apart from parameters specified in \ref parameters_sec section, the following parameters need to be specified for this application
@@ -201,7 +201,7 @@ protected void Page_Load(object sender, EventArgs e)
}
/// <summary>
- /// Method will be called when the user clicks on send message button. This method calls SendIMMN function of Request Factory
+ /// Method will be called when the user clicks on send message button. This method calls SendMessage function of Request Factory
/// </summary>
/// <param name="sender">object pointing to the caller</param>
/// <param name="e">Event arguments</param>
@@ -288,7 +288,7 @@ private bool ReadConfigFile()
private void InitializeRequestFactory()
{
List<RequestFactory.ScopeTypes> scopes = new List<RequestFactory.ScopeTypes>();
- scopes.Add(RequestFactory.ScopeTypes.IMMN);
+ scopes.Add(RequestFactory.ScopeTypes.MOBO);
this.requestFactory = new RequestFactory(this.endPoint, this.apiKey, this.secretKey, scopes, this.redirectUrl, null);
@@ -364,7 +364,7 @@ private MessageStructure GetUserInput()
}
/// <summary>
- /// Initiates SendIMMN call to Request Factory
+ /// Initiates SendMessage call to Request Factory
/// </summary>
/// <param name="msgToSend">Message object</param>
private void SendMessage(MessageStructure msgToSend)
View
0 MSSDK/csharp/immn/app1/MOBO_App1.sln → MSSDK/csharp/mobo/app1/MOBO_App1.sln
File renamed without changes.
View
26 MSSDK/csharp/immn/app1/README.txt → MSSDK/csharp/mobo/app1/README.txt
@@ -1,18 +1,18 @@
******************************************************************************************
-* Licensed by AT&T under 'Software Development Kit Tools Agreement.' June 2012
+* Licensed by AT&T under 'AT&T SDK Tools Agreement' 2013
* Copyright 2013 AT&T Intellectual Property. All rights reserved. http://developer.att.com
* For more information contact developer.support@att.com<mailto:developer.support@att.com>
******************************************************************************************
- AT&T API Samples - IMMN app 1
+ AT&T API Samples - MOBO app 1
--------------------------------
This application allows the user to send SMS and MMS on behalf of subscriber,
-with subscriber�s consent, using the IMMN API.
+with subscriber�s consent, using the MOBO API.
This file describes how to set up, configure and run AT&T MSSDK C#.Net sample
applications. It covers all steps required to register the application on
-DevConnect and, based on the generated API keys and secrets, create and run
+https://developer.att.com/ and, based on the generated API keys and secrets, create and run
one's own full-fledged sample applications.
1. Configuration
@@ -24,16 +24,16 @@ one's own full-fledged sample applications.
1. Configuration
Configuration consists of a few steps necessary to get an application registered
- on DevConnect with the proper services and endpoints, depending on the type of
+ on https://developer.att.com/ with the proper services and endpoints, depending on the type of
client-side application (autonomous/non-autonomous).
- To register an application, go to https://devconnect-api.att.com/ and login with
+ To register an application, go to https://developer.att.com/ and login with
your valid username and password. Next, choose "My Apps" from the bar at the top
of the page and click the "Setup a New Application" button.
Fill in the form, in particular all fields marked as "required".
-NOTE: You MUST select In App Messaging from Mobile Number (IMMN) in the list of services under
+NOTE: You MUST select Messaging On Behalf Of (MOBO) in the list of services under
field 'Services' in order to use this sample application code.
Having your application registered, you will get back an important pair of data:
@@ -47,9 +47,9 @@ field 'Services' in order to use this sample application code.
Depending on the kind of authentication used, an application may be based on
either the Autonomous Client or the Web-Server Client OAuth flow
- (see https://devconnect-api.att.com/docs/oauth20/autonomous-client-application-oauth-flow or
- https://devconnect-api.att.com/docs/oauth20/web-server-client-application-oauth-flow
- respectively).
+ (see https://developer.att.com/docs).
+
+
@@ -80,7 +80,7 @@ web.config as specified below:
of AT&T Service.
4) authorize_redirect_uri: This is mandatory key and value should be equal
- to IMMN Service registered application 'OAuth Redirect URL'
+ to MOBO Service registered application 'OAuth Redirect URL'
5) max_addresses : This is optional key specifying the maximum number of addresses,
user can specify. Default value is 10.
@@ -93,7 +93,7 @@ environment to 'Production' environment.
4. Running the application
-Suppose you copied the sample app files in your IIS server webroot/immn/app1/ folder.
-In order to run the sample application, type in'http://IIS_HOSTNAME:8080/immn/app1/Default.aspx'
+Suppose you copied the sample app files in your IIS server webroot/mobo/app1/ folder.
+In order to run the sample application, type in'http://IIS_HOSTNAME:8080/mobo/app1/Default.aspx'
(assuming you're using a HOSTNAME machine with IIS Server and have not changed the
default port number, otherwise adjust accordingly) on your browser.
View
2 MSSDK/vb/immn/app1/Web.config → MSSDK/csharp/mobo/app1/Web.config
@@ -22,7 +22,7 @@
<add key="endPoint" value="" />
<!-- This is mandatory key and value should be equal
- to IMMN Service registered application 'OAuth Redirect URL'
+ to MOBO Service registered application 'OAuth Redirect URL'
example: value="https://IIS-Server/webroot/mim/app1/Default.aspx -->
<add key="authorize_redirect_uri" value=""/>
View
0 MSSDK/vb/immn/app1/images/Thumbs.db → MSSDK/csharp/mobo/app1/images/Thumbs.db
File renamed without changes.
View
0 MSSDK/vb/immn/app1/images/att.gif → MSSDK/csharp/mobo/app1/images/att.gif
File renamed without changes
View
0 MSSDK/vb/immn/app1/style/common.css → MSSDK/csharp/mobo/app1/style/common.css
File renamed without changes.
View
7 MSSDK/csharp/notary/app1/Default.aspx
@@ -109,16 +109,17 @@
<div style="float: right; width: 20%; font-size: 9px; text-align: right">
Powered by AT&amp;T Cloud Architecture</div>
<p>
- &#169; 2012 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
+ &#169; 2013 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
target="_blank">http://developer.att.com</a>
<br />
The Application hosted on this site are working examples intended to be used for
reference in creating products to consume AT&amp;T Services and not meant to be
used as part of your product. The data in these pages is for test purposes only
and intended only for use as a reference in how the services perform.
<br />
- For download of tools and documentation, please go to <a href="https://devconnect-api.att.com/"
- target="_blank">https://devconnect-api.att.com</a>
+ For download of tools and documentation, please go to <a href="http://developer.att.com/SDK"
+ target="_blank">https://developer.att.com/SDK</a> and <a href="http://developer.att.com/docs"
+ target="_blank">https://developer.att.com/docs</a>
<br />
For more information contact <a href="mailto:developer.support@att.com">developer.support@att.com</a></p>
</div>
View
4 MSSDK/csharp/notary/app1/Default.aspx.cs
@@ -1,6 +1,6 @@
// <copyright file="Default.aspx.cs" company="AT&amp;T">
-// Licensed by AT&amp;T under 'Software Development Kit Tools Agreement.' 2013
-// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
+// Licensed by AT&amp;T under 'AT&T SDK Tools Agreement' 2013
+// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
// Copyright 2013 AT&amp;T Intellectual Property. All rights reserved. http://developer.att.com
// For more information contact developer.support@att.com
// </copyright>
View
16 MSSDK/csharp/notary/app1/README.txt
@@ -1,5 +1,5 @@
******************************************************************************************
-* Licensed by AT&T under 'Software Development Kit Tools Agreement.' June 2012
+* Licensed by AT&T under 'AT&T SDK Tools Agreement' 2013
* Copyright 2013 AT&T Intellectual Property. All rights reserved. http://developer.att.com
* For more information contact developer.support@att.com<mailto:developer.support@att.com>
******************************************************************************************
@@ -16,7 +16,7 @@ and the received signed payload and signature.
This file describes how to set up, configure and run AT&T MSSDK C#.NET sample
applications. It covers all steps required to register the application on
-DevConnect and, based on the generated API keys and secrets, create and run
+https://developer.att.com/ and, based on the generated API keys and secrets, create and run
one's own full-fledged sample applications.
1. Configuration
@@ -28,10 +28,10 @@ one's own full-fledged sample applications.
1. Configuration
Configuration consists of a few steps necessary to get an application registered
- on DevConnect with the proper services and endpoints, depending on the type of
+ on https://developer.att.com/ with the proper services and endpoints, depending on the type of
client-side application (autonomous/non-autonomous).
- To register an application, go to https://devconnect-api.att.com/ and login with
+ To register an application, go to https://developer.att.com/ and login with
your valid username and password. Next, choose "My Apps" from the bar at the top
of the page and click the "Setup a New Application" button.
@@ -54,10 +54,10 @@ order to use this sample application code.
so these values in your application should be adjusted accordingly.
Depending on the kind of authentication used, an application may be based on
- either the Autonomous Client or the Web-Server Client OAuth flow (see
- https://devconnect-api.att.com/docs/oauth20/autonomous-client-application-oauth-flow or
- https://devconnect-api.att.com/docs/oauth20/web-server-client-application-oauth-flow
- respectively).
+ either the Autonomous Client or the Web-Server Client OAuth flow (see OAuth section in
+ https://developer.att.com/docs).
+
+
View
11 MSSDK/csharp/payment/app1/Default.aspx
@@ -55,8 +55,8 @@
<tr>
<asp:RadioButtonList ID="Radio_TransactionProductType" runat="server" RepeatDirection="Vertical"
Font-Names="Calibri" Font-Size="Small">
- <asp:ListItem Selected="True" runat="server" ID="lstMinAmount"/>
- <asp:ListItem runat="server" ID="lstMaxAmount"/>
+ <asp:ListItem Selected="True">Buy product 1 for $0.99</asp:ListItem>
+ <asp:ListItem>Buy product 2 for $2.99</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
@@ -190,16 +190,17 @@
<div style="float: right; width: 20%; font-size: 9px; text-align: right">
Powered by AT&amp;T Cloud Architecture</div>
<p>
- &#169; 2012 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
+ &#169; 2013 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
target="_blank">http://developer.att.com</a>
<br />
The Application hosted on this site are working examples intended to be used for
reference in creating products to consume AT&amp;T Services and not meant to be
used as part of your product. The data in these pages is for test purposes only
and intended only for use as a reference in how the services perform.
<br />
- For download of tools and documentation, please go to <a href="https://devconnect-api.att.com/"
- target="_blank">https://devconnect-api.att.com</a>
+ For download of tools and documentation, please go to <a href="http://developer.att.com/SDK"
+ target="_blank">https://developer.att.com/SDK</a> and <a href="http://developer.att.com/docs"
+ target="_blank">https://developer.att.com/docs</a>
<br />
For more information contact <a href="mailto:developer.support@att.com">developer.support@att.com</a>
</div>
View
27 MSSDK/csharp/payment/app1/Default.aspx.cs
@@ -1,6 +1,6 @@
// <copyright file="Default.aspx.cs" company="AT&amp;T">
-// Licensed by AT&amp;T under 'Software Development Kit Tools Agreement.' 2013
-// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
+// Licensed by AT&amp;T under 'AT&T SDK Tools Agreement' 2013
+// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
// Copyright 2013 AT&amp;T Intellectual Property. All rights reserved. http://developer.att.com
// For more information contact developer.support@att.com
// </copyright>
@@ -178,11 +178,6 @@ public partial class Payment_App1 : System.Web.UI.Page
/// </summary>
private string refundFilePath;
- /// <summary>
- /// Gets or sets the value of transaction amount.
- /// </summary>
- private string MinTransactionAmount, MaxTransactionAmount;
-
#endregion
#region Payment Application events
@@ -239,11 +234,11 @@ protected void NewTransactionButton_Click(object sender, EventArgs e)
this.transactionTimeString = string.Format("{0:dddMMMddyyyyHHmmss}", this.transactionTime);
if (Radio_TransactionProductType.SelectedIndex == 0)
{
- this.amount = Convert.ToDouble(this.MinTransactionAmount);
+ this.amount = 0.99;
}
else if (Radio_TransactionProductType.SelectedIndex == 1)
{
- this.amount = Convert.ToDouble(this.MaxTransactionAmount);
+ this.amount = 2.99;
}
Session["tranType"] = Radio_TransactionProductType.SelectedIndex.ToString();
@@ -451,20 +446,6 @@ protected void GetTransactionButton_Click(object sender, EventArgs e)
/// <returns>Returns Boolean</returns>
private bool Initialize()
{
- this.MinTransactionAmount = ConfigurationManager.AppSettings["MinTransactionAmount"];
- if (string.IsNullOrEmpty(this.MinTransactionAmount))
- {
- this.MinTransactionAmount = "0.00";
- }
- lstMinAmount.Text = "Buy product 1 for $" + this.MinTransactionAmount;
-
- this.MaxTransactionAmount = ConfigurationManager.AppSettings["MaxTransactionAmount"];
- if (string.IsNullOrEmpty(this.MaxTransactionAmount))
- {
- this.MaxTransactionAmount = "2.99";
- }
- lstMaxAmount.Text = "Buy product 2 for $" + this.MaxTransactionAmount;
-
if (this.requestFactory == null)
{
this.apiKey = ConfigurationManager.AppSettings["api_key"];
View
16 MSSDK/csharp/payment/app1/README.txt
@@ -1,5 +1,5 @@
******************************************************************************************
-* Licensed by AT&T under 'Software Development Kit Tools Agreement.' June 2012
+* Licensed by AT&T under 'AT&T SDK Tools Agreement' 2013
* Copyright 2013 AT&T Intellectual Property. All rights reserved. http://developer.att.com
* For more information contact developer.support@att.com<mailto:developer.support@att.com>
******************************************************************************************
@@ -19,7 +19,7 @@ to sign the payload first.
This file describes how to set up, configure and run AT&T MSSDK C#.NET sample
applications. It covers all steps required to register the application on
-DevConnect and, based on the generated API keys and secrets, create and run
+https://developer.att.com/ and, based on the generated API keys and secrets, create and run
one's own full-fledged sample applications.
1. Configuration
@@ -31,10 +31,10 @@ one's own full-fledged sample applications.
1. Configuration
Configuration consists of a few steps necessary to get an application registered
- on DevConnect with the proper services and endpoints, depending on the type of
+ on https://developer.att.com/ with the proper services and endpoints, depending on the type of
client-side application (autonomous/non-autonomous).
- To register an application, go to https://devconnect-api.att.com/ and login with
+ To register an application, go to https://developer.att.com/ and login with
your valid username and password. Next, choose "My Apps" from the bar at the top
of the page and click the "Setup a New Application" button.
@@ -57,10 +57,10 @@ order to use this sample application code.
secret, so these values in your application should be adjusted accordingly.
Depending on the kind of authentication used, an application may be based on
- either the Autonomous Client or the Web-Server Client OAuth flow (see
- https://devconnect-api.att.com/docs/oauth20/autonomous-client-application-oauth-flow or
- https://devconnect-api.att.com/docs/oauth20/web-server-client-application-oauth-flow
- respectively).
+ either the Autonomous Client or the Web-Server Client OAuth flow (see OAuth section in
+ https://developer.att.com/docs).
+
+
View
6 MSSDK/csharp/payment/app1/Web.config
@@ -45,12 +45,6 @@
<!-- This is optional key, which will allow to display the number of transaction to display for refund, default is 5
example: value="5"-->
<add key="refundCountToDisplay" value=""/>
-
- <!-- This is optional key, which will allow to display the minimum transaction amount for option 1-->
- <add key="MinTransactionAmount" value=""/>
-
- <!-- This is optional key, which will allow to display the maximum transaction amount for option 2-->
- <add key="MaxTransactionAmount" value=""/>
</appSettings>
</configuration>
View
4 MSSDK/csharp/payment/app1/listener/Default.aspx.cs
@@ -1,6 +1,6 @@
// <copyright file="Default.aspx.cs" company="AT&amp;T">
-// Licensed by AT&amp;T under 'Software Development Kit Tools Agreement.' 2013
-// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
+// Licensed by AT&amp;T under 'AT&T SDK Tools Agreement' 2013
+// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
// Copyright 2013 AT&amp;T Intellectual Property. All rights reserved. http://developer.att.com
// For more information contact developer.support@att.com
// </copyright>
View
11 MSSDK/csharp/payment/app2/Default.aspx
@@ -56,8 +56,8 @@
<tr><td>
<asp:RadioButtonList ID="Radio_SubscriptionProductType" runat="server" RepeatDirection="Vertical"
Font-Names="Calibri" Font-Size="Small">
- <asp:ListItem Selected="True" runat="server" ID="lstMinAmount"/>
- <asp:ListItem runat="server" ID="lstMaxAmount"/>
+ <asp:ListItem Selected="True">Subscribe for $1.99 per month</asp:ListItem>
+ <asp:ListItem>Subscribe for $3.99 per month</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
@@ -226,16 +226,17 @@
<div style="float: right; width: 20%; font-size: 9px; text-align: right">
Powered by AT&amp;T Cloud Architecture</div>
<p>
- &#169; 2012 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
+ &#169; 2013 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
target="_blank">http://developer.att.com</a>
<br />
The Application hosted on this site are working examples intended to be used for
reference in creating products to consume AT&amp;T Services and not meant to be
used as part of your product. The data in these pages is for test purposes only
and intended only for use as a reference in how the services perform.
<br />
- For download of tools and documentation, please go to <a href="https://devconnect-api.att.com/"
- target="_blank">https://devconnect-api.att.com</a>
+ For download of tools and documentation, please go to <a href="http://developer.att.com/SDK"
+ target="_blank">https://developer.att.com/SDK</a> and <a href="http://developer.att.com/docs"
+ target="_blank">https://developer.att.com/docs</a>
<br />
For more information contact <a href="mailto:developer.support@att.com">developer.support@att.com</a></p>
</div>
View
27 MSSDK/csharp/payment/app2/Default.aspx.cs
@@ -1,6 +1,6 @@
// <copyright file="Default.aspx.cs" company="AT&amp;T">
-// Licensed by AT&amp;T under 'Software Development Kit Tools Agreement.' 2013
-// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
+// Licensed by AT&amp;T under 'AT&T SDK Tools Agreement' 2013
+// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
// Copyright 2013 AT&amp;T Intellectual Property. All rights reserved. http://developer.att.com
// For more information contact developer.support@att.com
// </copyright>
@@ -182,11 +182,6 @@ public partial class Payment_App2 : System.Web.UI.Page
/// </summary>
private List<KeyValuePair<string, string>> subsRefundList = new List<KeyValuePair<string, string>>();
- /// <summary>
- /// Gets or sets the value of transaction amount.
- /// </summary>
- private string MinSubscriptionAmount, MaxSubscriptionAmount;
-
#endregion
#region Payment App1 events
@@ -631,11 +626,11 @@ private void ReadTransactionParametersFromConfigurationFile()
this.transactionTimeString = String.Format("{0:dddMMMddyyyyHHmmss}", this.transactionTime);
if (Radio_SubscriptionProductType.SelectedIndex == 0)
{
- this.amount = Convert.ToDouble(this.MinSubscriptionAmount);
+ this.amount = 1.99;
}
else if (Radio_SubscriptionProductType.SelectedIndex == 1)
{
- this.amount = Convert.ToDouble(this.MaxSubscriptionAmount);
+ this.amount = 3.99;
}
this.description = "TrDesc" + this.transactionTimeString;
@@ -941,20 +936,6 @@ private void WriteSubsDetailsToFile(string transactionid, string merchantTransac
/// <returns>true/false; true if able to read from config file and able to instantiate values; else false</returns>
private bool Initialize()
{
- this.MinSubscriptionAmount = ConfigurationManager.AppSettings["MinSubscriptionAmount"];
- if (string.IsNullOrEmpty(this.MinSubscriptionAmount))
- {
- this.MinSubscriptionAmount = "0.00";
- }
- lstMinAmount.Text = "Subscribe for " + this.MinSubscriptionAmount + " per month";
-
- this.MaxSubscriptionAmount = ConfigurationManager.AppSettings["MaxSubscriptionAmount"];
- if (string.IsNullOrEmpty(this.MaxSubscriptionAmount))
- {
- this.MaxSubscriptionAmount = "3.99";
- }
- lstMaxAmount.Text = "Subscribe for " + this.MaxSubscriptionAmount + " per month";
-
this.apiKey = ConfigurationManager.AppSettings["api_key"];
if (string.IsNullOrEmpty(this.apiKey))
{
View
16 MSSDK/csharp/payment/app2/README.txt
@@ -1,5 +1,5 @@
******************************************************************************************
-* Licensed by AT&T under 'Software Development Kit Tools Agreement.' June 2012
+* Licensed by AT&T under 'AT&T SDK Tools Agreement' 2013
* Copyright 2013 AT&T Intellectual Property. All rights reserved. http://developer.att.com
* For more information contact developer.support@att.com<mailto:developer.support@att.com>
******************************************************************************************
@@ -20,7 +20,7 @@ to sign the payload first.
This file describes how to set up, configure and run AT&T MSSDK C#.NET sample
applications. It covers all steps required to register the application on
-DevConnect and, based on the generated API keys and secrets, create and run
+https://developer.att.com/ and, based on the generated API keys and secrets, create and run
one's own full-fledged sample applications.
1. Configuration
@@ -32,10 +32,10 @@ one's own full-fledged sample applications.
1. Configuration
Configuration consists of a few steps necessary to get an application registered
- on DevConnect with the proper services and endpoints, depending on the type of
+ on https://developer.att.com/ with the proper services and endpoints, depending on the type of
client-side application (autonomous/non-autonomous).
- To register an application, go to https://devconnect-api.att.com/ and login with
+ To register an application, go to https://developer.att.com/ and login with
your valid username and password. Next, choose "My Apps" from the bar at the top
of the page and click the "Setup a New Application" button.
@@ -58,10 +58,10 @@ to use this sample application code.
secret, so these values in your application should be adjusted accordingly.
Depending on the kind of authentication used, an application may be based on either
- the Autonomous Client or the Web-Server Client OAuth flow (see
- https://devconnect-api.att.com/docs/oauth20/autonomous-client-application-oauth-flow or
- https://devconnect-api.att.com/docs/oauth20/web-server-client-application-oauth-flow
- respectively).
+ the Autonomous Client or the Web-Server Client OAuth flow (see OAuth section in
+ https://developer.att.com/docs).
+
+
View
6 MSSDK/csharp/payment/app2/Web.config
@@ -50,12 +50,6 @@
<!-- This is optional key, which will allow to display the defined number of subscriptions, default is 5
example: value="5"-->
<add key="subsDetailsCountToDisplay" value=""/>
-
- <!-- This is optional key, which will allow to display the minimum subscription amount for option 1-->
- <add key="MinSubscriptionAmount" value=""/>
-
- <!-- This is optional key, which will allow to display the maximum subscription amount for option 2-->
- <add key="MaxSubscriptionAmount" value=""/>
</appSettings>
</configuration>
View
4 MSSDK/csharp/payment/app2/listener/Default.aspx.cs
@@ -1,6 +1,6 @@
// <copyright file="Default.aspx.cs" company="AT&amp;T">
-// Licensed by AT&amp;T under 'Software Development Kit Tools Agreement.' 2013
-// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
+// Licensed by AT&amp;T under 'AT&T SDK Tools Agreement' 2013
+// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
// Copyright 2013 AT&amp;T Intellectual Property. All rights reserved. http://developer.att.com
// For more information contact developer.support@att.com
// </copyright>
View
4 MSSDK/csharp/sms/app1/README.txt
@@ -83,10 +83,6 @@ web.config as specified below:
4) short_code : This is mandatory parameter, set the value as per your
registered application 'Short Code' field value.
-5) deiveryStatusFilePath : This is mandatory key, which will point to the file, which is used by application to store
- the received online delivery status messages.
-
-6) numberOfDeliveryStatusToStore : This is optional parameter, these many records will be stored in file
Note: If your application is promoted from Sandbox environment to Production
environment and you decide to use production application settings, you must update
View
12 MSSDK/csharp/speech/app1/Web.config
@@ -12,15 +12,15 @@
<!-- This is mandatory parameter, set the value as per your registered
application 'API key' field value. -->
- <add key="apiKey" value=""/>
+ <add key="apiKey" value="5beda10838857cd63ab942203de4db9d"/>
<!-- This is mandatory parameter, set the value as per your registered
application 'Secret key' field value. -->
- <add key="secretKey" value=""/>
+ <add key="secretKey" value="b9162d1bcd1ca9d3"/>
<!-- This is mandatory parameter, set it to the end point URI of AT&T
Service. -->
- <add key="endPoint" value=""></add>
+ <add key="endPoint" value="https://api.att.com/"></add>
<!-- This is optional parameter, which points to the default wav file,
which will act as a sample to show speech conversion when user has not
@@ -30,15 +30,15 @@
<!-- This is optional key, the value of the this key is sent as a X-Agr hearder.
which should contain name value pair separated by semicolan Ex: name=value,name1=value1 -->
- <add key="X-Arg" value="ClientApp=SpeechApp"/>
+ <add key="X-Arg" value="ClientApp=SpeechApp,ClientVersion=2_2,ClientScreen=Browser,ClientSdk=MSSDK,DeviceType=WebServer,DeviceOs=Windows"/>
<!-- This is optional key, the value of the this key is sent as a X-Agr hearder for TV Context.
which should contain name value pair separated by semicolan Ex: name=value,name1=value1 Search=True,Lineup=91983 -->
- <add key="X-ArgTVContext" value="Search=True,Lineup=91983"/>
+ <add key="X-ArgTVContext" value="ClientApp=SpeechApp,ClientVersion=2_2,ClientScreen=Browser,ClientSdk=MSSDK,DeviceType=WebServer,DeviceOs=Windows,Search=True,Lineup=91983"/>
<!-- This is optional key, the value of the this key is sent as a X-Agr hearder for TV Context.
which should contain name value pair separated by semicolan Ex: name=value,name1=value1 Search=True,Lineup=91983 -->
- <add key="X-ArgSocialMedia" value="ClientApp=SpeechApps"/>
+ <add key="X-ArgSocialMedia" value="ClientApp=SpeechApp,ClientVersion=2_2,ClientScreen=Browser,ClientSdk=MSSDK,DeviceType=WebServer,DeviceOs=Windows"/>
<!-- This is mandatory key, the value of the this key is used to populate Speech Context drop down list.
The value of this key should contain list of speech context values separated by semicolan -->
View
266 MSSDK/csharp/speechCustom/app1/Default.aspx
@@ -0,0 +1,266 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="SpeechCustom_App1" %>
+
+<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -->
+<!DOCTYPE html>
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<head>
+ <title>AT&amp;T Sample Speech Application - Speech to Text Application</title>
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
+ <link rel="stylesheet" type="text/css" href="style/common.css" />
+ <script>
+ function ChangeAudioFile() {
+ var audioDropdown = document.getElementById("ddlAudioFile");
+ var selectedFile = audioDropdown.options[audioDropdown.selectedIndex].text;
+ var playme = document.getElementById('playme');
+ playme.src = "audio/" + selectedFile;
+ playme.load();
+ }
+ </script>
+</head>
+<body onload="ChangeAudioFile();">
+ <form id="form1" runat="server">
+ <div id="container">
+ <!-- open HEADER -->
+ <div id="header">
+ <div>
+ <div class="hcRight">
+ <asp:Label ID="lblServerTime" runat="server"></asp:Label>
+ </div>
+ <div class="hcLeft">
+ Server Time:</div>
+ </div>
+ <div>
+ <div class="hcRight">
+ <script language="JavaScript" type="text/javascript">
+ var myDate = new Date();
+ document.write(myDate);
+ </script>
+ </div>
+ <div class="hcLeft">
+ Client Time:</div>
+ </div>
+ <div>
+ <div class="hcRight">
+ <script language="JavaScript" type="text/javascript">
+ document.write("" + navigator.userAgent);
+ </script>
+ </div>
+ <div class="hcLeft">
+ User Agent:</div>
+ </div>
+ <br clear="all" />
+ </div>
+ <div>
+ <div class="content">
+ <h1>
+ AT&amp;T Sample Speech Application - Custom Speech to Text Application</h1>
+ <h2>
+ Feature 1: Speech to Text</h2>
+ </div>
+ </div>
+ <br />
+ <div>
+ <table border="0">
+ <tbody>
+ <tr>
+ <td align="right" class="label" style="width:10%;">
+ Speech Context:
+ </td>
+ <td class="cell">
+ <asp:DropDownList ID="ddlSpeechContext" runat="server" style="margin-left: 0px">
+ </asp:DropDownList>
+ </td>
+ </tr>
+ <tr>
+ <td valign="middle" class="label" align="right">
+ Audio File:
+ </td>
+ <td class="cell">
+ <asp:DropDownList ID="ddlAudioFile" runat="server" onchange="ChangeAudioFile();"></asp:DropDownList>
+
+ <%--<input type="button" style="font-size: 10px;" OnClick="var playme = document.getElementById('playme'); playme.src = 'audio/pizza-en-US.WAV'; playme.load();" value="Listen" />--%>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><audio id="playme" controls="controls" src="audio/pizza-en-US.wav"></audio> </td>
+ </tr>
+ <tr>
+ <td valign="middle" class="label" align="right">
+ X-Arg:
+ </td>
+ <td>
+ <asp:Label ID="txtXArgs" runat="server" TextMode="MultiLine" Enabled="False" Rows="6" Width="650px"></asp:Label>
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="middle" class="label" align="right">
+ MIME Data:
+ </td>
+ <td>
+ <asp:TextBox ID="txtMimeData" runat="server" TextMode="MultiLine" Enabled="False" Rows="7" Width="650px"></asp:TextBox>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+ <asp:Button runat="server" ID="btnSubmit" Text="Submit" OnClick="SpeechToTextButton_Click" />
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td align="left">
+ <asp:Panel ID="statusPanel" runat="server" Font-Names="Calibri" Font-Size="XX-Small"></asp:Panel></td>
+ </tr>
+ <%-- </tbody>
+ </table>
+ </div>
+ <br clear="all" />
+ <div align="left">
+ <asp:Panel ID="statusPanel" runat="server" Font-Names="Calibri" Font-Size="XX-Small" HorizontalAlign="Left">
+ </asp:Panel>
+ </div>
+ <div>--%>
+ <tr>
+ <td></td>
+ <td>
+ <asp:Panel ID="resultsPanel" runat="server" BorderWidth="0" Width="80%">
+ <table cellpadding="5" cellspacing="1" border="0">
+ <thead>
+ <tr>
+ <th width="30%" class="label">
+ Parameter
+ </th>
+ <th width="70%" class="label">
+ Value
+ </th>
+ </tr>
+ </thead>
+ <tr>
+ <td class="cell">
+ <i>Status </i>
+ </td>
+ <td class="cell">
+ <i>
+ <asp:Label ID="lblStatus" runat="server"></asp:Label>
+ </i>
+ </td>
+ </tr>
+ <tr>
+ <td class="cell">
+ <i>ResponseId </i>
+ </td>
+ <td class="cell">
+ <i>
+ <asp:Label ID="lblResponseId" runat="server"></asp:Label>
+ </i>
+ </td>
+ </tr>
+ <tr>
+ <td class="cell">
+ <i>Hypothesis </i>
+ </td>
+ <td class="cell">
+ <i>
+ <asp:Label ID="lblHypothesis" runat="server"></asp:Label>
+ </i>
+ </td>
+ </tr>
+ <tr>
+ <td class="cell">
+ <i>LanguageId </i>
+ </td>
+ <td class="cell">
+ <i>
+ <asp:Label ID="lblLanguageId" runat="server"></asp:Label>
+ </i>
+ </td>
+ </tr>
+ <tr>
+ <td class="cell">
+ <i>Confidence </i>
+ </td>
+ <td class="cell">
+ <i>
+ <asp:Label ID="lblConfidence" runat="server"></asp:Label>
+ </i>
+ </td>
+ </tr>
+ <tr>
+ <td class="cell">
+ <i>Grade </i>
+ </td>
+ <td class="cell">
+ <i>
+ <asp:Label ID="lblGrade" runat="server"></asp:Label>
+ </i>
+ </td>
+ </tr>
+ <tr>
+ <td class="cell">
+ <i>ResultText </i>
+ </td>
+ <td class="cell">
+ <i>
+ <asp:Label ID="lblResultText" runat="server"></asp:Label>
+ </i>
+ </td>
+ </tr>
+ <tr>
+ <td class="cell">
+ <i>Words </i>
+ </td>
+ <td class="cell">
+ <i>
+ <asp:Label ID="lblWords" runat="server"></asp:Label>
+ </i>
+ </td>
+ </tr>
+ <tr>
+ <td class="cell">
+ <i>WordScores </i>
+ </td>
+ <td class="cell">
+ <i>
+ <asp:Label ID="lblWordScores" runat="server"></asp:Label>
+ </i>
+ </td>
+ </tr>
+ </table>
+ </asp:Panel>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <!--</div>-->
+ <br clear="all" />
+ <div align="center">
+ </div>
+ <br clear="all" />
+ <div id="footer">
+ <div style="float: right; width: 20%; font-size: 9px; text-align: right">
+ Powered by AT&amp;T Cloud Architecture</div>
+ <p>
+ &#169; 2013 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/"
+ target="_blank">http://developer.att.com</a>
+ <br />
+ The Application hosted on this site are working examples intended to be used for
+ reference in creating products to consume AT&amp;T Services and not meant to be
+ used as part of your product. The data in these pages is for test purposes only
+ and intended only for use as a reference in how the services perform.
+ <br />
+ For download of tools and documentation, please go to <a href="http://developer.att.com/SDK"
+ target="_blank">https://developer.att.com/SDK</a> and <a href="http://developer.att.com/docs"
+ target="_blank">https://developer.att.com/docs</a>
+ <br />
+ For more information contact <a href="mailto:developer.support@att.com">developer.support@att.com</a></p>
+ </div>
+ </div>
+ <p>
+ &nbsp;</p>
+ </form>
+</body>
+</html>
View
395 MSSDK/csharp/speechCustom/app1/Default.aspx.cs
@@ -0,0 +1,395 @@
+// <copyright file="Default.aspx.cs" company="AT&amp;T">
+// Licensed by AT&amp;T under 'Software Development Kit Tools Agreement.' 2013
+// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com
+// Copyright 2013 AT&amp;T Intellectual Property. All rights reserved. http://developer.att.com
+// For more information contact developer.support@att.com
+// </copyright>
+
+#region Application References
+
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.IO;
+using System.Net;
+using System.Net.Security;
+using System.Security.Cryptography.X509Certificates;
+using System.Web.UI.WebControls;
+using ATT_MSSDK;
+using ATT_MSSDK.Speechv3;
+using System.Data;
+
+#endregion
+
+/*
+ * This Application demonstrates usage of AT&T MS SDK wrapper library for converting speech to text
+ * by passing inline grammar and inline hints as additional data set along with the audio.
+ *
+ * Pre-requisite:
+ * -------------
+ * The developer has to register his application in AT&T Developer Platform website, for the scope
+ * of AT&T services to be used by application. AT&T Developer Platform website provides a ClientId
+ * and client secret on registering the application.
+ *
+ * Steps to be followed by the application to invoke Speech APIs exposed by MS SDK wrapper library:
+ * --------------------------------------------------------------------------------------------
+ * 1. Import ATT_MSSDK and ATT_MSSDK.Speechv3 NameSpace.
+ * 2. Create an instance of RequestFactory class provided in MS SDK library. The RequestFactory manages
+ * the connections and calls to the AT&T API Platform.Pass clientId, ClientSecret and scope as arguments
+ * while creating RequestFactory instance.
+ *
+ * Note: Scopes that are not configured for your application will not work.
+ * For example, your application may be configured in the AT&T API Platform to support the Payment and SMS scopes.
+ * The RequestFactory may specify any combination of Payment or SMS. You may specify other scopes, but they will not work.
+ *
+ * 3.Invoke the custom speech related APIs exposed in the RequestFactory class of MS SDK library.
+ *
+ * For speech services MS SDK library provides APIs SpeechToText()
+ * This methods returns SpeechResponse object.
+
+ * Sample code for converting text to speech:
+ * ----------------------------
+ List<RequestFactory.ScopeTypes> scopes = new List<RequestFactory.ScopeTypes>();
+ scopes.Add(RequestFactory.ScopeTypes.STTC);
+ RequestFactory requestFactory = new RequestFactory(endPoint, apiKey, secretKey, scopes, null, null);
+ SpeechResponse resp = requestFactory.SpeechToText(fileToConvert,dictionaryFile,grammarFile, speechContext, this.xArgData);
+ */
+
+/// <summary>
+/// SpeechCustom_App1 class
+/// </summary>
+public partial class SpeechCustom_App1 : System.Web.UI.Page
+{
+ #region Class Variables and Constructor
+ /// <summary>
+ /// Request Factory object for calling api functions
+ /// </summary>
+ private RequestFactory requestFactory = null;
+
+ /// <summary>
+ /// Application Service specific variables
+ /// </summary>
+ private string apiKey, secretKey, endPoint;
+
+ /// <summary>
+ /// X-Arg parameter
+ /// A meta parameter to define multiple parameters within a single HTTP header.
+ /// </summary>
+ private string xArgData;
+
+ /// <summary>
+ /// variable for having the posted file.
+ /// </summary>
+ private string SpeechFilesDir;
+
+ /// <summary>
+ /// Variable for path of the file containing inline hints
+ /// </summary>
+ private string dictionaryFilePath;
+
+ /// <summary>
+ /// Variable for path of the file containing inline grammar
+ /// </summary>
+ private string grammarFilePath;
+
+ #endregion
+
+ #region SpeechToTextCustom Application Events
+
+ /// <summary>
+ /// This function is called when the application page is loaded into the browser.
+ /// </summary>
+ /// <param name="sender">Button that caused this event</param>
+ /// <param name="e">Event that invoked this function</param>
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ BypassCertificateError();
+ resultsPanel.Visible = false;
+ this.Initialize();
+ this.SetContent();
+ }
+
+ /// <summary>
+ /// Method that calls SpeechToText Custom method of RequestFactory when user clicked on submit button
+ /// </summary>
+ /// <param name="sender">sender that invoked this event</param>
+ /// <param name="e">event args of the button</param>
+ protected void SpeechToTextButton_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ string fileToConvert = this.SpeechFilesDir + "/" + ddlAudioFile.SelectedValue;
+
+ XSpeechCustomContext speechContext = XSpeechCustomContext.GenericHints;
+ string contentLanguage = string.Empty;
+
+ switch (ddlSpeechContext.SelectedValue)
+ {
+ case "GenericHints":
+ speechContext = XSpeechCustomContext.GenericHints;
+ break;
+
+ case "GrammarList":
+ speechContext = XSpeechCustomContext.GrammarList;
+ break;
+ }
+
+ string dictionaryFile = Request.MapPath(this.dictionaryFilePath);
+ string grammarFile = Request.MapPath(this.grammarFilePath);
+
+ SpeechResponse response = this.requestFactory.SpeechToTextCustom(fileToConvert, dictionaryFile, grammarFile, speechContext);
+
+ if (null != response)
+ {
+ resultsPanel.Visible = true;
+ this.DrawPanelForSuccess(statusPanel, "Response Parameters listed below");
+ this.DisplayResult(response);
+ }
+ }
+ catch (InvalidScopeException invalidscope)
+ {
+ this.DrawPanelForFailure(statusPanel, invalidscope.Message);
+ }
+ catch (ArgumentException argex)
+ {
+ this.DrawPanelForFailure(statusPanel, argex.Message);
+ }
+ catch (InvalidResponseException ie)
+ {
+ this.DrawPanelForFailure(statusPanel, ie.Body);
+ }
+ catch (Exception ex)
+ {
+ this.DrawPanelForFailure(statusPanel, ex.Message);
+ }
+ }
+
+ #endregion
+
+ #region SpeechToTextCustom service functions
+
+ /// <summary>
+ /// Initializes a new instance of the Speech_app1 class. This constructor reads from Config file and initializes Request Factory object
+ /// </summary>
+ private void Initialize()
+ {
+ DateTime currentServerTime = DateTime.UtcNow;
+ lblServerTime.Text = String.Format("{0:ddd, MMM dd, yyyy HH:mm:ss}", currentServerTime) + " UTC";
+ this.ReadConfigAndInitialize();
+ }
+
+ /// <summary>
+ /// Display success message
+ /// </summary>
+ /// <param name="panelParam">Panel to draw success message</param>
+ /// <param name="message">Message to display</param>
+ private void DrawPanelForSuccess(Panel panelParam, string message)
+ {
+ if (null != panelParam && panelParam.HasControls())
+ {
+ panelParam.Controls.Clear();
+ }
+
+ Table table = new Table();
+ table.CssClass = "successWide";
+ table.Font.Name = "Sans-serif";
+ table.Font.Size = 9;
+ TableRow rowOne = new TableRow();
+ TableCell rowOneCellOne = new TableCell();
+ rowOneCellOne.Font.Bold = true;
+ rowOneCellOne.Text = "SUCCESS:";
+ rowOne.Controls.Add(rowOneCellOne);
+ table.Controls.Add(rowOne);
+ TableRow rowTwo = new TableRow();
+ TableCell rowTwoCellTwo = new TableCell();
+ rowTwoCellTwo.Text = message.ToString();
+ rowTwo.Controls.Add(rowTwoCellTwo);
+ table.Controls.Add(rowTwo);
+ panelParam.Controls.Add(table);
+ }
+
+ /// <summary>
+ /// Displays error message
+ /// </summary>
+ /// <param name="panelParam">Panel to draw success message</param>
+ /// <param name="message">Message to display</param>
+ private void DrawPanelForFailure(Panel panelParam, string message)
+ {
+ if (null != panelParam && panelParam.HasControls())
+ {
+ panelParam.Controls.Clear();
+ }
+
+ Table table = new Table();
+ table.CssClass = "errorWide";
+ table.Font.Name = "Sans-serif";
+ table.Font.Size = 9;
+ TableRow rowOne = new TableRow();
+ TableCell rowOneCellOne = new TableCell();
+ rowOneCellOne.Font.Bold = true;
+ rowOneCellOne.Text = "ERROR:";
+ rowOne.Controls.Add(rowOneCellOne);
+ table.Controls.Add(rowOne);
+ TableRow rowTwo = new TableRow();
+ TableCell rowTwoCellOne = new TableCell();
+ rowTwoCellOne.Text = message.ToString();
+ rowTwo.Controls.Add(rowTwoCellOne);
+ table.Controls.Add(rowTwo);
+ panelParam.Controls.Add(table);
+ }
+
+ /// <summary>
+ /// Displays the result onto the page
+ /// </summary>
+ /// <param name="speechResponse">SpeechResponse received from api</param>
+ private void DisplayResult(SpeechResponse speechResponse)
+ {
+ statusPanel.Visible = true;
+ lblStatus.Text = speechResponse.Recognition.Status;
+ lblResponseId.Text = speechResponse.Recognition.Responseid;
+ foreach (NBest nbest in speechResponse.Recognition.NBest)
+ {
+ lblHypothesis.Text = nbest.Hypothesis;
+ lblLanguageId.Text = nbest.LanguageId;
+ lblResultText.Text = nbest.ResultText;
+ lblGrade.Text = nbest.Grade;
+ lblConfidence.Text = nbest.Confidence.ToString();
+ string words = "[ ";
+ if (null != nbest.Words)
+ {
+ foreach (string word in nbest.Words)
+ {
+ words += "\"" + word + "\", ";
+ }
+ words = words.Substring(0, words.LastIndexOf(","));
+ words = words + " ]";
+ }
+
+ lblWords.Text = nbest.Words != null ? words : string.Empty;
+
+ if (null != nbest.WordScores)
+ {
+ lblWordScores.Text = "[ " + string.Join(", ", nbest.WordScores.ToArray()) + " ]";
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Neglect the ssl handshake error with authentication server
+ /// </summary>
+ private static void BypassCertificateError()
+ {
+ ServicePointManager.ServerCertificateValidationCallback +=
+ delegate(object sender1, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
+ {
+ return true;
+ };
+ }
+
+ /// <summary>
+ /// Read from config and initialize RequestFactory object
+ /// </summary>
+ /// <returns>true/false; true - if able to read from config file; else false</returns>
+ private bool ReadConfigAndInitialize()
+ {
+ this.apiKey = ConfigurationManager.AppSettings["apiKey"];
+ if (string.IsNullOrEmpty(this.apiKey))
+ {
+ this.DrawPanelForFailure(statusPanel, "apiKey is not defined in the config file");
+ return false;
+ }
+
+ this.secretKey = ConfigurationManager.AppSettings["secretKey"];
+ if (string.IsNullOrEmpty(this.secretKey))
+ {
+ this.DrawPanelForFailure(statusPanel, "secretKey is not defined in the config file");
+ return false;
+ }
+
+ this.endPoint = ConfigurationManager.AppSettings["endpoint"];
+ if (string.IsNullOrEmpty(this.endPoint))
+ {
+ this.DrawPanelForFailure(statusPanel, "endpoint is not defined in the config file");
+ return false;
+ }
+
+ if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["SpeechFilesDir"]))
+ {
+ this.SpeechFilesDir = Request.MapPath(ConfigurationManager.AppSettings["SpeechFilesDir"]);
+ }
+
+ this.xArgData = ConfigurationManager.AppSettings["X-Arg"];
+ this.grammarFilePath = ConfigurationManager.AppSettings["X-Grammar"];
+ this.dictionaryFilePath = ConfigurationManager.AppSettings["X-Dictionary"];
+ txtXArgs.Text = this.xArgData.Replace(",", "," + Environment.NewLine);
+
+ if (!Page.IsPostBack)
+ {
+ string speechContxt = ConfigurationManager.AppSettings["SpeechContext"];
+ if (!string.IsNullOrEmpty(speechContxt))
+ {
+ string[] speechContexts = speechContxt.Split(';');
+ foreach (string speechContext in speechContexts)
+ {
+ ddlSpeechContext.Items.Add(speechContext);
+ }
+
+ if (ddlSpeechContext.Items.Count > 0)
+ {
+ ddlSpeechContext.Items[0].Selected = true;
+ }
+ }
+
+ if (!string.IsNullOrEmpty(SpeechFilesDir))
+ {
+ string[] filePaths = Directory.GetFiles(this.SpeechFilesDir);
+ foreach (string filePath in filePaths)
+ {
+ ddlAudioFile.Items.Add(Path.GetFileName(filePath));
+ }
+
+ if (filePaths.Length > 0)
+ {
+ ddlAudioFile.Items[0].Selected = true;
+ }
+ }
+ }
+
+ List<RequestFactory.ScopeTypes> scopes = new List<RequestFactory.ScopeTypes>();
+ scopes.Add(RequestFactory.ScopeTypes.STTC);
+
+ this.requestFactory = new RequestFactory(this.endPoint, this.apiKey, this.secretKey, scopes, null, null);
+
+ return true;
+ }
+
+ /// <summary>
+ /// Populate the controls on the page.
+ /// </summary>
+ private void SetContent()
+ {
+ string xdictionaryContent = string.Empty;
+ string xgrammerContent = string.Empty;
+ string dictionaryFile = Request.MapPath(this.dictionaryFilePath);
+ string grammarFile = Request.MapPath(this.grammarFilePath);
+
+ if (!string.IsNullOrEmpty(dictionaryFilePath) && File.Exists(dictionaryFile))
+ {
+ StreamReader streamReader = new StreamReader(dictionaryFile);
+ xdictionaryContent = streamReader.ReadToEnd();
+ streamReader.Close();
+ txtMimeData.Text = "x-dictionary:" + Environment.NewLine + Environment.NewLine + xdictionaryContent + Environment.NewLine;
+ }
+
+ if (!string.IsNullOrEmpty(grammarFilePath) && File.Exists(grammarFile))
+ {
+ StreamReader streamReader = new StreamReader(grammarFile);
+ xgrammerContent = streamReader.ReadToEnd();
+ streamReader.Close();
+ txtMimeData.Text += Environment.NewLine + "x-grammar:" + Environment.NewLine + Environment.NewLine + xgrammerContent;
+ }
+ }
+
+ #endregion
+}
View
115 MSSDK/csharp/speechCustom/app1/README.txt
@@ -0,0 +1,115 @@
+******************************************************************************************
+* Licensed by AT&T under 'AT&T SDK Tools Agreement' Jan 2013
+* Copyright 2013 AT&T Intellectual Property. All rights reserved. http://developer.att.com
+* For more information contact developer.support@att.com<mailto:developer.support@att.com>
+******************************************************************************************
+
+ AT&T API Samples - Speech app 1
+ --------------------------------
+
+This application allows the user to send an audio file for speech to text
+transcription, and get the transcribed text.
+
+This file describes how to set up, configure and run AT&T MSSDK C#.NET sample
+applications. It covers all steps required to register the application on
+https://developer.att.com/ and, based on the generated API keys and secrets, create and run
+one's own full-fledged sample applications.
+
+ 1. Configuration
+ 2. Installation
+ 3. Parameters
+ 4. Running the application
+
+
+1. Configuration
+
+ Configuration consists of a few steps necessary to get an application registered
+ on https://developer.att.com/ with the proper services and endpoints, depending on the type of
+ client-side application (autonomous/non-autonomous).
+
+ To register an application, go to https://developer.att.com/ and login with
+ your valid username and password. Next, choose "My Apps" from the bar at the top
+ of the page and click the "Setup a New Application" button.
+
+ Fill in the form, in particular all fields marked as "required".
+
+NOTE: You MUST select Speech in the list of services under field 'Services' in
+order to use this sample application code.
+
+ Having your application registered, you will get back an important pair of data:
+ an API key and Secret key. They are necessary to get your applications working
+ with the AT&T Platform APIs.
+
+ Initially your newly registered application is restricted to the "Sandbox"
+ environment only. To move it to production, you may promote it by clicking the
+ "Promote to production" button. Notice that you will get a different API key and
+ secret, so these values in your application should be adjusted accordingly.
+
+ Depending on the kind of authentication used, an application may be based on
+ the Autonomous Client or the Web-Server Client OAuth flow (see OAuth section in
+ https://developer.att.com/docs).
+
+
+
+2. Installation
+
+** Requirements
+
+ To run the examples you need an IIS Server.
+
+ Download the application files from the download link published in AT&T portal
+ into webdomain of your IIS server.
+
+
+
+3. Parameters
+
+Each sample application contains a web.config file. It holds configurable parameters
+described in an easy to read format. Please populate the following parameters in
+web.config as specified below:
+
+1) api_key : This is mandatory parameter, set the value as per your
+ registered application 'API key' field value.
+
+2) secret_key : This is mandatory parameter, set the value as per your
+ registered application 'Secret key' field value.
+
+3) endPoint : This is mandatory parameter, set it to the end point URI
+ of AT&T Service.
+
+4) DefaultFile : This is Optional parameter, which points to the default
+ wav file, which will act as a sample to show speech
+ conversion when user has not selected any wave file using
+ Browse button.
+
+5) X-Arg : This is optional key, the value of the this key is sent as a X-Agr hearder.
+ which should contain name value pair separated by semicolan
+ Ex - ClientApp=SpeechApp,ClientVersion=2_2,ClientScreen=Browser,ClientSdk=MSSDK,
+ DeviceType=WebServer,DeviceOs=Windows
+
+6) X-ArgTVContext : This is optional key, the value of the this key is sent as a X-Agr hearder for TV Context.
+ which should contain name value pair separated by semicolan
+ Ex: ClientApp=SpeechApp,ClientVersion=2_2,ClientScreen=Browser,ClientSdk=MSSDK,
+ DeviceType=WebServer,DeviceOs=Windows,Search=True,Lineup=9198
+