2012-03-13 21:24:13 +00:00
|
|
|
/*
|
|
|
|
|
* Asterisk -- An open source telephony toolkit.
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 1999 - 2012, Digium, Inc.
|
|
|
|
|
*
|
|
|
|
|
* See http://www.asterisk.org for more information about
|
|
|
|
|
* the Asterisk project. Please do not directly contact
|
|
|
|
|
* any of the maintainers of this project for assistance;
|
|
|
|
|
* the project provides a web site, mailing lists and IRC
|
|
|
|
|
* channels for your use.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software, distributed under the terms of
|
|
|
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
|
|
|
* at the top of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*! \file
|
|
|
|
|
* \brief Internal channel functions for channel.c to use
|
|
|
|
|
*/
|
|
|
|
|
|
2019-10-23 12:36:17 -05:00
|
|
|
#ifndef ASTERISK_CHANNEL_INTERNAL_H
|
|
|
|
|
#define ASTERISK_CHANNEL_INTERNAL_H
|
|
|
|
|
|
uniqueid: channel linkedid, ami, ari object creation with id's
Much needed was a way to assign id to objects on creation, and
much change was necessary to accomplish it. Channel uniqueids
and linkedids are split into separate string and creation time
components without breaking linkedid propgation. This allowed
the uniqueid to be specified by the user interface - and those
values are now carried through to channel creation, adding the
assignedids value to every function in the chain including the
channel drivers. For local channels, the second channel can be
specified or left to default to a ;2 suffix of first. In ARI,
bridge, playback, and snoop objects can also be created with a
specified uniqueid.
Along the way, the args order to allocating channels was fixed
in chan_mgcp and chan_gtalk, and linkedid is no longer lost as
masquerade occurs.
(closes issue ASTERISK-23120)
Review: https://reviewboard.asterisk.org/r/3191/
........
Merged revisions 410157 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 15:47:55 +00:00
|
|
|
#define ast_channel_internal_alloc(destructor, assignedid, requestor) __ast_channel_internal_alloc(destructor, assignedid, requestor, __FILE__, __LINE__, __PRETTY_FUNCTION__)
|
|
|
|
|
struct ast_channel *__ast_channel_internal_alloc(void (*destructor)(void *obj), const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *file, int line, const char *function);
|
channel: Add multi-tenant identifier.
This patch introduces a new identifier for channels: tenantid. It's
a stringfield on the channel that can be used for general purposes. It
will be inherited by other channels the same way that linkedid is.
You can set tenantid in a few ways. The first is to set it in the
dialplan with the Set and CHANNEL functions:
exten => example,1,Set(CHANNEL(tenantid)=My tenant ID)
It can also be accessed via CHANNEL:
exten => example,2,NoOp(CHANNEL(tenantid))
Another method is to use the new tenantid option for pjsip endpoints in
pjsip.conf:
[my_endpoint]
type=endpoint
tenantid=My tenant ID
This is considered the best approach since you will be able to see the
tenant ID as early as the Newchannel event.
It can also be set using set_var in pjsip.conf on the endpoint like
setting other channel variable:
set_var=CHANNEL(tenantid)=My tenant ID
Note that set_var will not show tenant ID on the Newchannel event,
however.
Tenant ID has also been added to CDR. It's read-only and can be accessed
via CDR(tenantid). You can also get the tenant ID of the last channel
communicated with via CDR(peertenantid).
Tenant ID will also show up in CEL records if it has been set, and the
version number has been bumped accordingly.
Fixes: #740
UserNote: tenantid has been added to channels. It can be read in
dialplan via CHANNEL(tenantid), and it can be set using
Set(CHANNEL(tenantid)=My tenant ID). In pjsip.conf, it is recommended to
use the new tenantid option for pjsip endpoints (e.g., tenantid=My
tenant ID) so that it will show up in Newchannel events. You can set it
like any other channel variable using set_var in pjsip.conf as well, but
note that this will NOT show up in Newchannel events. Tenant ID is also
available in CDR and can be accessed with CDR(tenantid). The peer tenant
ID can also be accessed with CDR(peertenantid). CEL includes tenant ID
as well if it has been set.
UpgradeNote: A new versioned struct (ast_channel_initializers) has been
added that gets passed to __ast_channel_alloc_ap. The new function
ast_channel_alloc_with_initializers should be used when creating
channels that require the use of this struct. Currently the only value
in the struct is for tenantid, but now more fields can be added to the
struct as necessary rather than the __ast_channel_alloc_ap function. A
new option (tenantid) has been added to endpoints in pjsip.conf as well.
CEL has had its version bumped to include tenant ID.
2024-05-21 11:11:26 -05:00
|
|
|
struct ast_channel *__ast_channel_internal_alloc_with_initializers(void (*destructor)(void *obj), const struct ast_assigned_ids *assignedids,
|
|
|
|
|
const struct ast_channel *requestor, const struct ast_channel_initializers *initializers, const char *file, int line, const char *function);
|
2012-03-13 21:24:13 +00:00
|
|
|
void ast_channel_internal_finalize(struct ast_channel *chan);
|
|
|
|
|
int ast_channel_internal_is_finalized(struct ast_channel *chan);
|
|
|
|
|
void ast_channel_internal_cleanup(struct ast_channel *chan);
|
2013-08-01 13:49:34 +00:00
|
|
|
int ast_channel_internal_setup_topics(struct ast_channel *chan);
|
2012-03-13 21:24:13 +00:00
|
|
|
|
2016-10-17 14:18:57 -05:00
|
|
|
void ast_channel_internal_errno_set(enum ast_channel_error error);
|
|
|
|
|
enum ast_channel_error ast_channel_internal_errno(void);
|
2017-02-13 10:50:47 -07:00
|
|
|
void ast_channel_internal_set_stream_topology(struct ast_channel *chan,
|
|
|
|
|
struct ast_stream_topology *topology);
|
2017-04-25 11:49:16 -05:00
|
|
|
void ast_channel_internal_set_stream_topology_change_source(
|
|
|
|
|
struct ast_channel *chan, void *change_source);
|
2017-02-13 10:50:47 -07:00
|
|
|
void ast_channel_internal_swap_stream_topology(struct ast_channel *chan1,
|
|
|
|
|
struct ast_channel *chan2);
|
2019-10-23 12:36:17 -05:00
|
|
|
|
2024-12-31 11:27:02 -07:00
|
|
|
/*! \brief The current channel storage driver */
|
|
|
|
|
extern const struct ast_channelstorage_driver *current_channel_storage_driver;
|
|
|
|
|
extern struct ast_channelstorage_instance *current_channel_storage_instance;
|
|
|
|
|
|
|
|
|
|
void ast_channel_close_storage(void);
|
|
|
|
|
int ast_channel_open_storage(void);
|
|
|
|
|
|
2019-10-23 12:36:17 -05:00
|
|
|
#endif /* ASTERISK_CHANNEL_INTERNAL_H */
|