Skip to content
Snippets Groups Projects
Commit adc28d1e authored by Luigi Rizzo's avatar Luigi Rizzo
Browse files

rename handle_request() to handle_incoming(), as the former

was misleading - the function deals with all incoming packets, be
them requests or responses.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 6fe18e24
Branches
Tags
No related merge requests found
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
* sipsock_read(). This function parses the packet and matches an existing * sipsock_read(). This function parses the packet and matches an existing
* dialog or starts a new SIP dialog. * dialog or starts a new SIP dialog.
* *
* sipsock_read sends the packet to handle_request(), that parses a bit more. * sipsock_read sends the packet to handle_incoming(), that parses a bit more.
* if it's a response to an outbound request, it's sent to handle_response(). * If it is a response to an outbound request, the packet is sent to handle_response().
* If it is a request, handle_request sends it to one of a list of functions * If it is a request, handle_incoming() sends it to one of a list of functions
* depending on the request type - INVITE, OPTIONS, REFER, BYE, CANCEL etc * depending on the request type - INVITE, OPTIONS, REFER, BYE, CANCEL etc
* sipsock_read locks the ast_channel if it exists (an active call) and * sipsock_read locks the ast_channel if it exists (an active call) and
* unlocks it after we have processed the SIP message. * unlocks it after we have processed the SIP message.
...@@ -1724,7 +1724,7 @@ static void build_contact(struct sip_pvt *p); ...@@ -1724,7 +1724,7 @@ static void build_contact(struct sip_pvt *p);
static void build_rpid(struct sip_pvt *p); static void build_rpid(struct sip_pvt *p);
   
/*------Request handling functions */ /*------Request handling functions */
static int handle_request(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int *recount, int *nounlock); static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int *recount, int *nounlock);
static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin, int *recount, char *e, int *nounlock); static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin, int *recount, char *e, int *nounlock);
static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, int *nounlock); static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, int *nounlock);
static int handle_request_bye(struct sip_pvt *p, struct sip_request *req); static int handle_request_bye(struct sip_pvt *p, struct sip_request *req);
...@@ -4969,7 +4969,7 @@ static struct sip_pvt *sip_alloc(ast_string_field callid, struct sockaddr_in *si ...@@ -4969,7 +4969,7 @@ static struct sip_pvt *sip_alloc(ast_string_field callid, struct sockaddr_in *si
/*! \brief find or create a dialog structure for an incoming SIP message. /*! \brief find or create a dialog structure for an incoming SIP message.
* Connect incoming SIP message to current dialog or create new dialog structure * Connect incoming SIP message to current dialog or create new dialog structure
* Returns a reference to the sip_pvt object, remember to give it back once done. * Returns a reference to the sip_pvt object, remember to give it back once done.
* Called by handle_request, sipsock_read * Called by handle_incoming(), sipsock_read
*/ */
static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *sin, const int intended_method) static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *sin, const int intended_method)
{ {
...@@ -13370,7 +13370,7 @@ static void stop_media_flows(struct sip_pvt *p) ...@@ -13370,7 +13370,7 @@ static void stop_media_flows(struct sip_pvt *p)
} }
   
/*! \brief Handle SIP response in dialogue */ /*! \brief Handle SIP response in dialogue */
/* XXX only called by handle_request */ /* XXX only called by handle_incoming */
static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno) static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno)
{ {
struct ast_channel *owner; struct ast_channel *owner;
...@@ -15823,7 +15823,7 @@ static int handle_request_register(struct sip_pvt *p, struct sip_request *req, s ...@@ -15823,7 +15823,7 @@ static int handle_request_register(struct sip_pvt *p, struct sip_request *req, s
/*! \brief Handle incoming SIP requests (methods) /*! \brief Handle incoming SIP requests (methods)
\note This is where all incoming requests go first */ \note This is where all incoming requests go first */
/* called with p and p->owner locked */ /* called with p and p->owner locked */
static int handle_request(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int *recount, int *nounlock) static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int *recount, int *nounlock)
{ {
/* Called with p->lock held, as well as p->owner->lock if appropriate, keeping things /* Called with p->lock held, as well as p->owner->lock if appropriate, keeping things
relatively static */ relatively static */
...@@ -16038,7 +16038,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc ...@@ -16038,7 +16038,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
/*! \brief Read data from SIP socket /*! \brief Read data from SIP socket
\note sipsock_read locks the owner channel while we are processing the SIP message \note sipsock_read locks the owner channel while we are processing the SIP message
\return 1 on error, 0 on success \return 1 on error, 0 on success
\note Successful messages is connected to SIP call and forwarded to handle_request() \note Successful messages is connected to SIP call and forwarded to handle_incoming()
*/ */
static int sipsock_read(int *id, int fd, short events, void *ignore) static int sipsock_read(int *id, int fd, short events, void *ignore)
{ {
...@@ -16122,7 +16122,7 @@ static int sipsock_read(int *id, int fd, short events, void *ignore) ...@@ -16122,7 +16122,7 @@ static int sipsock_read(int *id, int fd, short events, void *ignore)
return 1; return 1;
} }
nounlock = 0; nounlock = 0;
if (handle_request(p, &req, &sin, &recount, &nounlock) == -1) { if (handle_incoming(p, &req, &sin, &recount, &nounlock) == -1) {
/* Request failed */ /* Request failed */
ast_debug(1, "SIP message could not be handled, bad request: %-70.70s\n", p->callid[0] ? p->callid : "<no callid>"); ast_debug(1, "SIP message could not be handled, bad request: %-70.70s\n", p->callid[0] ? p->callid : "<no callid>");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment