Hi, I’m new here and eager to get started on developing our dialer. I started with asterisk when it was first released, but only played around with it and have not had a real complex business case for it until now. Looking for advice on where to focus my learning.
We have an inbound/outbound sales group that both makes and receives calls in the US, we’re using Odoo as our CRM. Running Asterisk 21 on a Linux vm. Our sales team is under 10 people.
My current project is to write a dialer for the team, I’m looking at dialplan/agi/ami/ari and wanted to get a sense of where people are doing modern development. ARI looks like it’s the future state winner here, but on Github when I look up ARI-python or node I don’t see much activity on the code base. Ari-PHP looks pretty popular, wondering if that’s because of apps like vicidial. My preferred language is python, but obiously could learn node or under threat of violence use PHP to write an application. Any thoughts here on where most modern asterisk app development is taking place?
I prefer Python, too. I’ve been putting together a more comprehensive wrapper for all the Asterisk APIs (including the console), taking advantage of more modern Python features like asyncio. I call the project Seaskirt. You can find some examples of its use here.
My challenge right now is that it seems practical to not wrote the rest code myself but to use a library like pyari or nodeari, but only the php one seems maintained. I am wondering why these objects appear dead and if I am missing a newer approach
I love Python, but based on my experience with dialer development, I’ve found that PHP is, in my particular case, more flexible for coding such projects with Asterisk. PHP, combined with Asterisk AMI and MySQL, forms the fundamental core of an automated dialing system.
“PHP monster” is right. Whoever wrote the code seemed to have little understanding of programming, or of PHP.
Just for fun, I downloaded a recent copy, and it didn’t take me long to find stuff like this (in the file www/agc/active_list_refresh.php, if you want to look for yourself):
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
(there was a sequence of 36 lines like that, but I’ll spare you the rest.)
That was just after looking at one or two source files. Something about PHP just seems to attract mediocrity. Don’t they know about factoring repetitive code for ease of maintenance?
This was super helpful, in the end I found the best support with panoramisk and I am now developing my dialer in Python. I’m using confbridge.conf with some DTMF tones and the dialplan to support the application. This is a good path for me as it gives me a blend of AMI and Dialplan.
I am having a hard time understanding call state with the dialplan exec from confbridge. I created an etension for hanging up on people, but I want the staff to return to the bridge after executing it, that does happen but asterisk complains the channel fell through. Can’t do hangup, return complains it doesn’t know where to return to. Can’t find any documentation on the right way to complete this extension/context cleanly on return to the bridge. It happens automatically now.
Auto fallthrough, channel ‘PJSIP/STAFFTEST-00000007’ status is 'UNKNOWN
pjsip show channels
[goodbye]
exten => s,1,NoOp(Goodbye requested ${BRIDGEPEER})
same => n,Set(BRIDGENAME=${CUT(CUT(BRIDGEPEER,/,2)),1)})
same => n,ConfKick(${BRIDGENAME},participants)
same => n,UserEvent(REQ_DROP_CALLER,BridgeID=${BRIDGENAME})