Service codes in PhoneCallTask WP7? - c#

I want to use PhoneCallTask for using some services from my cellular provider in other words I want to be able to dial #1234* within code
if this isn't available yet is there anyway to do that by any other way
I need it urgently

This is deliberately not available as part of the security considerations and principles designed into the phone.
If it were possible to get the response to such commands then it would be possible to get someones phone/cell and IMEI numbers without their knowledge or permission. With these you coudl do some very nefarious things.
If you really need this urgently then you're stuck. In future I'd recommend finding out what is possible with a platform before you starting building an application.

As you haven't included any code I'm going to assume that you've not tried anything yet.
So this code may help
PhoneCallTask phoneCallTask = new PhoneCallTask();
phoneCallTask.PhoneNumber = "#1234";
phoneCallTask.DisplayName = "Service Number";
phoneCallTask.Show();
I've not been able to try this to see if it works with that input, so it may be an issue with the "PhoneNumber" field if that does not work
EDIT:
Don't forget to add
using Microsoft.Phone.Tasks;

As far as I'm aware these are operations that are stored on the SIM card and have nothing to do with the layer of Windows Phone you have access to. In other words, the ISO standard (im guessing) for cellular interconnected devices will require a device to handle certain requests (such as typing *#06# to display the devices IMEI number). Thus it is likely that you will not be able to interact with these calls. You won't be able to make the phone think your App is making a request it knows can only come from the SIM card due to the way the OS sandboxes various services.

Related

Get call time in Skype for Business

I am using the Microsoft Graph API to collect basic information about a user's meetings and emails. Now, I also want to know how many phone calls (and chats) a user has in Skype for Business and how long the phone calls are.
I realized that Outlook creates a folder 'Conversation History' where these are logged. Unfortunately, not all call entries contain the call duration. I didn't find out when it is there and when not. Does someone know why this is?
And is there a way to get Skype for Business call durations?
(I think using the Lync-API (UCMA) might be a bit of an overkill)
I would like this as well. I have added it to the suggestions page for Office 365. https://office365.uservoice.com/forums/273494-outlook-and-calendar/suggestions/13733040-call-duration-for-outgoing-calls-in-conversation-h
The best way is to use the Call detail recording (CDR) database (when enabled). You can find the CDR Scheme here.

Getting the Signal Strength of a cellular dongle (GSM) on a desktop application written in C#

I'm trying to retrieve the SignalStrength (i.e. like the info behind the bars cellular phones), but on a desktop application developed in C# .NET 4.0, that has a GSM adapter connected to it. I've managed to connect and disconnect to the service provider using RasDialer, but I can't find anyway to get the SignalStrength.
I've tried MbnApi, but it runs great until I receive the connected interfaces, and after I use one of them for ANYthing, it crashes with a COM exception saying "the data necessary to complete this operation is not yet available". Here's a piece of code that crashes with this exception on the last line:
MbnInterfaceManager mbnInfMgr = new MbnInterfaceManager();
IMbnInterfaceManager infMgr = (IMbnInterfaceManager)mbnInfMgr;
MbnConnectionManager mbnConnectionMgr = new MbnConnectionManager();
IMbnConnectionManager ImbnConnectionMgr = (IMbnConnectionManager)mbnConnectionMgr;
var mobileInterface = infMgr.GetInterfaces() as IMbnInterface[];
IMbnSignal sig = (IMbnSignal)mobileInterface[0];
uint signalStrength = sig.GetSignalStrength();
Can anyone assist, either by explaining what I'm doing wrong with MbnApi or directing me to another alternative?
Thank you so much in advance,
Yaron.
I couldn't see any obvious errors, so I pasted your exact code into a .NET 4.0 test project, referenced MbnApi built on a Windows 8 system and ran it, and it ran fine. I got the signal strength of my integrated modem out.
I assume that in your code, you would normally have try/catch blocks, tests for null etc.
Have you investigated how many interfaces are present, and whether you really want interface[0] or another one? Also obvious things like re-booting Windows etc.
You asked about other possibilities for getting this information.
When using MBN API for signal strength, you should be aware of this factor. The AT command AT+CESQ gives a more accurate value. Section 8.69 of this document describes it. There is plenty of information on SO and the internet on how to use AT commands with C# - try the at-command tag, or do a search for [c#][at-command] on SO.

SetupDi API: Control Device Manager functionality programmatically

Problem:
I have a PC with a bunch of network cards of the same type and two drivers that can service them. When I let Windows 7 decide which driver to load, each of them is loaded with the manufacturer's drivers, and for 3 out of 4 cards, that is the desired behaviour. But the last card needs to load a different driver than the others.
Manual solution:
This problem can be manually solved by going to the device manager, selecting "Update Driver" from the card's entry's context menu, choosing to list every available driver and then choosing the one that windows neglects (because the manufacturer's driver is signed, and mine isn't). To conduct this programmatically is the ultimate goal I pursue.
Tried approaches:
I already tried quite some things to solve this, but I still can't exactly solve the problem I am having.
The first idea was to disable the UPnP Service or similarly decline Windows' efforts to assign the drivers, but I can't because it is needed for the other cards, and the given circumstances dictate that the drivers will possibly have to be reassigned quite regularly.
I tried to use the DevCon tool, since it offers something that, at first glance, looks like an incredibly easy way to achieve my goal: A command line interface that is said to be as powerful as the device manager itself. From what the documentation says, it offers usable methods indeed, and I tried it thouroughly. But there seems to be a problem with identifying the card that I want to access uniquely. Using the DevCon Tool I can retrieve Device IDs of the following format:
PCI\VEN_XXXX&DEV_XXXX&SUBSYS_XXXXXXXX&REV_XX\X&XXXXXX&X&XXXX
This, sadly, does not help much. Until the second '\'-symbol, the IDs are the same for all four devices. I can use them to issue the commands that DevCon offers me (like listing compatibale hardware IDs or just finding them). But it seems that DevCon does not evaluate the part of the ID that follows the second '\', which means that I can not just disable one of the cards (I can indeed tell which of the cards is the one the driver of which I want to change, so no problem in that respect).
A very similar approach was to use the SetupDI Api of Windows. Actually, it is the exact API that the DevCon Tool uses (well, that's what they say, anyways). And while finding and identifying the device in questions is relatively easy (even for the C# person that I am, who never had to leave the managed world), I can not seem to find a way to do anything but enabling and disabling the device. I would most probably be able to construct a workaround if I had a way of removing the card (completely disassociate it with any driver), but I can't figure out how. Disabling the device is nice, but it preserves the driver association and therefore is not a help for me.
If you can help me refine my approaches or point me another route to try, please do so. Even if your answer does not solve my problem, your suggestion might hint me at approaches I have not yet tried, and I am desperate enough to try them all.
The exact problem can be solved using a combination of the setupapi.dll and newdev.dll. Note that the latter is only available on Win7 and later. Using the device and driver enumeration functions from the setupapi you can get handles to devices and appropriate drivers from the driver store. The newdev api then offers an install function that takes a device and a driver object (retrieved from the setupapis before) and install the specified driver on the device.

How can I get the MAC address of a wireless access point from C#?

I know there are other posts that dance around this a bit, but I'd like to know how (or if it's even possible) to, using C#, grab the MAC address of the wireless access point that a user is accessing a site or other HTTP-based API from. I work for a hospital and the location of all of our WAPs are known, and would like to move forward with setting up a wayfinding solution that doesn't rely on specific mobile device APIs to determine either MAC addresses or GPS (since I'd like this to work inside buildings as well). I'd also like to not have to use something like Skyhook.
If the MAC address can't be gotten, would assigning specific IP blocks to each WAP, followed by just looking at IPs be a better solution perhaps?
Thanks in advance
Depending on the WAP's you have you may be able to use SNMP to get the information. You'll need to look at what MIB's (Management Information Base) are supported to find the information you are looking for.
Using SharpSNMP API would be a good place to start (http://sharpsnmplib.codeplex.com/).
At this point i have to advise you that MAC addresses are not unique, making the process of using them problematic. Even within a hospital you will find that there are duplicate MAC addresses, making relying on this method of identification at best, inadvisable.
If your wayfinding app is predominantly for use within a building, then relying on WAP positioning will result in a high margin of error. This is caused by relatively long range of up to 150ft. So you can locate them with a margin of error of up to 150ft. Not necessarily what you're after, especially considering all those different levels.

Unique Computer Login

I am looking for a bit of help. I realize there are many threads that explain the difficulties and problems of uniquely identifying a computer as far as piracy preventions and user licenses. This situation is a tad bit different in the fact that users must have an active account to log in and use the software. And this option will only be on a requested basis not for every account.
The issue arises when some of the companies have requested instead of admin accounts, they would like admin locations. I am looking if there a good way to do this, or if this will still have the same issues of changing hardware/ spoofing MAC's.
Some of the machine need uniquely identifiable we will have remote access to, while others we won't.
We run on a .NET platform
The only way to use our software is active log-in.
Thanks in advance for any help provided.
I agree with other answers but have an additional suggestion:
Every Windows generates unique SID on installation... you can get that via DirectoryEntry in the objectSID item of Properties... see http://msdn.microsoft.com/en-us/library/system.directoryservices.directoryentry.aspx
hope this helps a bit...
EDIT - getting MachineSID as string (corrected as per comment):
string MachineSID = new SecurityIdentifier((byte[])new
DirectoryEntry(string.Format("WinNT://{0},Computer",
Environment.MachineName)).Children.Cast<DirectoryEntry>().First().
InvokeGet("objectSID"),0).AccountDomainSid.Value.ToString();
you need to add a reference to System.DirectoryServices and make sure to have using System.Linq; and using System.Security.Principal; and using System.DirectoryServices;.
It is essentially impossible to prevent people from "spoofing" a location. So plead with the clients to allow for a layer of authentication above the "location" they request.
Short of that you may want to take some loosely identifyable information such as the MAC, IP, or other specs and send it as an encrypted string. Anyone sniffing on the network wont be able to tell what the data being sent is so will have a harder time spoofing it if that is their goal. If they manage to decrypt the message then the data is in the open but until they're able to read it it provides a minor layer of security.
I still recommend against this idea but I'm sure it can be done. There is a truckload of issues you'd be forced to deal with that exist outside the software domain itself and would complicate things much more than a strong authentication scheme. Hopefully other members here can provide good examples to use but you don't want any false positives or otherwise (Dynamic IPs getting in the way etc.)
IMHO, there is no good way to use the hardware as a primary means of authentication. You could do something like have an admin account that should be tied to certain hardware, and then try to heuristically detect changes in hardware but that's a scenario where you have an account AND hardware instead of an account OR hardware.
All preaching aside, if you can't convince the company that it's a bad idea, what I would do is provision those certain machines with keys that you authenticate with. Then you have full control over if/when to allow those keys to authenticate, you can revoke their access, but still give the effect of it being the machine that's authenticating, and not an account. It's still got all of the advantages and flexibility of being software controlled with the same effect of being hardware-based.

Categories