Request for Guidance for Conversational Voicebot

Dear team,

I am writing to seek guidance on building a conversational voicebot over the telephone using Asterisk Server. As I am new to Asterisk, I am having trouble figuring out how to proceed. I have some basic knowledge of Asterisk and AGI.

My current setup involves a voicebot (written in Python) running on a websocket server in an Azure VM. I have also installed Asterisk on the same VM and successfully connected it to a softphone (Zoiper). I can see the device when I run ‘sip show peer’. However, when I make a call, it gets disconnected with the message “Failed to execute Permission denied.” I have attached all my config files for your reference.

I would greatly appreciate any assistance you can provide in resolving this issue and guiding me towards building the voicebot.

Thank you for your time and consideration.

Sincerely,
Mitul

(attachments)

configFile.txt (2.77 KB)

Is the script executable? Does the Asterisk process have permissions to access and execute it?

Yes the script is executable. And also have all the permissions to access and execute

The output seems to disagree. The AGI couldn’t be launched, and the reason given was “Permission denied” from the system.

That is what i am not able to figure it out. Despite of giving permission access it is denying. Also i have checked the file access multiple times. It shows the file does have read, write and execute permission.
Screenshot 2025-02-04 163329

You executed the script using by passing it to python3 in the given output. Asterisk won’t do this. Does the script contain the appropriate #! so that it knows to use python3?

It also seems to output “Server started” which will probably violate the AGI protocol and not work, but that’s a future problem for you most likely.

#!/home/azureuser/voicebot/bin/python3

I have created a virtual env and this is what my script has.

Do you have SELinux enabled? This can result in permission failures if, for example, you try and execute something tagged as having been uploaded by ftp.

Although not the cause of the message, you don’t seem to be reading out the AGI responses correctly, but rather reading back variables you have just requested to be set, to detect when the request completes. There is no delay in your loop, so, between the AGI script and the AGI application, you will be using at least 100% of one core for the waits.

Although not directly relevant, you should not be using chan_sip on any new installation. It is not included at all in the latest two versions of Asterisk and is not built, by default, in any supported version of Asterisk. You should be planning to replace it in older designs.

There is no team handling these forums. People here are individual volunteers.

Also, please capture logs as plain text. Images can’t be searched and can obscure some more subtle errors.

  • Neither SELinux nor AppArmor is enabled on my system, and the script was not uploaded via FTP. So, security restrictions should not be the cause of the permission issue.
  • I started with a basic AGI script that simply streams a “hello-world” file, but it’s not executing at all. I’m getting a “permission denied” error even though the script has executable permissions (chmod +x).
  • I’m aware that chan_sip is deprecated, but since I’m just starting to learn Asterisk, I chose to work with it for now. I’ll transition to chan_pjsip once I have a better understanding.

Are you running the Asterisk binary with a different user than “azureuser”?
If you are, does that user have permission to enter /home/azureuser/voicebot/bin/?

See ya…

d.c.

Do all the directories on the path to the script. and on the path to python3, have suitable execute permissions?

You should seriously reconsider the use of chan_pjsip, from the start, and you should start with simple phone calls between the devices.

This may yield clues:

sudo --user=$(ps -C asterisk --format=user=) <path-to-your-agi> </dev/null