Suppose you want checks all Invite_requests in signaling message in asterisk, and then marked some Invite_requests so that asterisk have been different treat with them.
Could do it in signaling message in asterisk ? How can do it?
Do you have another solution in this regards?
I don’t really understand the question. Invite requests are routed to a dialplan context, based on the settings in sip.conf, and the dialplan can then handle them based on called and calling number, and can also read the values of SIP headers and various other information, and act on that information.
You probably need to read the book at asteriskdocs.org/
I know when a SIP packet is received to PBX server in port 5060, The PBX (asterisk) immediate dump it and check the header of sip and then handle it.
Now suppose i want add a few code where the PBX (asterisk) checks the header of sip and before handle it.
In before my posts, (please see viewtopic.php?f=1&t=87037) i found that the chan_sip.c is where the asterisk handle incomming sip messages. is it true?
Now, how can i set some flags or options in header of an incomming sip request_invite messages so that i could detect it in asterisk dailpalns files(extensions.conf)?
If all you need to do is inspect a header in the dialplan, you should use the dialplan function SIP_HEADER.
If you really need to modify the source code, most of the code for SIP is in chan_sip.c, although some has now been moved to channels/sip/*. However, for guidance on modifying the source code, you need to use a developer mailing list or IRC channel. These forums are not appropriate for developer level questions.
Specifically, invite requests are handled by handle_request_invite.
Having said that, I’m not sure you will get that much support unless it is likely that your code will become a standard part of Asterisk, i.e. it solves a real world problem without forcing the rest of the world to change, or it implements additional SIP functions that are already widely used, and may have an RFC.
Also, note that “dump” is the wrong word. It has rather negative connotations. My guess is that you meant something like store or save, but I’m not sure.
you solved my problem with your guidance. I think i could use dialplan fanction Sip_Header.
Do the fanction Sip_Header could return all fields in sip header?(such as Via,To,From and etc)?
Im with you about “dump”, It’s not true.
Thank you david55.