Elsinore

User Forum

www.screenconnect.com
Welcome Guest Search | Active Topics | Log In | Register

Tag as favorite
automatic create session screen connect
oamador2009
#1 Posted : Tuesday, January 04, 2011 4:53:15 AM
Rank: Guest
Joined: 4/9/2010
Posts: 328
OK I have a ticket system in place at my business. It currently take my clients information and create a ticket with a work order number. I will like to have a link that will automatically create a session. For example:

User submit ticket
User receives email with link
When user click on link it will create the session and start the download.

I want them to use the same ticket number for billing purpose.

I am just manual creating them but just wondering if there is an easier way.
Jake Morgan
#2 Posted : Tuesday, January 04, 2011 5:24:38 PM
Rank: Administration
Joined: 4/9/2010
Posts: 858
Yes, you can automate the creation of sessions.

Are you programming this customization yourself? Is it running inside an extension of your ticket system? What platform is that written in? .NET? Java? Windows? Linux?

Also, you may be able to take advantage of unattended system to create sessions as the Guest connects, but then you won't get the advantage of our web site that analyzes their browser for compatibility to deliver the appropriate client.
oamador2009
#3 Posted : Wednesday, January 05, 2011 2:37:11 AM
Rank: Guest
Joined: 4/9/2010
Posts: 328
Yes, you can automate the creation of sessions.

Great to hear this, you have made my day

Are you programming this customization yourself?

Yes, I will try to program this customization myself.

Is it running inside an extension of your ticket system?

I am not sure what you mean with this but I already have the ticket system in place and it runs under linux with php. I currently have two server one for tickets and another for remote session.

What platform is that written in? .NET? Java? Windows? Linux?
Linux with php

Also, you may be able to take advantage of unattended system to create sessions as the Guest connects, but then you won't get the advantage of our web site that analyzes their browser for compatibility to deliver the appropriate client.

Currently we only have a few clients that we have setup unattended. Everyone else visit the site and and enters there invitation code.

My ticket currently can generate invitation code and display it even adds it to the url.

Maybe with this you can show me an example of the script that i would need on the Screen Connect side. I can handle the php. Will I hope i can :)
Guest
#4 Posted : Wednesday, January 05, 2011 4:33:55 AM
Rank: Guest
Joined: 4/9/2010
Posts: 328
Also can i create a session with parameter in the URL

this will solve everything if i could do this.
Jake Morgan
#5 Posted : Wednesday, January 05, 2011 1:54:36 PM
Rank: Administration
Joined: 4/9/2010
Posts: 858
Yes, that will probably be the easiest way. In your ScreenConnect install directory with all of the other files, you can create a new file to do this. Here is the source:

Code:
<%@ WebHandler Language="C#" Class="CreateSession" %>

using System;
using System.Web;

public class CreateSession : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        var sessionCode = context.Request.QueryString["Code"];
        
        using (var sessionManager = Elsinore.ScreenConnect.ServerExtensions.SessionManagerChannelFactory.CreateChannel())
        {
            sessionManager.CreateSession(Elsinore.ScreenConnect.InvitationType.Code, sessionCode, "System");
        }
    }

    public bool IsReusable { get { return false; } }
}


Name the file CreateSession.ashx (attached as .txt). Create a session by going to http://yourscreenconnectsite/CreateSession.ashx?Code=mycode

Let me know how this works for you.
File Attachment(s):
CreateSession.txt (1kb) downloaded 57 time(s).
oamador2009
#6 Posted : Wednesday, January 05, 2011 2:55:04 PM
Rank: Guest
Joined: 4/9/2010
Posts: 328
It work perfectly

Thank You every much!
oamadorr2009
#7 Posted : Thursday, January 06, 2011 6:18:49 AM
Rank: Guest
Joined: 4/9/2010
Posts: 328
Now i ran into a problem i have to add a redirect to the end of the file so the user does not get stuck with a white screen.
I tried this but it does not work it gives me error message
Code:

<script runat="server">
    void Application_BeginRequest(object sender, EventArgs e)
    {
        if (string.Compare(this.Request.Url.AbsolutePath, "/foo/p1.aspx", StringComparison.OrdinalIgnoreCase) == 0)
        {
            this.Response.Redirect("/foo/p2.aspx", true);   
        }
    }
</script>


and

Code:

'Response.Redirect("Reporting/ReportOption.aspx")


do you think you can help

Thank you
Jake Morgan
#8 Posted : Friday, January 07, 2011 4:12:25 PM
Rank: Administration
Joined: 4/9/2010
Posts: 858
I'm not sure exactly what you're doing with the Application level stuff. But if you want to do a simple redirect from this handler:

Code:
<%@ WebHandler Language="C#" Class="CreateSession" %>

using System;
using System.Web;

public class CreateSession : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        var sessionCode = context.Request.QueryString["Code"];
       
        using (var sessionManager = Elsinore.ScreenConnect.ServerExtensions.SessionManagerChannelFactory.CreateChannel())
        {
            sessionManager.CreateSession(Elsinore.ScreenConnect.InvitationType.Code, sessionCode, "System");
        }

        context.Response.Redirect("MyOtherPage.aspx");
    }

    public bool IsReusable { get { return false; } }
}
mattsteele8
#9 Posted : Thursday, March 10, 2011 5:01:20 PM
Rank: Newbie
Joined: 3/10/2011
Posts: 5
Location: UK
this is genius and very useful. it there any way to auto-join the session that is automatically created??

cheers
Jake Morgan
#10 Posted : Thursday, March 10, 2011 5:42:57 PM
Rank: Administration
Joined: 4/9/2010
Posts: 858
To auto-join, try this:

Code:
<%@ WebHandler Language="C#" Class="CreateSession" %>

using System;
using System.Web;

public class CreateSession : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        var sessionCode = context.Request.QueryString["Code"];
       
        using (var sessionManager = Elsinore.ScreenConnect.ServerExtensions.SessionManagerChannelFactory.CreateChannel())
        {
            var session = sessionManager.CreateSession(Elsinore.ScreenConnect.InvitationType.Code, sessionCode, "System");
            context.Response.Redirect("Host.aspx?" + session.SessionID);
        }
    }

    public bool IsReusable { get { return false; } }
}


Then you'll need to modify your Host.aspx file. The script at the bottom that looks like this:

Code:
    <script type="text/javascript">
        this.launchers = getSortedLaunchers();
        this.poll();
    </script>


Change to this:

Code:
    <script type="text/javascript">
        this.launchers = getSortedLaunchers();
        this.poll();

        if (window.location.search != "")
            PageMethods.GetActiveSessionInfos(window.onGetActiveSessionInfosSuccess, null, window.location.search.substring(1));
    </script>
Jake Morgan
#11 Posted : Thursday, March 10, 2011 5:44:19 PM
Rank: Administration
Joined: 4/9/2010
Posts: 858
And the auto-join stuff doesn't always work with IE because of a security/popup setting, so you should probably test with Firefox/Chrome.

Also keep in mind changes to the Host.aspx file have to be managed during upgrades.
skuliaxe
#12 Posted : Thursday, March 10, 2011 10:06:26 PM
Rank: Advanced Member
Joined: 2/22/2011
Posts: 39
Location: Reykjavik
I really like this feature.
Is there a way to use a small script that generates a random 6 digit number and uses that as the code? This would be nice as if one uses the same link again, I get an error page stating that the Session already exists.
skuliaxe
#13 Posted : Tuesday, March 15, 2011 12:58:01 AM
Rank: Advanced Member
Joined: 2/22/2011
Posts: 39
Location: Reykjavik
If anyone can help me with the 6 digit random number then the help will be greatly apprechiated.

This is my thought, but I lack the asp.net knowledge to finish:
Code:
<%@ WebHandler Language="C#" Class="CreateSession" %>

using System;
using System.Web;

public class CreateSession : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        if(context.Request.QueryString["Code"] != "" && context.Request.QueryString["Code"] != null)
        {
            // If the URL contains a Code then get it
            var sessionCode = context.Request.QueryString["Code"];
        }
            else
            {
                // If the URL does not contain a Code, generate a 6 digit random number
                
            }
       
        using (var sessionManager = Elsinore.ScreenConnect.ServerExtensions.SessionManagerChannelFactory.CreateChannel())
        {
            sessionManager.CreateSession(Elsinore.ScreenConnect.InvitationType.Code, sessionCode, "System");
        }

        context.Response.Redirect("Host.aspx");
    }

    public bool IsReusable { get { return false; } }
}
Jake Morgan
#14 Posted : Tuesday, March 15, 2011 3:08:52 PM
Rank: Administration
Joined: 4/9/2010
Posts: 858
Code:

var sessionCode = context.Request.QueryString["Code"];

if (string.IsNullOrEmpty(sessionCode))
sessionCode = ((uint)new Random().Next()).ToString("000000").Substring(0, 6);
colinvv
#15 Posted : Sunday, July 17, 2011 4:13:40 PM
Rank: Newbie
Joined: 7/17/2011
Posts: 3
Location: Atlanta, GA
Does this method still work in "ScreenConnect_2.3.1751.4211_Debug.msi"?

I am getting this error:

Code:
CS0117: 'Elsinore.ScreenConnect.ServerExtensions' does not contain a definition for 'SessionManagerChannelFactory'
Guest
#16 Posted : Wednesday, September 07, 2011 10:50:10 PM
Rank: Guest
Joined: 4/9/2010
Posts: 328
there is an error with the lastest verison

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0117: 'Elsinore.ScreenConnect.ServerExtensions' does not contain a definition for 'SessionManagerChannelFactory'

Source Error:



Line 10: var sessionCode = context.Request.QueryString["Code"];
Line 11:
Line 12: using (var sessionManager = Elsinore.ScreenConnect.ServerExtensions.SessionManagerChannelFactory.CreateChannel())
Line 13: {
Line 14: sessionManager.CreateSession(Elsinore.ScreenConnect.InvitationType.Code, sessionCode, "System");


Source File: c:\Program Files\ScreenConnect\createsession.ashx Line: 12



Show Detailed Compiler Output:


C:\WINDOWS\system32> "c:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\28315708\1a0475de\assembly\dl3\7b495d60\00f328b1_9b69cc01\Elsinore.ScreenConnect.Server.DLL" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\28315708\1a0475de\App_GlobalResources.yvvbcj7l.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\28315708\1a0475de\assembly\dl3\d1f7898a\000150b8_9b69cc01\Elsinore.ScreenConnect.WindowsClient.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\28315708\1a0475de\assembly\dl3\f86085fd\0099c6ae_9b69cc01\Elsinore.ScreenConnect.Core.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Data.Linq\3.5.0.0__b77a5c561934e089\System.Data.Linq.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\28315708\1a0475de\assembly\dl3\17cb028e\00a7edb5_9b69cc01\Elsinore.ScreenConnect.Client.DLL" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\28315708\1a0475de\assembly\dl3\af496822\00205ab2_9b69cc01\Elsinore.ScreenConnect.Windows.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\28315708\1a0475de\assembly\dl3\5bb96140\007abcb4_9b69cc01\Elsinore.ScreenConnect.Web.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /out:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\28315708\1a0475de\App_Web_createsession.ashx.cdcab7d2.v-dpnw3r.dll" /D:DEBUG /debug+ /optimize- /warnaserror /w:4 /nowarn:1659;1699;1701 "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\28315708\1a0475de\App_Web_createsession.ashx.cdcab7d2.v-dpnw3r.0.cs" "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\28315708\1a0475de\App_Web_createsession.ashx.cdcab7d2.v-dpnw3r.1.cs"


Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.

c:\Program Files\ScreenConnect\createsession.ashx(12,71): error CS0117: 'Elsinore.ScreenConnect.ServerExtensions' does not contain a definition for 'SessionManagerChannelFactory'





Show Complete Compilation Source:


Line 1: #pragma checksum "C:\Program Files\ScreenConnect\CreateSession.ashx" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "3BA210E4882270B8622AED52C8826DA7"
Line 2:
Line 3: #line 1 "C:\Program Files\ScreenConnect\CreateSession.ashx"
Line 4:
Line 5:
Line 6: using System;
Line 7: using System.Web;
Line 8:
Line 9: public class CreateSession : IHttpHandler
Line 10: {
Line 11: public void ProcessRequest(HttpContext context)
Line 12: {
Line 13: var sessionCode = context.Request.QueryString["Code"];
Line 14:
Line 15: using (var sessionManager = Elsinore.ScreenConnect.ServerExtensions.SessionManagerChannelFactory.CreateChannel())
Line 16: {
Line 17: sessionManager.CreateSession(Elsinore.ScreenConnect.InvitationType.Code, sessionCode, "System");
Line 18: }
Line 19: }
Line 20:
Line 21: public bool IsReusable { get { return false; } }
Line 22: }
Line 23:
Line 24: #line default
Line 25: #line hidden
Line 26:

if you could please fix this thank you,
Jake Morgan
#17 Posted : Wednesday, September 07, 2011 11:21:51 PM
Rank: Administration
Joined: 4/9/2010
Posts: 858
replace any line that looks like this:

Code:
using (var sessionManager = Elsinore.ScreenConnect.ServerExtensions.SessionManagerChannelFactory.CreateChannel())


With this:

Code:
using (var sessionManager = Elsinore.ScreenConnect.ServiceChannelPool<Elsinore.ScreenConnect.ISessionManagerChannel>.Instance.Borrow())
Users browsing this topic
Guest
Tag as favorite
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.