I am looking for a network-to-asterisk dialing method..

MacNix

Guru
Joined
Jun 21, 2011
Messages
198
Reaction score
31
Ok, Asterisk n00b here....

I have my box working, but am realizing it'll be OH so much faster if my database (a filemaker Pro, which is somewhat SQl-happy) can simply dial contact numbers and assign them to the user's extension.

I'm plenty happy to play on the backside of MacOS, toss unix code, and create scripts to call the asterisk box.

What I DON'T know, is how to make it actually work.

I haven't yet found a "complete guide to Asterisk", and though I'm doubtful there is one, i'd certainly drop cash for it if it were available....


Any help in this? Am I asking for a very complex step, or is this already setup in asterisk??
 
If I understand you correctly, you are looking for click to dial from an existing database.
  1. If you can browse your database via Firefox (or create an html front end for this purpose) then you can use noojee click which is my preferred method for this.
  2. There is the Asteridex project which you might be able to modify to use the existing database.
Lorne

thx.

1. yes, I want to set up a click-to-dial script from my database. It's a filemaker db, which can call any sort of Applescript or any terminal command of most-any sort (for instance, I have one script which logs into a remote server (via SSH) and does an rsync of two folders on command, then logs off any unmounts the remote server.

2. you mention Asteridex.. I am not familiar, but didn't see that it contained a track to receive a dial command via SSH or some other network script (say: dial NXX NXXXXXX and connect to ext 200).....

My target is customer call-back. we have gazillions of new numbers showing up which need to be called. They're in a db field and are stripped & striped in a wya for export.. we can rapidly insert them into any command line..... i don't think it's feasible to constantly be uploading them to asterisk -- would rather just push the number directly to it as a command script (ie., "dial xxxxx and connect on ext xxx").....
 
Sounds like fun. In a nutshell, this is how I would accomplish this, hopefully it will guide you in the right direction.

On the PBX side, generate some (PHP) code that grabs a couple of get variables and parses that into a call file. Here's a couple links to get you started.

http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
http://php.net/manual/en/function.fwrite.php

On the database server, you would configure your app to run some variation of this command:

Code:
wget http://<pbxip>/autodial.php?ext=<ext>&dial=<dial> > /dev/null
So, your database server visits a rendition of the URL above, the autodial.php script grabs $_GET['ext'] and $_GET['dial'] and uses those to generate a call file in /var/spool/asterisk/outgoing. The finished call file would look something like this (I'm going off of memory so you'll definitely want to read the voip-info.org link and figure out what would work best for you).

Code:
Channel: SIP/<ext>
Context: from-internal
Extension: <dial> (The number you want to call)
Priority: 1
Archive: no
The finished result would ring SIP/<ext> and upon answer follow your internal dialplan to call <dial>. Additional thought, make sure you groom the <dial> variable before you send it off to the call file because asterisk won't be happy if you tell it to try to call "(NXX) NXX-XXXX"

Good luck!
 
Thanks for the direction and ideas! Sounds great!

I'm a PHP n00b, so this could be an interesting experience..

The database would then have a relationship file which filters the command entered based on the username (login name of person on the keyboard), from there deducing their particular extension.

It will then grab the phone # off the clicked-on-field, and will push that URL to the server, along with the previously found extension #....


My original thought (this is me, not knowing PHP, but being confident enough in SSH to utterly decimate anything) was that I should simply have a terminal command and tunnel to the server, and send a command to it from the db. It's sounding to me as if the PHP route is 'more betterer'....

Is that assumption valid?? (not that I don't trust you, but I like 2nd and 3rd opinions, especially when it's regarding unknown territory)...



Sounds like fun. In a nutshell, this is how I would accomplish this, hopefully it will guide you in the right direction.

On the PBX side, generate some (PHP) code that grabs a couple of get variables and parses that into a call file. Here's a couple links to get you started.

http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
http://php.net/manual/en/function.fwrite.php

On the database server, you would configure your app to run some variation of this command:

Code:
wget http://<pbxip>/autodial.php?ext=<ext>&dial=<dial> > /dev/null
So, your database server visits a rendition of the URL above, the autodial.php script grabs $_GET['ext'] and $_GET['dial'] and uses those to generate a call file in /var/spool/asterisk/outgoing. The finished call file would look something like this (I'm going off of memory so you'll definitely want to read the voip-info.org link and figure out what would work best for you).

Code:
Channel: SIP/<ext>
Context: from-internal
Extension: <dial> (The number you want to call)
Priority: 1
Archive: no
The finished result would ring SIP/<ext> and upon answer follow your internal dialplan to call <dial>. Additional thought, make sure you groom the <dial> variable before you send it off to the call file because asterisk won't be happy if you tell it to try to call "(NXX) NXX-XXXX"

Good luck!
 
I typically look for little projects like this when I’m trying to learn a new language. Attainable goals that will actually serve a purpose make learning a new language fun.

With that said, the end goal here is a call file. If you feel more comfortable launching a bash script over SSH, then go for it, particularly if you have no desire to learn PHP. Knowing full well how to troubleshoot something and what your limitations are is going to be more valuable than 20 lines of code that only partially make sense to you.

For the user to extension mapping, if possible you would want to try to store this information in the database so you don’t have an additional database to keep track of. If that’s not possible you may need some type of Rosetta stone for translating usernames into extensions. With PHP I find .ini files are a simple means to keep track of this type of information without a lot of overhead. http://php.net/manual/en/function.parse-ini-file.php
 
I typically look for little projects like this when I’m trying to learn a new language. Attainable goals that will actually serve a purpose make learning a new language fun.

With that said, the end goal here is a call file. If you feel more comfortable launching a bash script over SSH, then go for it, particularly if you have no desire to learn PHP. Knowing full well how to troubleshoot something and what your limitations are is going to be more valuable than 20 lines of code that only partially make sense to you.

For the user to extension mapping, if possible you would want to try to store this information in the database so you don’t have an additional database to keep track of. If that’s not possible you may need some type of Rosetta stone for translating usernames into extensions. With PHP I find .ini files are a simple means to keep track of this type of information without a lot of overhead. http://php.net/manual/en/function.parse-ini-file.php


thx.

Unfortunately, the tyranny of the urgent is killing me, so i need this to just work.... John is helping me with some backdoor PHP work, and my FMP (filemaker pro) database will parse all the details, and spit out a URL that works...

FMP has a dozen little ways to push stuff like that, and I'm much more handy under the hood of FMP than in Asterisk, or PHP. It's not the best db platform on the planet, but for Macnerds, it's the ONLY db that's worth using.. and it speaks SQL well enough to not fall on its face, so most real db folks can tolerate it....

The db already has a database for all employees, so I just added a phone extension field in their file, which FMP pulls when it preps the script..

Now i just gotta let John get the PHP part working on the backside, and all will be well!
 

Members online

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top