Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: Makefile context.h modules/dialog/dialog.c modules/dispatcher/README modules/dispatcher/doc/dispatcher_admin.xml modules/dispatcher/ds_fixups.c modules/exec/exec.c modules/exec/exec.h modules/exec/exec_mod.c modules/tm/t_ctx.c modules/tm/tm.c msg_translator.c
- Loading branch information
Showing
195 changed files
with
2,396 additions
and
1,018 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (C) 2014 OpenSIPS Solutions | ||
* | ||
* This file is part of opensips, a free SIP server. | ||
* | ||
* opensips is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* opensips is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
* | ||
* | ||
* history: | ||
* --------- | ||
* 2014-10-15 created (bogdan) | ||
*/ | ||
|
||
#include "dprint.h" | ||
#include "async.h" | ||
|
||
async_start_function *async_start_f = NULL; | ||
async_resume_function *async_resume_f = NULL; | ||
|
||
|
||
int register_async_handlers(async_start_function *f1, async_resume_function *f2) | ||
{ | ||
if (async_start_f) { | ||
LM_ERR("aync handler already registered, it cannot be override\n"); | ||
return -1; | ||
} | ||
|
||
async_start_f = f1; | ||
async_resume_f = f2; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright (C) 2014 OpenSIPS Solutions | ||
* | ||
* This file is part of opensips, a free SIP server. | ||
* | ||
* opensips is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* opensips is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
* | ||
* | ||
* history: | ||
* --------- | ||
* 2014-10-15 created (bogdan) | ||
*/ | ||
|
||
|
||
#ifndef _ASYNC_H_ | ||
#define _ASYNC_H_ | ||
|
||
#include "route_struct.h" | ||
#include "parser/msg_parser.h" | ||
|
||
|
||
/* function to handle script function in async mode. | ||
Input: the sip message, the function/action (MODULE_T) and the ID of | ||
the resume route (where to continue after the I/O is done). | ||
Output: 0 if the async call was successfuly done and script execution | ||
must be terminated. | ||
-1 some error happened and the async call did not happened. | ||
*/ | ||
|
||
|
||
/* internal used functions to start (from script) and | ||
* to continue (from reactor) async I/O ops */ | ||
typedef int (async_start_function) | ||
(struct sip_msg *msg, struct action* a , int resume_route); | ||
|
||
typedef int (async_resume_function) | ||
(int fd, void *param); | ||
|
||
extern async_start_function *async_start_f; | ||
extern async_resume_function *async_resume_f; | ||
|
||
int register_async_handlers(async_start_function *f1, async_resume_function *f2); | ||
|
||
|
||
/* async related functions to be used by the | ||
* functions exported by modules */ | ||
enum async_ret_code {ASYNC_DONE, ASYNC_CONTINUE, ASYNC_ERROR}; | ||
|
||
typedef enum async_ret_code (async_resume_module) | ||
(int fd, struct sip_msg *msg, void *param); | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.