# Asterisk Source code

**URL:** <https://community.asterisk.org/t/asterisk-source-code/43227>\
**Category:** Asterisk General\
**Created:** [June 28, 2013, 9:43pm UTC](https://community.asterisk.org/t/asterisk-source-code/43227 "2013-06-28T21:43:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mespio](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@mespio](https://community.asterisk.org/u/mespio)\
**Post date:** [June 28, 2013, 9:43pm UTC](https://community.asterisk.org/t/asterisk-source-code/43227/1 "2013-06-28T21:43:08Z")

</div>

Hi experts,  
In asterisk source code (such as chan\_sip.c file), there are alot of code like these:  
ast\_log(…)  
ast\_debug(…)  
I think there are some file in which the logs are recored to. Is it true?  
because i turn on asterisk debug "core set debud chanel all " but i didn’t any logs.  
I want trace some lines code in source code (such as chan\_sip.c), how can i do it?

With.regards.Mojtaba

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [June 28, 2013, 10:29pm UTC](https://community.asterisk.org/t/asterisk-source-code/43227/2 "2013-06-28T22:29:18Z")

</div>

The routing of logging is specified in /etc/asterisk/logger.conf

The older format: core set debug   
and variants still seems to be supported.

This is not an appropriate forum for support questions; please use Asterisk Support, in future.

---

<div class="post-metadata">

**Author:** ![mespio](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@mespio](https://community.asterisk.org/u/mespio)\
**Post date:** [June 29, 2013, 8:36am UTC](https://community.asterisk.org/t/asterisk-source-code/43227/3 "2013-06-29T08:36:44Z")

</div>

Thanks for your replying.  
How can i trace some my code in asterisk source code? I added some code to chan\_sip.c file, now i want logged them to file, as like asterisk do (ast\_log() of ast\_debug() functions), but i dont know where loggs is saved?

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [June 29, 2013, 11:18am UTC](https://community.asterisk.org/t/asterisk-source-code/43227/4 "2013-06-29T11:18:57Z")

</div>

One more try, see [wiki.asterisk.org/wiki/display/ … nformation](https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information)

However, if you can’t work out what to do from my original instructions, you are going to have difficulty with your main project. Most ordinary end users work out how to get logging without needing detailed instructions.

---

<div class="post-metadata">

**Author:** ![manhha](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@manhha](https://community.asterisk.org/u/manhha)\
**Post date:** [June 25, 2014, 6:43am UTC](https://community.asterisk.org/t/asterisk-source-code/43227/5 "2014-06-25T06:43:45Z")

</div>

Hi all,  
Currently I start work with Asterisk, I have a question, please help me have answer.

- How to debug source code same as can set break point in src?

---

<div class="post-metadata">

**Author:** ![manhha](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@manhha](https://community.asterisk.org/u/manhha)\
**Post date:** [June 25, 2014, 6:49am UTC](https://community.asterisk.org/t/asterisk-source-code/43227/6 "2014-06-25T06:49:11Z")

</div>

Hi all,  
When develop or fix bug of asterisk how to debug? and we can set breakpoint in source code?

Thank you so much

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [June 25, 2014, 6:50am UTC](https://community.asterisk.org/t/asterisk-source-code/43227/7 "2014-06-25T06:50:03Z")

</div>

gdb

However this is not a support forum and this board is not a developer board.

Also, please do not tail end existing threads.

---

<div class="post-metadata">

**Author:** ![manhha](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@manhha](https://community.asterisk.org/u/manhha)\
**Post date:** [June 25, 2014, 6:59am UTC](https://community.asterisk.org/t/asterisk-source-code/43227/8 "2014-06-25T06:59:30Z")

</div>

Hi david55,  
you mean we can use gdb asterisk -r  
Thanks for your help

---

<div class="post-metadata">

**Author:** ![manhha](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@manhha](https://community.asterisk.org/u/manhha)\
**Post date:** [June 25, 2014, 7:01am UTC](https://community.asterisk.org/t/asterisk-source-code/43227/9 "2014-06-25T07:01:39Z")

</div>

Hello everyone,  
How to debug source code of asterisk? Same as set breakpoint in src.  
Thanks for your help.

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [June 25, 2014, 7:36am UTC](https://community.asterisk.org/t/asterisk-source-code/43227/10 "2014-06-25T07:36:29Z")

</div>

If you need to ask how to invoke gdb, you should not be attempting to debug Asterisk. Understanding Asterisk is a lot more difficult than reading the gdb man page and basic documentation.

There is no -r option in the version of gdb I have, so I don’t know what it means.

Debugging rasterisk is not likely to be useful if you are actually interested in the main daemon.

---

<div class="post-metadata">

**Author:** ![manhha](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@manhha](https://community.asterisk.org/u/manhha)\
**Post date:** [June 26, 2014, 1:42am UTC](https://community.asterisk.org/t/asterisk-source-code/43227/11 "2014-06-26T01:42:31Z")

</div>

Thank david55,  
I can debug with gdb.  
Thank you .
