# Understanding FreePBX API calls

**URL:** <https://community.freepbx.org/t/understanding-freepbx-api-calls/77206>\
**Category:** Development\
**Tags:** development, freepbx-15, freepbx\
**Created:** [August 4, 2021, 8:42pm UTC](https://community.freepbx.org/t/understanding-freepbx-api-calls/77206 "2021-08-04T20:42:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sholinaty](https://community.freepbx.org/user_avatar/community.freepbx.org/sholinaty/32/18987_2.png) [@sholinaty](https://community.freepbx.org/u/sholinaty)\
**Post date:** [August 4, 2021, 8:42pm UTC](https://community.freepbx.org/t/understanding-freepbx-api-calls/77206/1 "2021-08-04T20:42:53Z")

</div>

I am hoping to ask this in a more public setting so that Others who are hoping to work on bugfixes and feature improvements

When chasing down interesting items in the source code, you will often come across calls to FreePBX / other functions that look like this:  
`$this->freepbx->Voicemail->addMailbox($input['extensionId'],$input);`

how would one go about finding out where the above addMailbox function actually exists?

or in other words, can someone assist with decoding those breadcrumbs?

working on what I believe is a bug in the voicemail creation API, but having trouble chasing down the source.

---

<div class="post-metadata">

**Author:** ![sholinaty](https://community.freepbx.org/user_avatar/community.freepbx.org/sholinaty/32/18987_2.png) [@sholinaty](https://community.freepbx.org/u/sholinaty)\
**Post date:** [August 4, 2021, 8:44pm UTC](https://community.freepbx.org/t/understanding-freepbx-api-calls/77206/2 "2021-08-04T20:44:30Z")

</div>

> [@sholinaty](#):
>
> $this-\>freepbx-\>Voicemail-\>addMailbox

it looks like this explicitly refers to Voicemail \> voicemail.class.php and the addMailbox function therein

---

<div class="post-metadata">

**Author:** ![jfinstrom](https://community.freepbx.org/user_avatar/community.freepbx.org/jfinstrom/32/12705_2.png) [@jfinstrom](https://community.freepbx.org/u/jfinstrom)\
**Post date:** [August 5, 2021, 1:08am UTC](https://community.freepbx.org/t/understanding-freepbx-api-calls/77206/3 "2021-08-05T01:08:21Z")

</div>

FreePBX::Module()-\>method()

In your case Module is Voicemail

/var/html/admin/modules/voicemail/Voicemail.class.php

It pretty much always follows this pattern.  
Webroot, admin, modules, the module name, the Modulename.class.php

If you find something that’s just a function without the FreePBX module name stuff in front of it such as

voicemail\_dosomething() then it will be in the same folder and likely in functions.inc.php

---

<div class="post-metadata">

**Author:** ![system](https://community.freepbx.org/uploads/default/original/3X/f/7/f7056d57e04fdbf71c6ad967e1ced351317f5c3f.png) [@system](https://community.freepbx.org/u/system)\
**Post date:** [August 12, 2021, 1:19am UTC](https://community.freepbx.org/t/understanding-freepbx-api-calls/77206/4 "2021-08-12T01:19:19Z")

</div>

Closed on August 12, 2021, 1:19am UTC

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