Hi,
I’ve been trying to understand the source code better. I don’t really understand where the first entry points are where Asterisk receives incoming messages and processes them. Is it through the PJSIP library files or just the main Asterisk source code? If so what is the first function that is sure to interact with every incoming message?
That would be in the PJSIP library. It is what receives messages from a socket, parses them, does validation, and then invokes some internal things, before finally getting to our distributor[1]. The PJSIP stack uses modules which can inject themselves at different points so they are invoked.
[1] asterisk/res/res_pjsip/pjsip_distributor.c at master · asterisk/asterisk · GitHub
Hey thanks so much for explaining that. That confirms my suspicions! Do you know specifically which of the files and functions within the pjsip module in the pjproject library is the first entry point?
We have a transport implementation for websocket ourselves, so according to that the function called by transports to hand over the message is pjsip_tpmgr_receive_packet[1]. If you want to go even before that, then it depends on the transport in use.
[1] asterisk/res/res_pjsip_transport_websocket.c at master · asterisk/asterisk · GitHub
The link you provided is to where the pjsip_tpmgr_receive_packet function is used. Where is it implemented? I understand that it would be in the third-party/pjproject/source directory once the asterisk project has been built using the make command to install the necessary pjproject files, but don’t know in which of those files it could possibly be?
I don’t know off the top of my head, I would need to use grep or something to look myself.
Hi, I tried using grep to locate that function, but couldn’t find it. I used it after $make in the asterisk source code location, that is the correct point to use it at, right? Because only from then onwards the pjsip files are downloaded. My question is now, whether I failed to do one step or what reasons might be that I am unable to use grep to find the function?
What is the current version of pjsip that asterisk uses? Maybe I can just pull the PJSIP source code directly and look at it that way.
The version for all third party bundled stuff is specified in versions.mak[1]
[1] asterisk/third-party/versions.mak at master · asterisk/asterisk
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.