# Using Asterisk Manager in C

**URL:** <https://community.asterisk.org/t/using-asterisk-manager-in-c/18601>\
**Category:** Asterisk General\
**Created:** [January 14, 2008, 2:08am UTC](https://community.asterisk.org/t/using-asterisk-manager-in-c/18601 "2008-01-14T02:08:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hisamekaizer](https://avatars.discourse-cdn.com/v4/letter/h/c89c15/32.png) [@hisamekaizer](https://community.asterisk.org/u/hisamekaizer)\
**Post date:** [January 14, 2008, 2:08am UTC](https://community.asterisk.org/t/using-asterisk-manager-in-c/18601/1 "2008-01-14T02:08:56Z")

</div>

Hello. I need help.

How do I connect to the Asterisk Manager in C? How to config? What commands in C that I have to issue? Do you also have any examples?

Thank you very much.

---

<div class="post-metadata">

**Author:** ![mbruni](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mbruni](https://community.asterisk.org/u/mbruni)\
**Post date:** [January 14, 2008, 9:06am UTC](https://community.asterisk.org/t/using-asterisk-manager-in-c/18601/2 "2008-01-14T09:06:21Z")

</div>

You can find informations about Asterisk manager interface here: [voip-info.org/wiki-Asterisk+manager+API](http://www.voip-info.org/wiki-Asterisk+manager+API) .  
Other infos categorized by language: [voip-info.org/wiki/view/Aste … r+Examples](http://www.voip-info.org/wiki/view/Asterisk+manager+Examples) .  
A simple Python sample (you should be able to translate this to C): [blog.vrplumber.com/1274](http://blog.vrplumber.com/1274) .

Cheers.

Marco Bruni

---

<div class="post-metadata">

**Author:** ![hisamekaizer](https://avatars.discourse-cdn.com/v4/letter/h/c89c15/32.png) [@hisamekaizer](https://community.asterisk.org/u/hisamekaizer)\
**Post date:** [January 15, 2008, 8:20am UTC](https://community.asterisk.org/t/using-asterisk-manager-in-c/18601/3 "2008-01-15T08:20:19Z")

</div>

How do I execute Asterisk commands in C? And how to retrieve the results upon executing a command? Thanks.

---

<div class="post-metadata">

**Author:** ![mbruni](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mbruni](https://community.asterisk.org/u/mbruni)\
**Post date:** [January 15, 2008, 11:19am UTC](https://community.asterisk.org/t/using-asterisk-manager-in-c/18601/4 "2008-01-15T11:19:41Z")

</div>

> [@](#):
>
> How do I execute Asterisk commands in C?

Write to the socket connected to Asterisk.

> [@](#):
>
> And how to retrieve the results upon executing a command?

Read from the socket connected to Asterisk.

Cheers.

Marco Bruni

---

<div class="post-metadata">

**Author:** ![hisamekaizer](https://avatars.discourse-cdn.com/v4/letter/h/c89c15/32.png) [@hisamekaizer](https://community.asterisk.org/u/hisamekaizer)\
**Post date:** [January 16, 2008, 12:35am UTC](https://community.asterisk.org/t/using-asterisk-manager-in-c/18601/5 "2008-01-16T00:35:02Z")

</div>

Lastly, can you show me some examples (syntax) on how to do that? Thanks.
