This project is read-only.

How to handle "After Dial Window" in modem connection

Sep 15, 2009 at 8:52 PM

Hi ,

My project includes dialing to multiple modems for different payers. For some, modem connection needs to have the "Show Terminal Window" (modem connection->properties->Security) while connecting. In case of manual operation  an user fills in the user credentials when the after dial window appears. How do I handle this with rasdial?When I use the normal modem connection using Rasdial.Dial(Network credentials) it works fine for the non afterdial windows but otherwise I am getting the below errors.

When my modem connection has "Show Terminal Window" checked.

DotRas.RasException: The connection needs information from you, but the applicat
ion does not allow user interaction.
   at DotRas.ThrowHelper.ThrowRasException(Int32 errorCode)
   at DotRas.RasHelper.Dial(String phoneBook, RASDIALPARAMS parameters, RASDIALE
XTENSIONS extensions, RasDialFunc2 callback, RasEapOptions eapOptions)
   at DotRas.RasDialer.InternalDial(NetworkCredential credentials, Boolean async
hronous)
   at DotRas.RasDialer.Dial(NetworkCredential credentials)
   at ActiveConnections.Program.ConnectModem(String Payer) in C:\Disks\VS2005Sol
utions\DotRasConsole\ActiveConnections\Program.cs:line 162

 

When my modem connection has "Show Terminal Window" unchecked.

DotRas.RasException: Loopback was detected.
   at DotRas.ThrowHelper.ThrowRasException(Int32 errorCode)
   at DotRas.RasHelper.Dial(String phoneBook, RASDIALPARAMS parameters, RASDIALE
XTENSIONS extensions, RasDialFunc2 callback, RasEapOptions eapOptions)
   at DotRas.RasDialer.InternalDial(NetworkCredential credentials, Boolean async
hronous)
   at DotRas.RasDialer.Dial(NetworkCredential credentials)
   at ActiveConnections.Program.ConnectModem(String Payer) in C:\Disks\VS2005Sol
utions\DotRasConsole\ActiveConnections\Program.cs:line 162

Please suggest.

-Thanks

Rahul

 

 

 

 

Sep 15, 2009 at 9:25 PM

It could be that from what I can see in your code you're trying to use it from a console application. I'd put it into a Windows Forms environment and see if that helps for starters.

Or you could try dialing the connection asynchronously using the DialAsync method on the RasDialer.

Start there and let me know what happens.

Sep 15, 2009 at 11:09 PM

Hi Jeff,

Thanks for the quick response. I tried with Windows Forms environment using DialAsync method and am getting exactly the same errors as I mentioned before.

-Rahul

 

Sep 15, 2009 at 11:26 PM
Edited Sep 15, 2009 at 11:29 PM

Well, in order to start diagnosing the problem I'll need to know which option that "Show Terminal Window" checkbox sets on the RasEntry class.  Easy way to test, use the RasPhoneBook class to open the phone book and grab the entry out of the Entries collection. You'll be able to see what all flags are set from there. It should be on the Options or ExtendedOptions properties somewhere.

Check what the RasEntry looks like with that checkbox turned on, and again with it turned off. I'm guessing the TerminalAfterDial flag is being set. In which case if it is, any entries that have that flag set need to use the RasDialDialog box on a Windows Forms application to dial the connection, as indicated by the Windows SDK.

Just out of curiosity, what's the error code you're seeing on the RasException being thrown with the checkbox checked?

 

Edit: Had to modify my question at the end so it was more specific about what I was wanting.