How to make outgoing calls in c# - c#-4.0

I am trying to make outgoing call from C#.net 4.0, with pre-recorded message.I have
hiro usb modem h50113
already in the system to detect caller id.
I tried googling and found out few links
1.OZEKI
2.TWILIO
3. TAPI
in OZEKI I need to get SIP account not sure where to get that, and I am guessing that would cost me.
Twilio seems to be cheap but not sure how to use as there are codes like :
using System;
using Twilio;
class Example
{
static void Main(string[] args)
{
// Find your Account Sid and Auth Token at twilio.com/user/account
string AccountSid = "AC8ca11aff9660bdf011958a5718df9633";
string AuthToken = "{{ auth_token }}";
var twilio = new TwilioRestClient(AccountSid, AuthToken);
var options = new CallOptions();
options.Url = "http://demo.twilio.com/docs/voice.xml";
options.To = "+14155551212";
options.From = "+14158675309";
var call = twilio.InitiateOutboundCall(options);
Console.WriteLine(call.Sid);
}
}
Not sure where to write this code.
Also I think I can put use to usb-modem to make calls . So please advice what is the best possible way to achieve this and if possible in no cost.
Thanks

Twilio developer evangelist here.
If you are looking at making outgoing calls with Twilio, I suggest you follow this quick start guide on making calls in C#. It will take you through the basics.
For a more in depth look, I'd take a look through this tutorial on building a click to call system with C# ASP.NET MVC.
Let me know if that helps at all.

I am able to solve the issue . As I already had
hiro usb modem h50113
so i just used AT Command
ATDT (Phone number)
here is the code :
this.sp.WriteLine("ATDT 1234567890" + System.Environment.NewLine);
However , only it can ring , theirs no voice . Working on it as soon as I get it will post.
one can refer my old question for better understanding How to make caller id in c#.net

Related

How to get URL of shop in Shopify embeded app?

I'm building a Shopify App using this template: https://github.com/Shopify/shopify-app-template-node/tree/cli_three and I was wondering how I'm able to get the URL of the shop that is using my app (means the URL of the document outside the iFrame). I had a working approach using location.ancestorOrigins (https://developer.mozilla.org/en-US/docs/Web/API/Location/ancestorOrigins), but since this is not compatible with Firefox, I was wondering if there is another approach. Thanks in advance for your help!
Okay, so I came up with a solution by myself, but thanks for your help #TwistedOwl and #David Lazar. I post my code here in case anyone has the same problem in the future:
import {useAppBridge} from "#shopify/app-bridge-react";
function DemoPage() {
const bridge = useAppBridge();
const shopUrl = bridge.hostOrigin.replace('https://', '').replace('www.', '');
console.log(shopUrl);
}
All calls to your App provide a shop parameter (and now a host parameter too) ensuring you always know the shopify store using your App. There are zero situations where your App is called without the shop parameter being part of the equation from Shopify.

Has azure user ids changed their format?

Good evening ppl at Microsoft!
I have an Mobile App Service at Microsoft Azure Located at South Central US named CeneamApp.
My backend is configured in a way so that my user can access only the data they capture, by making use of stable user ids.
so I had followed Adrian Hall book to create an a user id (https://adrianhall.github.io/develop-mobile-apps-with-csharp-and-azure/chapter2/authorization/)with the following format sid:{identifier}as described here: (https://github.com/Azure/azure-mobile-apps-net-server/wiki/Understanding-User-Ids).
now all my userid had been changed and my user cant access their previous data capture by them, because somehow the provider or issuer or whatever is going on, doesnt let me retrieve a user id as described by the github project team wiki (in the previous link). so instead i receive a new userid but seem to be a random number:
I'm adding screenshot of the essential part of my code at my backend project which i debugged so i could understand whats going on and my dummy database where you can see an stable_id save on it and the new suppose stable_ids the next two rows.
Debugged code retrieving apparently a new userid from FACEBOOK could you confirm about this change? because I havent been able to understand this change.
Dummy Database with the lost userid and the new ones from other accounts database screenshot
if anyone has information about this odd behavior i would appreciate to enlight me, because this line of code:
principal.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier)?.Value;
used to give me a user id with this format: "sid:{identifier}", now the format is a the screenshot shows.
Same situation here. About to go live and suddenly this. Interesting that only one Mobile App based in the UK datacenter is affected. Other 2 apps which are in production and plus another Web App are still fine.
The full solution can only be provided by Azure team. But I have a workaround and and idea:
1. Workaround.
In the base controller I read and parse the token from the header. The sid is in the subject of the token. The code is simple:
string _userSid;
public string UserSid
{
get
{
if (_userSid == null)
{
KeyValuePair<string, IEnumerable<string>> auth_header = Request.Headers.FirstOrDefault(h => h.Key.Equals("x-zumo-auth", StringComparison.InvariantCultureIgnoreCase));
string token = auth_header.Value.FirstOrDefault();
if (!string.IsNullOrEmpty(token))
{
var jwtToken = new JwtSecurityToken(token);
if (jwtToken != null)
{
_userSid = jwtToken.Subject;
}
}
}
return _userSid;
}
}
I use it instead of getting this from ClaimPrinciple as per manual. I checked the Mobile App Server code does a very similar thing.
2. Idea.
Azure Mobile Apps have this parameter:
MobileAppsManagement_EXTENSION_VERSION it is recommended to set to latest. I think if we downgraded it to previous version it would work until Microsoft finds and solves the problem. The only issue is that I do not know and could not find the version number. May be someone knows and can post here?

Can you check if a Phone Number is a verified caller ID through the twilio-client?

I need a Twilio expert to answer a question for me if they can. I have an application I'm developing in which we want a user to be able to enter a phone number and call someone with a selected phone number as the caller ID. Trick is that caller ID must be in our account Verified Caller IDs list. Now I have found several examples and tutorials about how to do this using the Twilio SDK, however we're using that on our back-end where all our tokens are stored and Twilio-Client on the front-end. Does anyone know of a way to verify a callerID using the Twilio-Client device on the front-end? Big thanks in advance.
Twilio developer evangelist here.
The Twilio Client JS SDK is mostly concerned with placing calls using WebRTC. It does not include features for calling the regular API, including the verified caller id list.
You could do a couple of things here.
Either, before you place the call, make an ajax request to your own server and make a check there against your verified caller IDs.
Or, when the call is placed and Twilio sends the webhook to your TwiML application, check the caller ID is valid at that point. If it isn't, respond to the webhook with a message using <Say> to tell the caller they are trying to call from an invalid caller ID and then <Hangup/>. If it is valid, then place the outbound call leg with <Dial>.
Let me know if that helps at all.
I found two ways to verify a callerID.
get a list of numbers from your account and loop through them as follows:
https://www.twilio.com/docs/voice/api/outgoing-caller-ids?code-sample=code-list-an-accounts-outgoing-caller-ids&code-language=PHP&code-sdk-version=6.x
$outgoingCallerIds = $twilio->outgoingCallerIds
->read([], 20);
foreach ($outgoingCallerIds as $record) {
print $record->sid.",".$record->phoneNumber.",".$record->friendlyName;
}
attempt the validate the number and watch for an error
https://www.twilio.com/docs/voice/api/outgoing-caller-ids#add-an-outgoing-caller-id
try{
$validation_request = $twilio->validationRequests
->create("+1".$cell, // phoneNumber
["friendlyName" => $name]
);
} catch (Throwable $e){
$pos=(strpos($e,"Phone number is already verified") );
if (is_numeric($pos) ) { do something }
}

phone call in Windows 10 UWP

Currently, I found Windows.ApplicationModel.Calls API. unable to make a call or launch different options available to make a call from my app.
And also I try this Code but still can't implement the Phone call function, any solutions for UWP? Thank You.
if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsPhoneContract", 1,0))
{
PhoneCallManager.ShowPhoneCallUI("0213132131", "my name");
}
I've come with a solution that is working on emulator, I cannot test it on actual device, cause I don't own one.
PhoneCallStore PhoneCallStore = await PhoneCallManager.RequestStoreAsync();
Guid LineGuid = await PhoneCallStore.GetDefaultLineAsync();
PhoneLine = await PhoneLine.FromIdAsync(LineGuid);
PhoneLine.Dial(phoneNumber, nameToBeDisplayed);
You have to add Windows Mobile Extentions for UWP to references of your project as well as declare PhoneCall capability in app manifest.
The line,
PhoneCallManager.ShowPhoneCallUI("0213132131", "my name");
only shows the Call UI. It doesn't make a phone call.
You should use Windows.ApplicationModel.Calls.PhoneLine.Dial to make a phone call. See this for reference https://msdn.microsoft.com/en-us/library/windows.applicationmodel.calls.phoneline.aspx
See this example https://github.com/Microsoft/Windows-universal-samples/blob/master/Samples/PhoneCall/cs/Helpers/CallingInfo.cs#L85

Chrome extension - Notification

How I can send a notification for everyone that has installed my extension?
I'm using new Notification(...) but the notification is just sending for me.
Thank you for all
You will want to use the new gcm service for Push Notifications via Google Cloud Messaging Service.
Here is a tutorial on Google's Chrome Developer page.
Well, this requires a lot of work already done in the extension to be able to do that without updating the extension.
For instance, your extension can periodically look for new notices on your website.
If you need more urgency, you either need to keep WebSocket connections to your server or use some manner of push services, like gcm API that Max Worg just mentioned.
That said, to use all this you need to have the support already in place in your extension.
Okay, but suppose you don't have that support, or don't need it that often.
The usual way to do it is with an extension update, where you add a message for the users and increment a variable with the "release notes" version, so that it will only be shown once. A good idea is to use chrome.storage.sync for this, so that the user won't be annoyed multiple times.
var message = "Sup user, check this out!";
var message_version = 4; // Update this when you want to show a new one
chrome.storage.sync.get(
{message_version: 0}, // Provide default
function(data) {
if(data.message_version < message_version) {
notify(message); // TODO: implement notify()
// Alternatively, open a page with the notice with chrome.tabs.create()
chrome.storage.sync.set({message_version: message_version});
}
}
);
You can see a real-life example here (using a hybrid of localStorage and chrome.storage).

Resources