SIP Headers

Just been altering our system at work to use SIP for all calls now rather than dahdi.
It uses mysql to get some variables for making calls and putting into asterisk but I have wondered where some of the other content is coming from, is anyone able to tell me how the SIP headers are created for use in an asterisk call?

I have used the sip debug to see the headers sent but don’t really know how it actually creates the whole header and searching on the internet does not seem to be producing any real information on it at the moment.

The easiest way of answering a question lilke that is to read the source code.

Ok, don’t suppose you would happen to know which file or directory of the source code contains this information?
I have had a look through a few of the files but have not managed to find anything about the headers so far.


Thanks david, much appreciated. I shall have a look around now.
I thought it might have been something our system did as the previous IT guys have hacked away and built a few customs things with no documentation for our asterisk installation and did wonder at first if this was one of them.
At least it seems not although now I just have to find how asterisk is passed the information, fun times.

Is there any specific data in the header that you need to change/modify ?