use UCMA 3.0 to create a SIP client - sip

I am just wondering if UCMA 3.0 SDK supports this.
I plan to use the SIP client to place a call to a standalone UCMA application, which will use VXML to play a prompt. Thanks.

You need to provision an Application Endpoint first following General application activation steps.
Follow these steps using ucma 3.0 API after :
1) Create a new collaboration platform. Using
X509Certificate2 cert ="your certificate thumb here";
CollaborationPlatform _collabPlatform;
ServerPlatformSettings settings = new ServerPlatformSettings(Name, LocalhostFQDN, ServicePort, ServerGruu, cert);
_collabPlatform = new CollaborationPlatform(settings);
_collabPlatform.AllowedAuthenticationProtocol = SipAuthenticationProtocols.Ntlm;
_collabPlatform.BeginStartup(PlatformStartupCompleted, _collabPlatform);
2) Create a new Endpoint.
Here is the callback.
private void PlatformStartupCompleted(IAsyncResult result)
{
try
{
_collabPlatform.EndStartup(result);
ApplicationEndpointSettings settings = new ApplicationEndpointSettings( AgentUri, ServerFQDN, ServerPort);
// For registered endpoints (recommended).
settings.UseRegistration = true;
_localEndpoint = new ApplicationEndpoint(_collabPlatform, settings);
_localEndpoint.BeginEstablish(EndpointEstablishCompleted, null);
}
catch (ConnectionFailureException connFailEx)
{
// ConnectionFailureException will be thrown when the platform cannot connect.
}
catch (RealTimeException rte)
{
// Any other RealTimeException could occur due to other error.
}
}
}
private void EndpointEstablishCompleted(IAsyncResult result)
{
_localEndpoint.EndEstablish(result);
//Register Event for incoming call here.
}

If i get your question correct, you want to create standalone ucma application which can play prompt when someone call using sip phone. Right? If so it is possible. For the sip phone you can use Phoner lite or xlite. But phoner lite does not support for call transferring.
For create standalone application check this http://www.ksac.com/blog/bid/58799/UCMA-3-0-Programs-Without-Lync-Server

Related

How to use Sustainsys.Saml2.AspNetCore2 in existing net core app?

I'm trying to use Sustainsys.Saml2 and Sustainsys.Saml2.AspNetCore2 library provided by this saml2 library to implement both IDP initiated and SP initiated scenarios.
After referring sample appliation things I did so far:
1. Refer latest Sustainsys.Saml2.AspNetCore2 and Sustainsys.Saml2 via nuget
2. Modified Startup.cs to add new options
3. Created MVC controller with ACS end point
Things I'm trying to understand:
1. Do I need to Initiated Saml2Handler so that I can hit HandleRequestAsync() end point of library.
2. How to retrive principal/claims
3. For sp initiated case when end point identifies request is not authenticated how to redirect request to IDP?
ConfigureServices method in startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication()
.AddSaml2(options =>
{
options.SPOptions.EntityId = new EntityId("https://localhost:3131/Saml2");
options.IdentityProviders.Add(
new IdentityProvider(
new EntityId("http://localhost:52071/Metadata"), options.SPOptions)
{
LoadMetadata = true
});
options.SPOptions.ServiceCertificates.Add(new X509Certificate2("Sustainsys.Saml2.Tests.pfx"));
});
}
**SSO Controller**
[Authorize(AuthenticationSchemes = "Saml2")]
public class SsoController : Controller
{
public SingleSignOnController(ILogger logger)
{
}
[Route("saml2/ACS")]
[HttpPost]
public ActionResult ACS()
{
try
{
// Is request authenticated here by library?
// I tried hitting this end point from stud idp portal, but it is
throwing " MVC Exception Handler: The method or operation is not implemented. at Sustainsys.Saml2.AspNetCore2.Saml2Handler.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService"
}
catch (Exception e)
{
}
}
}
Do I need to create/implement Custom Saml2Handler and inject it in SSo controller? I could not find exact end point in this ASPNETSAMPLE project for saml2/ACS?
What I'm missing ?
The Acs endpoint is built into the handler. Remove your SsoController.
Check the asp.net core sample applications in the repo for an example on how to configure. The AspNetCore2 package contains a handler that works the same as any other external authentication handler for Asp.NET Core. You initiate the sign in sequence by an authentication challenge.

Firebase: Authenticate an existing user using REST API and Firebases hidden Auth URL

For the past 3 years we have used HTML/Js only with Firebase but now we are using Unity as well.
The current Unity/Firebase only works on Android/iOS when deployed and 99% of our work is on the windows store.
I've actually got a pretty decent Unity/Firebase codebase going but it requires me to use a full App Secret.
All the other libraries expose a method to login with Email/Password but the REST API only allows the use of a token or your app secret that it then states is ill advised to put into your client; I guess the thinking is if you're using a different library that you'll have your own auth/user method which we don't...
Now, I've pulled apart the web version and got this:
https://auth.firebase.com/v2/<myfirebase>/auth/password?&email=dennis%40<mysite>&password=<mypassword>v=js-2.2.9&transport=json&suppress_status_codes=true
So there IS an endpoint that I can send stuff to and I've tested it inside unity with good results.
Obviously the URL isn't guaranteed to stay working but I'm wondering if there is any reason NOT to use this?
Also, Why not just expose this endpoint in the official REST API?
As I understand it, that URL will continue to work for your Legacy Firebase project. You will have to do the same sort of reverse engineering if you want to update to the new Firebase 3.0 API. However, if you are still using a legacy Firebase project -- I encourage you to take a look at this. It has not been updated to work with Firebase 3.0 -- so I needed to do something similar to what you did to allow login to the new API.
I was able to do this with the new API using C# as follows (where FirebaseManager is a Singleton I wrote for Global variables and functions to write and read from/to the DB :
Hashtable loginData = new Hashtable();
loginData.Add ("email", <EMAIL-GOES-HERE>);
loginData.Add ("password", <PASSWORD-GOES-HERE>);
loginData.Add ("returnSecureToken", true);
UnityHTTP.Request loginRequest = new UnityHTTP.Request ("post",
"https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key="
+ <YOUR-PROJECT-API-KEY-GOES-HERE>, loginData);
loginRequest.Send ((request) => {
Hashtable jsonResponse = (Hashtable)JSON.JsonDecode(request.response.Text);
if (jsonResponse == null) {
DisplayErrorMessage("Error logging in. Server returned null or malformed response");
}
FirebaseManager.Instance.idToken = (string)jsonResponse["idToken"]; // This is your auth token
FirebaseManager.Instance.uid = (string)jsonResponse["localId"]; // this is your "uid"
});
// I have a list of users in my db keyed by the "uid" -- I access them like this
UnityHTTP.Request fullnameRequest = new UnityHTTP.Request ("get",
<YOUR-DATABASE-ROOT-URL-HERE>
+ "/users/" + FirebaseManager.Instance.uid + ".json?auth=" + FirebaseManager.Instance.idToken);
fullnameRequest.Send ((request) => {
Debug.Log(request.response.Text);
Hashtable jsonResponse = (Hashtable)JSON.JsonDecode(request.response.Text);
if (jsonResponse == null) {
DisplayErrorMessage("Error getting user info. Server returned null or malformed response");
}
FirebaseManager.Instance.fullname = (string)jsonResponse["fullname"];
FirebaseManager.Instance.groupId = (string)jsonResponse["group"]; // just storing this in memory
});
So I don't think there is any harm in using the URL, just make sure you budget time for more work when things change.

how to handle db connectivity of couchdb with gwt?

I am new to couchdb and I want to learn about how to connect the couchdb in our gwt server side program. till now, I tried to work on its gui to create database add documents and add fields to it.but i am not able to use it in program. what exactly the way to do it..
I tried some code but didn't got it.
In your GWT you should have something like this in your server. Besides it you should have your DAO for your Entities (erktorp takes place here) and your mechanism for connecting GWT's client with the server (for example RequestFactory).
//Object of your own related with couch db management
CouchDbAccess couchDbAccess = null;
#Inject
public CouchDbManagement(String ddbbUrl, String ddbbName) throws IOException {
HttpClient httpClient;
Builder b;
try {
b = new StdHttpClient.Builder().url(ddbbUrl);
} catch (Exception e) {
e.printStackTrace();
ddbbUrl = "http://admin:sa#localhost:5984";
b = new StdHttpClient.Builder();
}
b.socketTimeout(60000);
String user = getUserFrom(ddbbUrl);
String pass = getPassFrom(ddbbUrl);
b.username(user).password(pass);
httpClient = b.build();
CouchDbInstance dbInstance = new StdCouchDbInstance(httpClient);
if (initialize && dbInstance.getAllDatabases().contains(ddbbName)) {
dbInstance.deleteDatabase(ddbbName);
dbInstance = new StdCouchDbInstance(httpClient);
}
//If you want Lucene, here is the place
db.createDatabaseIfNotExists();
new IndexUploader().updateSearchFunctionIfNecessary(db, ...);
new IndexUploader().updateSearchFunctionIfNecessary(db, ...);
URI dbURI = URI.prototype(DbPath.fromString(ddbbName).getPath());
RestTemplate restTemplate = new RestTemplate(dbInstance.getConnection());
couchDbAccess = new CouchDbAccess(db, dbURI, restTemplate);
}
Couchdb has a restful interface to it's api. Everything is available via url's like
http://localhost:5984/db_name/doc_name
In fact the entire http api is documented in the wiki. Now I am not familiar with gwt but every framework has http libraries and you can use those libraries to make calls to couchdb http endpoints.
A quick google search gave me this resource which may guide you on how to create http requests through gwt.

how to maintain a connexion to send realtime data to distant client without request

i'm developing a mobile project the can control a home an receve information from it either from inside or outside of the house. im setting up a port forwarding mechanism on my router to connect to my server if i'm using my application from the outside.
i think that the fact of receving data from the server should be initiated by the client (android app) witch is in an other notwork or it will be blocked.
* is there a solution to receve data (temperature) in real time from the outside simply by just requesting once or i should send a request like evrey minute? * i'm confused because some applications like video streaming receve data from servers by just starting the video player then it receve udp packets automaticly
more spicificlly can i send data from a server to a distant client by just sending a request once (maybe by letting the socket open for every client, VPN , SIP)???
Sending Data to Distant Clients: Securely & Reliably
There is only one reasonably-reliable method for sending a signal to distant clients. I want to confirm your original assumption of sending to clients without request, this is theoretically impossible as the device needs to call home somewhere and notify a broker gateway (SIP) or otherwise of it's address. However please ignore that because the right way will be relayed here with source code.
Security Importance
It is important to realize that opening your firewall is outside of good practices. It is better to hold onto the firewall's lockdown rules for inbound traffic. The following section is a secure method that will allow you to open an outbound connection with maximum security preventing snooping and other unsafe security holes.
Download Android Source Libraries
See instructions here for downloading Android Source Library Files: https://github.com/pubnub/java/tree/master/android
Receiving Data On-Demand from a Distance on Android
You'll need to copy/paste the following code to get things moving forward quickly. Start by taking this Java code and pasting it into your app. Then follow by downloading the library files.
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// ANDROID PHONE
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Pubnub pubnub = new Pubnub(
"", // PUBLISH_KEY (Optional, supply "" to disable)
"demo", // SUBSCRIBE_KEY (REQUIRED)
"", // SECRET_KEY (Optional, supply "" to disable)
"", // CIPHER_KEY (Optional, supply "" to disable)
true // SSL_ON?
);
Hashtable args = new Hashtable(1);
args.put( "channel", "distant-client-ABC-DEF" );
pubnub.subscribe(args, new Callback() {
public void connectCallback(String channel) {
System.out.println("CONNECT on channel:" + channel);
}
public void disconnectCallback(String channel) {
System.out.println("DISCONNECT on channel:" + channel);
}
public void reconnectCallback(String channel) {
System.out.println("RECONNECT on channel:" + channel);
}
public void successCallback(String channel, Object message) {
System.out.println(channel + " " + message.toString());
}
public void errorCallback(String channel, Object message) {
System.out.println(channel + " " + message.toString());
}
});
Send Data On-demand to the Distant Client
On a Java VM on your home computer/systems, you may use the same code to send data securely to the remote distant client. Use the following code to do this:
Download JVM Server Source Libraries
See instructions here for downloading/using JVM Server Source Library Files: https://github.com/pubnub/java/tree/master/java
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// HOME SERVER
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Pubnub pubnub = new Pubnub(
"demo", // PUBLISH_KEY (REQUIRED on Server)
"demo", // SUBSCRIBE_KEY (REQUIRED)
"", // SECRET_KEY (Optional, supply "" to disable)
"", // CIPHER_KEY (Optional, supply "" to disable)
true // SSL_ON?
);
Hashtable args = new Hashtable(1);
args.put( "channel", "distant-client-ABC-DEF" ); // SEND TO CLIENT ABC-DEF
pubnub.publish(args, new Callback() {
public void successCallback(String channel, Object message) {
System.out.println("PUBLISH : " + message);
}
public void errorCallback(String channel, Object message) {
System.out.println("PUBLISH : " + message);
}
});
I'm not into Android world, but isn't it the service you're looking for ? : http://developer.android.com/google/gcm/index.html

Self Signed Applet Can it access Local File Systems

Hi I have created a Self Signed Applet , but not able to access local files system .What have i to do ?
you need to wrap your IO code inside PrivilegedAction.
Generally, you need to sign your applet with your test certificate, the user will see a warning and will have to accept the certificate when it loads the applet.
then you need to wrap your code inside a PriviligedAction. see this for some examples.
The below code is use to Add a Bouncy Castle Jar, the same way you can use it for accessing the file. AccessController java api is used.
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
try{
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); // Here you can write the code for File Accesss
}catch (Exception e) {
return "";
}
return "";
}
});