Dialplan Sysadmin looking to write dialer for our business

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 found this as well asyncari, along the lines you were mentioning using asyncio

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.

Name AMI AGI ARI asyncio TLS
pyst2 yes yes no no (uses threads) no
py-asterisk yes no no no no
panoramisk yes FastAGI only no yes no
asyncari no no yes via anyio no
Seaskirt yes yes yes yes yes

Hey.
Have you look at vici dialler ?

Yes it looks like a php monster that is not supported on asterisk 20. I am sure I could get it working but have concerns about security patching it

“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.)

And then, further down that same file:

$ADD=preg_replace("/[^0-9]/","",$ADD);
$order=preg_replace("/[^0-9a-zA-Z]/","",$order);
$format=preg_replace("/[^0-9a-zA-Z]/","",$format);
$bgcolor=preg_replace("/[^\#0-9a-zA-Z]/","",$bgcolor);

(18 lines’ worth.)

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

Channel: <ChannelId…> <State…> <Time…>
Exten: <DialedExten…> CLCID: <ConnectedLineCID…>

Channel: PJSIP/STAFFTEST-00000007/UserEvent Up 00:01:51
Exten: s CLCID: “” <>

[menu-staff]
type=menu
*=playback_and_continue(conf-usermenu)
1=dialplan_exec(send-vm,2001,1)
4=dialplan_exec(goodbye,s,1)

[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})

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.