How Can change Asterisk cource code

Im mojtaba. I have been some research in security in Asterisk and wrote some codes and functions in C. Now i want to add this function to Asterisk source code.
For example some of my code is in regard to when a sip packet is received to asterisk, first my functions run and monitor the header of sip, and if my function return success then asterisk could response to packet and if my function return fail, then the packet of sip drop.
i want my functions to add in asterisk source code where Asterisk dump sip packet before handle ti.
How can i do it?
Whit Regards.Mojtaba

Download the tarball, uncompress it and you can edit all the source code, there is no guide to do it simple, but if you have good C knowledge you can understand all. I guess you need to edit the chan_sip.c file.

Dear navaismo,
Thank you for your guidance. May i ask you what is the tarball and how can i work with it?
How can i find its’ folder of chan_sip.c?
Where is it ?
With regards.Mojtaba

you can extract the compressed file using “tar xvf asteriskpackage.tar.gz” . when you extract the file you will find chan_sip.c in channels folder .

If you don’t know what a tarball is, you are not ready to attempt to modify even relatively small pieces of open source *nix software, let alone a package with more than a million lines of source code.

Also, as explained under the developer forum heading, none of these forums are appropriate for people working with the source code, although I’m not sure that people on the developer list or IRC channel would have to time to answer such basic questions.

A tar ball is the the, normally compressed, archive file, created by the tar utility, containing all the source code for the package.

Once you extract the contents of the tarball, and you have learned enough about the structure of the code to attempt changing it, finding chan_sip.c will be trivial. In any case the find or locate tools should be able to find it (although you may have to wait overnight before you can use locate).

Dear friends,
I could solve my problem with your guidance. I appreciate you, specially navaismo and omid_mohajerani.
With Regards.Mojtaba