Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: rtp_relay: add support for recording in rtp_relay
- Loading branch information
1 parent
9d61b9f
commit 0783459
Showing
14 changed files
with
549 additions
and
111 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,31 @@ | ||
/* | ||
* Copyright (C) 2021 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
#include "rtp_relay_load.h" | ||
|
||
int rtp_relay_load(struct rtp_relay_binds *binds) | ||
{ | ||
binds->get_ctx = rtp_relay_get_context; | ||
binds->get_ctx_dlg = rtp_relay_get_context_dlg; | ||
binds->copy_create = rtp_relay_copy_create; | ||
binds->copy_start = rtp_relay_copy_start; | ||
binds->copy_stop = rtp_relay_copy_stop; | ||
return 1; | ||
} |
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,29 @@ | ||
/* | ||
* Copyright (C) 2021 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#ifndef _RTP_RELAY_COMMON_H_ | ||
#define _RTP_RELAY_COMMON_H_ | ||
|
||
typedef void * rtp_copy_ctx; | ||
|
||
#define RTP_COPY_MODE_SIPREC (1<<0) | ||
|
||
#endif /* _RTP_RELAY_COMMON_H_ */ |
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,70 @@ | ||
/* | ||
* Copyright (C) 2021 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#ifndef _RTP_RELAY_LOAD_H_ | ||
#define _RTP_RELAY_LOAD_H_ | ||
|
||
#include "../../str.h" | ||
#include "../../sr_module.h" | ||
#include "rtp_relay_common.h" | ||
struct dlg_cell; | ||
|
||
typedef void * rtp_ctx; | ||
|
||
struct rtp_relay_binds { | ||
rtp_ctx (*get_ctx)(void); | ||
rtp_ctx (*get_ctx_dlg)(struct dlg_cell *); | ||
rtp_copy_ctx (*copy_create)(rtp_ctx ctx, str *flags, | ||
unsigned int copy_flags, str *ret_body); | ||
int (*copy_start)(rtp_ctx ctx, rtp_copy_ctx copy, | ||
str *flags, str *body); | ||
int (*copy_stop)(rtp_ctx ctx, rtp_copy_ctx copy, | ||
str *flags); | ||
}; | ||
|
||
typedef int (*load_rtp_relay_f)(struct rtp_relay_binds *rtpb); | ||
|
||
static inline int load_rtp_relay(struct rtp_relay_binds *rtpb) | ||
{ | ||
load_rtp_relay_f load_rtp_relay; | ||
|
||
/* import the rtp_relay auto-loading function */ | ||
if ( !(load_rtp_relay=(load_rtp_relay_f)find_export("load_rtp_relay", 0))) | ||
return -1; | ||
|
||
/* let the auto-loading function load all rtp_relay stuff */ | ||
if (load_rtp_relay(rtpb) == -1) | ||
return -1; | ||
|
||
return 0; | ||
} | ||
|
||
int rtp_relay_load(struct rtp_relay_binds *binds); | ||
rtp_ctx rtp_relay_get_context(void); | ||
rtp_ctx rtp_relay_get_context_dlg(struct dlg_cell *); | ||
rtp_copy_ctx rtp_relay_copy_create(rtp_ctx ctx, | ||
str *flags, unsigned int copy_flags, str *ret_body); | ||
int rtp_relay_copy_start(rtp_ctx ctx, rtp_copy_ctx copy, | ||
str *flags, str *body); | ||
int rtp_relay_copy_stop(rtp_ctx ctx, rtp_copy_ctx copy, | ||
str *flags); | ||
|
||
#endif /* _RTP_RELAY_LOAD_H_ */ |
Oops, something went wrong.