# AGI and C Program

**URL:** <https://community.asterisk.org/t/agi-and-c-program/103314>\
**Category:** Asterisk APIs\
**Created:** [July 12, 2024, 6:50am UTC](https://community.asterisk.org/t/agi-and-c-program/103314 "2024-07-12T06:50:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuyoungtaik](https://avatars.discourse-cdn.com/v4/letter/y/a87d85/32.png) [@yuyoungtaik](https://community.asterisk.org/u/yuyoungtaik)\
**Post date:** [July 12, 2024, 6:50am UTC](https://community.asterisk.org/t/agi-and-c-program/103314/1 "2024-07-12T06:50:14Z")

</div>

I am studying with fedora and asterisk 20.8.1.

In one blog, you can use functions handled by dianplan in agi (for example, answer()), but in agi  
Process only the necessary tasks and return to dialplan.  
They say it has less effect on the system, but is that still the case?  
If you call agi in extensions.conf and create a program using agi in C, I wonder if the system will not work properly due to overload due to too many lines or other circumstances. I’m trying to create an ivr program.

- PS: After installing Asterisk 20.8.1, link the agi.h file  
When an error occurred, I received help from here and downloaded the agi.h agi.c example.c files and used them, and there was no problem. What did I do wrong?  
Where can I refer to what AGI functions are used in C?

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [July 12, 2024, 8:31am UTC](https://community.asterisk.org/t/agi-and-c-program/103314/2 "2024-07-12T08:31:22Z")

</div>

Asterisk provides no C library for writing AGIs. The agi.h file is for extending AGI support within Asterisk.

---

<div class="post-metadata">

**Author:** ![yuyoungtaik](https://avatars.discourse-cdn.com/v4/letter/y/a87d85/32.png) [@yuyoungtaik](https://community.asterisk.org/u/yuyoungtaik)\
**Post date:** [July 12, 2024, 11:27am UTC](https://community.asterisk.org/t/agi-and-c-program/103314/3 "2024-07-12T11:27:20Z")

</div>

In php, create agi  
It seems like you are using a dialplan command such as agi.hanup.  
What I am saying is that c does not work.

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [July 12, 2024, 11:41am UTC](https://community.asterisk.org/t/agi-and-c-program/103314/4 "2024-07-12T11:41:07Z")

</div>

There are people who have written AGI applications in C. It’s completely up to them, unless a C library for it exists and it is used. AGIs can be written in basically anything. The project does not provide a library for it in C.

---

<div class="post-metadata">

**Author:** ![pchero](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/pchero/32/4189_2.png) [@pchero](https://community.asterisk.org/u/pchero)\
**Post date:** [July 12, 2024, 5:34pm UTC](https://community.asterisk.org/t/agi-and-c-program/103314/5 "2024-07-12T17:34:33Z")

</div>

I had a personal project that used AMI + AGI.

I don’t remember how this was working, but I remember that I enjoyed it with AMI + AGI in this project.

This repo is not active anymore but it might be helpful for you.

- [jade/src/main/dialplan\_handler.c at f31439d3af51b48c3e882f1ec8ad4a186587cd48 · pchero/jade · GitHub](https://github.com/pchero/jade/blob/f31439d3af51b48c3e882f1ec8ad4a186587cd48/src/main/dialplan_handler.c#L646)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [August 11, 2024, 5:35pm UTC](https://community.asterisk.org/t/agi-and-c-program/103314/6 "2024-08-11T17:35:29Z")

</div>

Closed on August 11, 2024, 5:35pm UTC

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