mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-13 18:47:44 +00:00
don't create new iax sessions when we shouldn't
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4324 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
962c8ba4f2
commit
1141525293
1
libs/iax/.update
Normal file
1
libs/iax/.update
Normal file
@ -0,0 +1 @@
|
|||||||
|
Mon Feb 19 12:03:56 EST 2007
|
@ -2916,17 +2916,29 @@ struct iax_event *iax_net_process(unsigned char *buf, int len, struct sockaddr_i
|
|||||||
struct iax_session *session;
|
struct iax_session *session;
|
||||||
|
|
||||||
if (ntohs(fh->scallno) & IAX_FLAG_FULL) {
|
if (ntohs(fh->scallno) & IAX_FLAG_FULL) {
|
||||||
|
int subclass = uncompress_subclass(fh->csub);
|
||||||
|
int makenew = 0;
|
||||||
|
|
||||||
/* Full size header */
|
/* Full size header */
|
||||||
if (len < sizeof(struct ast_iax2_full_hdr)) {
|
if (len < sizeof(struct ast_iax2_full_hdr)) {
|
||||||
DEBU(G "Short header received from %s\n", inet_ntoa(sin->sin_addr));
|
DEBU(G "Short header received from %s\n", inet_ntoa(sin->sin_addr));
|
||||||
IAXERROR "Short header received from %s\n", inet_ntoa(sin->sin_addr));
|
IAXERROR "Short header received from %s\n", inet_ntoa(sin->sin_addr));
|
||||||
}
|
}
|
||||||
|
/* Only allow it to make new sessions on types where that makes sense */
|
||||||
|
if ((fh->type == AST_FRAME_IAX) && ((subclass == IAX_COMMAND_NEW) ||
|
||||||
|
(subclass == IAX_COMMAND_POKE) ||
|
||||||
|
(subclass == IAX_COMMAND_REGREL) ||
|
||||||
|
(subclass == IAX_COMMAND_REGREQ))) {
|
||||||
|
makenew = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* We have a full header, process appropriately */
|
/* We have a full header, process appropriately */
|
||||||
session = iax_find_session(sin, ntohs(fh->scallno) & ~IAX_FLAG_FULL, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS, 1);
|
session = iax_find_session(sin, ntohs(fh->scallno) & ~IAX_FLAG_FULL, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS, makenew);
|
||||||
if (!session)
|
if (!session)
|
||||||
session = iax_txcnt_session(fh, len-sizeof(struct ast_iax2_full_hdr), sin, ntohs(fh->scallno) & ~IAX_FLAG_FULL, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS);
|
session = iax_txcnt_session(fh, len-sizeof(struct ast_iax2_full_hdr), sin, ntohs(fh->scallno) & ~IAX_FLAG_FULL, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS);
|
||||||
if (session)
|
if (session)
|
||||||
return iax_header_to_event(session, fh, len - sizeof(struct ast_iax2_full_hdr), sin);
|
return iax_header_to_event(session, fh, len - sizeof(struct ast_iax2_full_hdr), sin);
|
||||||
|
/* if we get here, the frame was invalid for some reason, we should probably send IAX_COMMAND_INVAL (as long as the subclass was not already IAX_COMMAND_INVAL) */
|
||||||
DEBU(G "No session?\n");
|
DEBU(G "No session?\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user