Python agi make outbound call

Hey,

i am currently trying to trigger an outbound call via the agi in python.
The relevant lines look something like this:

agi = AGI()
...
self.agi.exec_command("Dial", f"SIP/{self.receiver_phone_number},30)")

Just running this script doesnt work tho. I already read through some other topics and it seems doing this doesnt really work with agi.
However apparently this would work when i already had an active inbound call ( i assume at least ) and then the inbound call would be “rerouted” to the new one.
Could it be possible to just create some kind of dummy inbound call and then it works? Or is there a better solution?

My usecase is a little computer assistant which answers some questions on the phone. Now i want this assistant to be able to make calls itself and receive information.
So basically i want to achieve the same functionality which i would get by this:

same = n,EAGI(/home/asterisk/main.py)

So complete control over the call via python, only now with an outgoing call.

Its not important for me to be able to trigger the call via python, if i can do it through the terminal or similar somehow that would be enough.

Greetings

One would need a more complete specification to be confident of the best approach, but AMI, or even possibly ARI, is likely to be a better approach; look for originate. Call files might also be better

Sadly i havent worked with that before but from what i am reading a call file would be able to create a call and then run an agi script, no?
If so am i able to somehow trigger the call file via python?

You can create the call file using Python.

You can also have Python invoke AMI originate in real time.

If the call, itself, uses AGI, you would have to coordinate between the AMI client and the AGI server. That could be done by use FastAGI and using the same process for both.

The potential advantage of call files is that they will retry failed calls, at intervals. It depends on your full requirements as to whether or not that is an advantage for you.

If by failed you mean that the receiver didnt take the call then that isnt a concern for me, since I assume i will be able to catch that.

I will try to look into ur suggestion. Thank you