Asterisk integration with custom ERP - asterisk

One of our customers has an Asterisk phone center and want to integrate it with our ERP. The idea is that Asterisk calls an Oracle database procedure when a phone call is transferred to an extension. This Oracle procedure has 2 parameters, incoming phone number and destination extension.
Is it possible to do this with Asterisk API? Where can I find documentation or examples to do it?
I have read official Asterisk API documentation but don't understand how it works and where can I begin to search...

There are no documentation for "just integrate with ERP".
You can use ARI events or AMI events or CEL to make integrations. It will be highly depend of dialplan used

There are probably a dozen ways to do this using the various Asterisk subsystems, such as ARI and AMI, but one of the simplest might be to make a network call embedded in the dialplan.
There are several examples of how this might be done at https://www.voip-info.org/asterisk-call-notification/ ; for example, look at the description for YAC on that page, which shows how to make the call using netcat.
That method uses the System Application. Do be careful not to pass unfiltered text from e.g. the Caller ID information to the system, as someone might inject malicious code into the Caller ID.

Related

Asterisk issabel auto park

I'm trying to connect my issabel Asterisk with my custom CRM. I want my agents to be able to monitor the incoming calls using AMI events and use AMI commands to redirect any call from the list to there phone devices. I'm able to get all the information from AMI.
Now I use custom extension on inbound routes to dial 700 extension and inbound calls goes to parking lots. My only problem is that Asterisk says to caller the parking lot id.
Any other way to auto park this calls without parking lot announcement?
You can create simple patch for main/parking.c which will issue UserEvent with needed info. Should not be very complex 2-3hr of work for C/C++ expert.
Other option is use Stasis app or dialplan with hold for make parking-like behavour. Or just send user to empty conference and record it's ID.

Asterisk Broadcasting

Goodmorning,
I need your help with something.
A quick question to learn more about Asterisk.
I love studying new things.
I would like to send a broadcasting message too let's say 100+ registered users with Asterisk from one user account.
Would this be possible with Asterisk?
Is there already a function inside
Asterisk available for this or not?
Thank you.
Wesley
No, there are no function like that in asterisk(it is PBX!!!)
Broadcasting require alot of checks be made and in most case your provider in contract disallow broadcast.
You can use vicidial.org software or write your own using call files(not recommended for person without experience).
https://www.voip-info.org/asterisk-auto-dial-out/
To give an update on this topic, as Arheops says it is impossible.
It is possible!
I have made it work with the Asterisk AMI.
You call an extension and from the dialplan you kick a PHP script that executes an Asterisk AMI action. This way you can get all the currently active user in a conversation. You can take the currently active users from a real-time database structure. With the dialplan you set autoanswer for these users, this way you can broadcast. Have tested this multiple times, and it works like a charm.

What is a solution to using the scanning of a QR code to execute a smart contract function on Ethereum?

So I have been working with Ethereum's metamask, and implemented web app where the user can come while being logged into metamask, and call a function on my smart contract via metamask. Tutorials for this exist and it's not very hard.
I want to implement calling a smart contract, when a user comes into a store ([physically). I want to do it the following way:
Some customer comes in and uses some application $A on his phone, which may be a wallet app or some other application that has access to his ethereum wallet.
On my POS application, I will render a QR code.
When he scans the QR code with his mobile phone, it is equivalent to either:
sending ethereum funds to our company account, while I am able to verify that this has happened via an event, or
he calls a function on a smart contract. This seems more appealing because I know that you can send events via smart contract calls.
So my question is:
Do any applications that have the functionality of application $A exist, are they widely used?
What can I use to implement exposing a QR code which is effectively some form of visual API for my program?
What you need is a library in your application to create a QR code. This QR code will need to be created for the function/method you need to call on the smart contract. You can use https://github.com/jibrelnetwork/ethereum-qr-code/blob/master/README.md
The QR code will be scanned by the user using the wallet on their mobile phone app wallet. This transaction will trigger the smart contract function and allow your application to proceed forward.
Hope this helps.
Cheers,
Answer to Q1:
Yes, there are applications like this(i made one myself). Most existing mobile wallets use this approach, for eg. Tenx.
Answer to Q2:
Sorry but this question is not totally clear to me. Are you asking for some sort of library for creating a QR code?

call phone by clicking on number in web

Im newbie from asterisk but professional in PHP programming!, so
I want to call mobile number in my users panel in web. exactly when user click on a number, connect to asterisk and call selected mobile number via specified internal extension.
is there any solution? I don't know about using any softphone or not. I don't want to use any client softphone if possible.
edit:
I used some php code with AMI and shift8, but my problem is when user calling and how can user talk with another without softphone?
You can use various API's to place a phone call. As you already learned about the AMI you might find http://code.google.com/p/asterisk-php-api/ helpful.
Regarding your phone question: placing a phone call using the AMI Originate Action will first ring the extension's associated phone and when you take of the hook, asterisk will dial the target number. Therefore it's not importent which kind of phone (hard- or softphone, brand, ...) you're using. As long as the phone is registered in asterisk and bound to a certain extension it'll work.
If I understand correctly, the doddle web phone or webrtc may be an example of what your looking for.

How would you implement database updates via email?

I'm building a public website which has its own domain name with pop/smtp mail services. I'm considering giving users the option to update their data via email - something similar to the functionality found in Flickr or Blogger where you email posts to a special email address. The email data is then processed and stored in the underlying database for the website.
I'm using ASP.NET and SQL Server and using a shared hosting service. Any ideas how one would implement this, or if it's even possible using shared hosting?
Thanks
For starters you need to have hosting that allows you to create a catch-all mailbox.
Secondly you need a good POP3 or IMAP library, which is not included AFAIK in the .NET stack.
Then you would write a Command Line application or a Service that regularly checks the mailbox, pulls messages, inserts content in db based on the "To" address (which is unique for each user), and then deletes the email from the mailbox.
It's feasible and sounds like fun. Just make sure you have all you need before you start!
If the data is somewhat "critical", or at least moderately important, do NOT use their username as the "change-data-address". Example: You might be tempted to create an address like username#domain.com, but instead use username-randomnumer#domain.com where you give them the random number if the visit the web-page. That way people can not update other peoples data just by knowing their username.
E-mails can be trivially forged. I would only do this if you can process PGP / SMime certificates in your application.
Other than that, I see no reason why not!
use a dotnet popclient to read the incoming emails, parse them for whatever you are expecting and insert the data into the database.
see codeproject website for simple popclient implementation
you would have to decided on the email content yourself, eg data only, payload of sql statements, etc
You could also identify the user based on sender address. This is how Tripit (and probably others) does it. This only requires one e-mail address on your end.
I have done something similar, using Lumisoft's IMAP client and scheduling a task in my app that checks every x minutes the configured mail address for updates. For scheduling I recommend quartz.net. No launching external processes or anything.

Resources