.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

Making Outgoing call Code

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :.NET Framework
 
// class declaration /* * The dictionary is used here to cache all telephone sessions using * unique SIP as dictionary key. */ private Dictionary<string , IUccSession> callSessions = new Dictionary<string , IUccSession>(); ... // class code string remoteTelUri = "sip:14055550100@contoso.com;user=phone" ; protected IUccSession SessionOut = null ; // class object with protected access public void MakePhonecall(string remoteTelUri) { if (remoteTelUri == string .Empty) return ; //using session manager created in OnEnable callback function, create session and set session type to audio/video SessionOut = this .sm.CreateSession( UCC_SESSION_TYPE.UCCST_AUDIO_VIDEO, null ); //advise new session of session event handler (this) UCC_Advise<_IUccSessionEvents>( SessionOut, this ); //advise new session of session participant collection //event handler (this) UCC_Advise<_IUccSessionParticipantCollectionEvents>( SessionOut, this ); UccUriManager uriMgr = new UccUriManager(); UccUri uri = uriMgr.ParseUri(remoteTelUri); //create a session participant using the passed SIP uri IUccSessionParticipant p = SessionOut.CreateParticipant( uri, null ); IUccAudioVideoSessionParticipant avP = p as IUccAudioVideoSessionPartici


View Complete Post


More Related Resource Links

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

Call Server Side Code from Javascript in VB.NET

  

Hi

Could anyone give me an example how to call Server Side Function from javascript and then I want to call that javascript function on Button OnClick () Event.


Thanks in Advance

Shabbir



Sign outgoing body from client with custom endpoing behavior defined in code

  
I'm trying to sign (and sign only) the body of every outgoing message that uses this custom endpoint behavior.  When I first created this it was for signing a custom SOAP header.  We are moving away from that and going to just sign the body.  We have some applications that have 10+ web service references.  We don't want to touch the reference.cs for anything.  Below is the code I had before for signing the custom soap header.  I'm trying to modify it to just sign the body.  My modified code is below, and the error I get. Private Class CustomHeaderBehavior Implements ServiceModel.Description.IEndpointBehavior Public Sub New() End Sub Private Sub AddBindingParameters( _ ByVal endpoint As ServiceModel.Description.ServiceEndpoint, _ ByVal bindingParameters As ServiceModel.Channels.BindingParameterCollection) _ Implements ServiceModel.Description.IEndpointBehavior.AddBindingParameters Dim body As New Xml.XmlQualifiedName("Body", "http://schemas.xmlsoap.org/soap/envelope/") Dim BodyMsgPartSpec As New ServiceModel.Security.MessagePartSpecification() BodyMsgPartSpec.IsBodyIncluded = True Dim requirements As ServiceModel.Security.ChannelProtectionRequirements = bindingParameters.Remove(Of ServiceModel.Security.ChannelProtectionRequirements)() requirements

No symbols are loaded for any call stack frame. The source code cannot be displayed.

  
Hello.I installed VisualStudio.NET 2005 a few days ago.  ( not beta )While I'm debugging, I'm faced with strange message box.-- MessageBox --No symbols are loaded for any call stack frame. The source code cannot be displayed. -- Debug Detail Window --FatalExecutionEngineError was detectedMessage: The runtime has encountered a fatal error. The address of the error was at 0x7a2b5aec, on thread 0x358. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.How should I solve this problem?Please answer me..Thanks.Gwisun.

Unable to evaluate expression because the code is optimized or a native frame is on top of the call

  
I have some code that gets the exception Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. I have pasted some code below. I have confirmed that I am in mixed mode debugging, (native and managed). I have also confirmed that I am not 'pre-compiline' b4 debugging. the code is for a 'csv' download. Can someone help? Response.Clear(); Response.ClearHeaders(); //set the conttent type of the file to be downloaded (IF NEEDED) Response.ContentType = "application/vnd.ms-excel"; // initialize the http content-disposition header to indicate a file attachment with the filename Response.AppendHeader("Content-Disposition", "Attachment; Filename=\"" + strFileNameCSV + "\""); //// transfer the file byte-by-byte to the response object FileInfo fileToDownload = new FileInfo(strFileNameCSV); Response.Flush(); Response.WriteFile(fileToDownload.FullName); Response.End();

Can you call a javascript function from code behind?

  
Call you cal a javascript function from the code behind? If so how??? 

Authentication timeout while making AJAX call?

  
Hi,I tried to take advantage of jQuery AJAX call to enhance user experience but I am facing a tricky problem.When the user does nothing for a period of time, e.g. 30 minutes to reach authentication timeout, making AJAX call becomes the problem. The server side will return login page and display in my target div section. The simplest solution I can think of is to inject a dummy tag in login page, and when detecting such dummy tag then use javascript to redirect to login page. But this means that I have to do that every time I make AJAX call. Is there any more decent way to do that? Regards,Charlie

Windows Service crashing on call to unmanaged code, even though console app version works

  

I have a C# program that at some point calls 2 functions from an unmanaged dll using p/invoke.  Everything works fine when I'm running in a console app.  When I compile the same program as a windows service and run it, it crashes.  The console app and service should be identical as far as my code is concerned... all either program does is create an object from another assembly of mine and run a Start() method on it.

I have used VS2010 to debug the managed and unmanaged code, and when I step through the Console app everything looks great.  When I attach the debugger to the service, i can step through the first function in the unmanaged code, control returns to the managed code, and then later when it comes to the point where it calls the second unmanaged function, the process terminates immediately before the debugger steps into the first line of unmanaged code.  There are no exceptions that I can see, and the only thing written to the event log is the generic "service terminated unexpectedly" message.  Running "sc query" on the command line lets me know the win32_exit_code is 1067.

Im running everything in .net 4, on winxp 32bit.  The serivce is running as Local System ideally, but the same behavior exists when I run it under my user account. 

How can I call the windows authentication window from C# code?

  

Hi,

To begin with: I DO NOT WANT A SOLUTION FOR ASP.NET

 

I have a windows application which tries to get information from the internet. But the connection to the internet can only be established through a proxy server.

Normally, the users who use the application log in with their credentials and that should automatically connect to the proxy server. But, for example, when you try opening Internet Explorer which is set up to use a proxy, it pops up the log-in window to authenticate to the proxy server, in case it is not saved.

My problem is, if it is saved, I can take the default credentials and proxy server using

System.Net.WebProxy.GetDefaultProxy(); (I know this is deprecated, but it works for me. I would appreciate a more elegant solution).

and

System.Net.CredentialCache.DefaultCredentials

But, in case it is not saved, I want to pop-up the windows authentication window like the IE does. Is it possible to that? If yes, I would appreciate a little help, otherwise I have to write my own authentication window.

Please respond asap.

Thanks in advance.


Make a C# WinForm Call a JS code in a Data server??!!

  
Hi... 
I have a situation as follows:
My company has its Customers Data stored in a server, and we as employees use Internet Explorer to find the data needed through a page that contains some textboxes to supply info to the server and some other textboxes that shows Data retrieved from server. So fro example I put the customerID in a textbox, press the search button near this textbox, and I get the customerName and customerAge and so on in another textboxes in the same webpage. I konw this is done via JavaScripts.

I hope the scene is clear, Now when I need to print a report about certain customer I have to copy/paste every single textbox content to Word individually.

So I know how to export from C# to Word or at least to Excel .., But is it possible to make a C# WinForms App that can read the contents of these textboxes OR call the JS function that is executed when I press the (Search) button shown in the IE WebPage.

I dont know if my question is clear enough but I hope you can help me. Any help would be appreciated.
Thanks in advance

Multiple websites- same code behind but different html and css- making templates

  

I have atleast 10 websites that have different css,html,javasacripts and webconfig. But the same code behind files.With this design everything is hard to maintain. So I decided to work on it and I started moving all the queries in the code beghind file to stored procedures. Since every website uses the same database.

What I have decided is to make use of themes and multiple master pages? IS this the best way to go about it?

Also lets say I have two templates. There is site A and site B. both using different templates. And have pages Home About Us and Contact.

 

Now would I be creating three different masterpages? for each template so 6 in total? ( since none of the templates are supposed to look the same)

or Should I just create two masterpages? if so how would I manage the html of the page so it looks different? Thank you


Matrix Column grouping - Total column incorrect when colum value is wrapped in a call to code

  

I have a column grouped matrix report that shows count, cost and duration.  Duration is time in seconds.  To format the time on the report as hh:mm:ss I send it through a code block that converts the int to a string. 

When the report is generated the total column is NOT code.convert(sum(Fields!Duration.Value)).  At first I thought it was taking the max value, then I thought it is was taking the first value.. not really sure how it is calculating the value.

I did trying wrapping the expression like this IIF(InScope("matrixgroup"), Code.Convert(Fields!Duration.Value), Code.Convert(Sum(Fields!Duration.Value))).  It didn't make a difference the column is still incorrect.

If I remove the Code.Convert from the column, the value is correct.

Does anyone have any suggestions?

 

 


Exception while making a one-way call using WCF

  

Hi,

I am facing a problem while invoking a one-way web service from a WCF client.

When I am defining something like this in my proxy

[System.ServiceModel.OperationContractAttribute(IsOneWay = true, Action = "http://xyz.abc.com:8080/GetService")]

void MyOneWayService (int myint)

There is an exception thrown "The one-way operation returned a non-null message with Action='' "

 

Surprisingly, when I change the proxy to something like this

[System.ServiceModel.OperationContractAttribute(IsOneWay = false)]

void MyOneWayService (int myint)

I find no exception and it works perfectly.

 

The response I get back from the service is same for both the cases

HTTP /1.1 200 OK

X-Backside-Transport: OK OK

Connection: Keep-Alive

Transfer-Encoding: chunked

X-Client-IP: 10.24.32.34

Content-Type: text/xml

0

 

Two links that I refered

http://blogs.msdn.com/drnick/archive/2006/08/18/705470.aspx

http://msdn.microsoft.com/en-us/magazine/cc163537.aspx

 

Still not able to explain myself why it works with IsOneWay = false.


A for apple, B for boy, C for c++

HOW TO CALL WEBMETHOD ASYNCHRONOUSLY from asp.net page (VB code)

  

I have a asp.net (.aspx in vb code) page and that needs to access  remote web service Asynchronously.

I have a following webmethod available in the remote web service:

<WebMethod(MessageName:="get_output_information")> _

 Public Function get_output_information (ByVal tran_id As Object) As DataSet

        Try

            'do some code here

            Return ds1

        Catch ex As Exception

            Throw New soapException("An Error occurred while processing output information.",SoapException.ClientFaultCode)

        End Try

    End Function

 

MY Question is "HOW TO CALL ABOVE WEBMETHOD ASYNCHRONOUSLY?"

 

 


Call InsertCommand From Code

  

How do I make a Sqldatasource perform its InsertCommand with VB.NET?  Normally, a control on the web page would call this command, but I want to use it in Code Behind.

The full routine will be to check and see if the sqldatasource is NOT empty then run an UpdateCommand, but if is empty then run an InsertCommand.

Thanks in advance.


C# Code Call SSRS Subreport from ReportViewer

  

Any C# Code or any setting in Reportviewer to call SSRS Subreport from ReportViewer

The SSRS Subreport executes properly from report manager.


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend