Asterisk - The Open Source Telephony Project GIT-master-97770a9
stasis_channels.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2013, Digium, Inc.
5 *
6 * Matt Jordan <mjordan@digium.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19
20#ifndef STASIS_CHANNELS_H_
21#define STASIS_CHANNELS_H_
22
24#include "asterisk/stasis.h"
25#include "asterisk/channel.h"
26
27/*! \addtogroup StasisTopicsAndMessages
28 * @{
29 */
30
31/*!
32 * \since 17
33 * \brief Channel snapshot invalidation flags, used to force generation of segments
34 */
36 /*! Invalidate the bridge segment */
38 /*! Invalidate the dialplan segment */
40 /*! Invalidate the connected segment */
42 /*! Invalidate the caller segment */
44 /*! Invalidate the hangup segment */
46 /*! Invalidate the peer segment */
48 /*! Invalidate the base segment */
50};
51
52/*!
53 * \since 17
54 * \brief Structure containing bridge information for a channel snapshot.
55 */
57 char id[0]; /*!< Unique Bridge Identifier */
58};
59
60/*!
61 * \since 17
62 * \brief Structure containing dialplan information for a channel snapshot.
63 */
66 AST_STRING_FIELD(appl); /*!< Current application */
67 AST_STRING_FIELD(data); /*!< Data passed to current application */
68 AST_STRING_FIELD(context); /*!< Current extension context */
69 AST_STRING_FIELD(exten); /*!< Current extension number */
70 );
71 int priority; /*!< Current extension priority */
72};
73
74/*!
75 * \since 17
76 * \brief Structure containing caller information for a channel snapshot.
77 */
80 AST_STRING_FIELD(name); /*!< Caller ID Name */
81 AST_STRING_FIELD(number); /*!< Caller ID Number */
82 AST_STRING_FIELD(dnid); /*!< Dialed ID Number */
83 AST_STRING_FIELD(dialed_subaddr); /*!< Dialed subaddress */
84 AST_STRING_FIELD(ani); /*!< Caller ID ANI Number */
85 AST_STRING_FIELD(rdnis); /*!< Caller ID RDNIS Number */
86 AST_STRING_FIELD(subaddr); /*!< Caller subaddress */
87 );
88 int pres; /*!< Caller ID presentation. */
89};
90
91/*!
92 * \since 17
93 * \brief Structure containing connected information for a channel snapshot.
94 */
96 char *number; /*!< Connected Line Number */
97 char name[0]; /*!< Connected Line Name */
98};
99
100/*!
101 * \since 17
102 * \brief Structure containing base information for a channel snapshot.
103 */
106 AST_STRING_FIELD(name); /*!< ASCII unique channel name */
107 AST_STRING_FIELD(uniqueid); /*!< Unique Channel Identifier */
108 AST_STRING_FIELD(accountcode); /*!< Account code for billing */
109 AST_STRING_FIELD(userfield); /*!< Userfield for CEL billing */
110 AST_STRING_FIELD(language); /*!< The default spoken language for the channel */
111 AST_STRING_FIELD(type); /*!< Type of channel technology */
112 AST_STRING_FIELD(tenantid); /*!< Channel tenant identifier */
113 );
114 struct timeval creationtime; /*!< The time of channel creation */
115 int tech_properties; /*!< Properties of the channel's technology */
116 AST_STRING_FIELD_EXTENDED(protocol_id); /*!< Channel driver protocol id (i.e. Call-ID for chan_pjsip) */
117};
118
119/*!
120 * \since 17
121 * \brief Structure containing peer information for a channel snapshot.
122 */
124 char *linkedid; /*!< Linked Channel Identifier -- gets propagated by linkage */
125 char account[0]; /*!< Peer account code for billing */
126};
127
128/*!
129 * \since 17
130 * \brief Structure containing hangup information for a channel snapshot.
131 */
133 int cause; /*!< Why is the channel hanged up. See causes.h */
134 char source[0]; /*!< Who is responsible for hanging up this channel */
135};
136
137/*!
138 * \since 12
139 * \brief Structure representing a snapshot of channel state.
140 *
141 * While not enforced programmatically, this object is shared across multiple
142 * threads, and should be treated as an immutable object.
143 *
144 * It is guaranteed that the segments of this snapshot will always exist
145 * when accessing the snapshot.
146 */
148 struct ast_channel_snapshot_base *base; /*!< Base information about the channel */
149 struct ast_channel_snapshot_peer *peer; /*!< Peer information */
150 struct ast_channel_snapshot_caller *caller; /*!< Information about the caller */
151 struct ast_channel_snapshot_connected *connected; /*!< Information about who this channel is connected to */
152 struct ast_channel_snapshot_bridge *bridge; /*!< Information about the bridge */
153 struct ast_channel_snapshot_dialplan *dialplan; /*!< Information about the dialplan */
154 struct ast_channel_snapshot_hangup *hangup; /*!< Hangup information */
155 enum ast_channel_state state; /*!< State of line */
156 int amaflags; /*!< AMA flags for billing */
157 struct ast_flags flags; /*!< channel flags of AST_FLAG_ type */
158 struct ast_flags softhangup_flags; /*!< softhangup channel flags */
159 struct varshead *manager_vars; /*!< Variables to be appended to manager events */
160 struct varshead *ari_vars; /*!< Variables to be appended to ARI events */
161};
162
163/*!
164 * \since 17
165 * \brief Structure representing a change of snapshot of channel state.
166 *
167 * While not enforced programmatically, this object is shared across multiple
168 * threads, and should be treated as an immutable object.
169 *
170 * \note This structure will not have a transition of an old snapshot with no
171 * new snapshot to indicate that a channel has gone away. A new snapshot will
172 * always exist and a channel going away can be determined by checking for the
173 * AST_FLAG_DEAD flag on the new snapshot.
174 */
176 struct ast_channel_snapshot *old_snapshot; /*!< The old channel snapshot */
177 struct ast_channel_snapshot *new_snapshot; /*!< The new channel snapshot */
178};
179
180/*!
181 * \since 12
182 * \brief Blob of data associated with a channel.
183 *
184 * This blob is actually shared amongst several \ref stasis_message_type's.
185 */
187 /*! Channel blob is associated with (or NULL for global/all channels) */
189 /*! JSON blob of data */
190 struct ast_json *blob;
191};
192
193/*!
194 * \since 12
195 * \brief A set of channels with blob objects - see \ref ast_channel_blob
196 */
198
200
201/*!
202 * \since 12
203 * \brief A topic which publishes the events for all channels.
204 * \return Topic for all channel events.
205 */
207
208/*!
209 * \since 12
210 * \brief Secondary channel cache, indexed by name.
211 *
212 * \return Cache of \ref ast_channel_snapshot.
213 */
215
216/*!
217 * \since 12
218 * \brief Message type for \ref ast_channel_snapshot_update.
219 *
220 * \return Message type for \ref ast_channel_snapshot_update.
221 */
223
224/*!
225 * \since 12
226 * \brief Generate a snapshot of the channel state. This is an ao2 object, so
227 * ao2_cleanup() to deallocate.
228 *
229 * \pre chan is locked
230 *
231 * \param chan The channel from which to generate a snapshot
232 *
233 * \return pointer on success (must be unreffed)
234 * \retval NULL on error
235 */
237 struct ast_channel *chan);
238
239/*!
240 * \since 12
241 * \brief Obtain the latest \ref ast_channel_snapshot from the \ref stasis cache. This is
242 * an ao2 object, so use \ref ao2_cleanup() to deallocate.
243 *
244 * \param uniqueid The channel's unique ID
245 *
246 * \return A \ref ast_channel_snapshot on success
247 * \retval NULL on error
248 */
249struct ast_channel_snapshot *ast_channel_snapshot_get_latest(const char *uniqueid);
250
251/*!
252 * \since 12
253 * \brief Obtain the latest \ref ast_channel_snapshot from the \ref stasis cache. This is
254 * an ao2 object, so use \ref ao2_cleanup() to deallocate.
255 *
256 * \param name The channel's name
257 *
258 * \return A \ref ast_channel_snapshot on success
259 * \retval NULL on error
260 */
262
263/*!
264 * \since 17
265 * \brief Send the final channel snapshot for a channel, thus removing it from cache
266 *
267 * \pre chan is locked
268 *
269 * \param chan The channel to send the final channel snapshot for
270 *
271 * \note This will also remove the cached snapshot from the channel itself
272 */
274
275/*!
276 * \since 12
277 * \brief Creates a \ref ast_channel_blob message.
278 *
279 * The given \a blob should be treated as immutable and not modified after it is
280 * put into the message.
281 *
282 * \pre chan is locked
283 *
284 * \param chan Channel blob is associated with, or \c NULL for global/all channels.
285 * \param type Message type for this blob.
286 * \param blob JSON object representing the data, or \c NULL for no data. If
287 * \c NULL, ast_json_null() is put into the object.
288 *
289 * \return \ref ast_channel_blob message.
290 * \retval NULL on error
291 */
293 struct stasis_message_type *type, struct ast_json *blob);
294
295/*!
296 * \since 12
297 * \brief Create a \ref ast_channel_blob message, pulling channel state from
298 * the cache.
299 *
300 * \param uniqueid Uniqueid of the channel.
301 * \param type Message type for this blob.
302 * \param blob JSON object representing the data, or \c NULL for no data. If
303 * \c NULL, ast_json_null() is put into the object.
304 *
305 * \return \ref ast_channel_blob message.
306 * \retval NULL on error
307 */
309 const char *uniqueid, struct stasis_message_type *type,
310 struct ast_json *blob);
311
312/*!
313 * \since 12
314 * \brief Create a \ref ast_multi_channel_blob suitable for a \ref stasis_message.
315 *
316 * The given \a blob should be treated as immutable and not modified after it is
317 * put into the message.
318 *
319 * \param blob The JSON blob that defines the data of this \ref ast_multi_channel_blob
320 *
321 * \return \ref ast_multi_channel_blob object
322 * \retval NULL on error
323*/
325
326/*!
327 * \since 12
328 * \brief Retrieve a channel snapshot associated with a specific role from a
329 * \ref ast_multi_channel_blob
330 *
331 * \note The reference count of the \ref ast_channel_snapshot returned from
332 * this function is not changed. The caller of this function does not own the
333 * reference to the snapshot.
334 *
335 * \param obj The \ref ast_multi_channel_blob containing the channel snapshot
336 * to retrieve
337 * \param role The role associated with the channel snapshot
338 *
339 * \return \ref ast_channel_snapshot matching the role on success
340 * \retval NULL on error or not found for the role specified
341 */
343 struct ast_multi_channel_blob *obj, const char *role);
344
345/*!
346 * \since 12
347 * \brief Retrieve all channel snapshots associated with a specific role from
348 * a \ref ast_multi_channel_blob
349 *
350 * \note Because this function returns an ao2_container (hashed by channel name)
351 * of all channel snapshots that matched the passed in role, the reference of
352 * the snapshots is increased by this function. The caller of this function must
353 * release the reference to the snapshots by disposing of the container
354 * appropriately.
355 *
356 * \param obj The \ref ast_multi_channel_blob containing the channel snapshots to
357 * retrieve
358 * \param role The role associated with the channel snapshots
359 *
360 * \return A container containing all \ref ast_channel_snapshot objects matching
361 * the role on success.
362 * \retval NULL on error or not found for the role specified
363 */
365 struct ast_multi_channel_blob *obj, const char *role);
366
367/*!
368 * \since 12
369 * \brief Retrieve the JSON blob from a \ref ast_multi_channel_blob.
370 * Returned \ref ast_json is still owned by \a obj
371 *
372 * \param obj Channel blob object.
373 * \return Type field value from the blob.
374 * \retval NULL on error.
375 */
377
378/*!
379 * \since 12
380 * \brief Add a \ref ast_channel_snapshot to a \ref ast_multi_channel_blob object
381 *
382 * \note This will increase the reference count by 1 for the channel snapshot. It is
383 * assumed that the \ref ast_multi_channel_blob will own a reference to the object.
384 *
385 * \param obj The \ref ast_multi_channel_blob object that will reference the snapshot
386 * \param role A \a role that the snapshot has in the multi channel relationship
387 * \param snapshot The \ref ast_channel_snapshot being added to the
388 * \ref ast_multi_channel_blob object
389 */
391 const char *role, struct ast_channel_snapshot *snapshot);
392
393/*!
394 * \brief Publish a channel blob message.
395 * \since 12.0.0
396 *
397 * \pre chan is locked
398 *
399 * \param chan Channel publishing the blob.
400 * \param type Type of stasis message.
401 * \param blob The blob being published. (NULL if no blob)
402 *
403 * \note This will use the current snapshot on the channel and will not generate a new one.
404 */
406 struct ast_json *blob);
407
408/*!
409 * \brief Publish a channel blob message using the latest snapshot from the cache
410 * \since 12.4.0
411 *
412 * \param chan Channel publishing the blob.
413 * \param type Type of stasis message.
414 * \param blob The blob being published. (NULL if no blob)
415 *
416 * \note As this only accesses the uniqueid and topic of the channel - neither of
417 * which should ever be changed on a channel anyhow - a channel does not have to
418 * be locked when calling this function.
419 */
421 struct ast_json *blob);
422
423/*!
424 * \since 12
425 * \brief Set flag to indicate channel snapshot is being staged.
426 *
427 * \pre chan is locked
428 *
429 * \param chan Channel being staged.
430 */
431void ast_channel_stage_snapshot(struct ast_channel *chan);
432
433/*!
434 * \since 12
435 * \brief Clear flag to indicate channel snapshot is being staged, and publish snapshot.
436 *
437 * \pre chan is locked
438 *
439 * \param chan Channel being staged.
440 */
442
443/*!
444 * \since 17
445 * \brief Invalidate a channel snapshot segment from being reused
446 *
447 * \pre chan is locked
448 *
449 * \param chan Channel to invalidate the segment on.
450 * \param segment The segment to invalidate.
451 */
454
455/*!
456 * \since 12
457 * \brief Publish a \ref ast_channel_snapshot for a channel.
458 *
459 * \pre chan is locked
460 *
461 * \param chan Channel to publish.
462 */
464
465/*!
466 * \since 12
467 * \brief Publish a \ref ast_channel_publish_varset for a channel.
468 *
469 * \pre chan is locked
470 *
471 * \param chan Channel to publish the event for, or \c NULL for 'none'.
472 * \param variable Name of the variable being set
473 * \param value Value.
474 */
476 const char *variable, const char *value);
477
478/*!
479 * \since 12
480 * \brief Message type for when a channel dials another channel
481 *
482 * \return A stasis message type
483 */
485
486/*!
487 * \since 12
488 * \brief Message type for when a variable is set on a channel.
489 *
490 * \return A stasis message type
491 */
493
494/*!
495 * \since 12
496 * \brief Message type for when a hangup is requested on a channel.
497 *
498 * \return A stasis message type
499 */
501
502/*!
503 * \since 16
504 * \brief Message type for when a channel is being masqueraded
505 *
506 * \return A stasis message type
507 */
509
510/*!
511 * \since 12
512 * \brief Message type for when DTMF begins on a channel.
513 *
514 * \return A stasis message type
515 */
517
518/*!
519 * \since 12
520 * \brief Message type for when DTMF ends on a channel.
521 *
522 * \return A stasis message type
523 */
525
526/*!
527 * \brief Message type for when a hook flash occurs on a channel.
528 *
529 * \return A stasis message type
530 */
532
533/*!
534 * \brief Message type for when a wink occurs on a channel.
535 *
536 * \return A stasis message type
537 */
539
540/*!
541 * \since 12
542 * \brief Message type for when a channel is placed on hold.
543 *
544 * \return A stasis message type
545 */
547
548/*!
549 * \since 12
550 * \brief Message type for when a channel is removed from hold.
551 *
552 * \return A stasis message type
553 */
555
556/*!
557 * \since 12
558 * \brief Message type for when a channel starts spying on another channel
559 *
560 * \return A stasis message type
561 */
563
564/*!
565 * \since 12
566 * \brief Message type for when a channel stops spying on another channel
567 *
568 * \return A stasis message type
569 */
571
572/*!
573 * \since 12
574 * \brief Message type for a fax operation
575 *
576 * \return A stasis message type
577 */
579
580/*!
581 * \since 12
582 * \brief Message type for hangup handler related actions
583 *
584 * \return A stasis message type
585 */
587
588/*!
589 * \since 18
590 * \brief Message type for starting mixmonitor on a channel
591 *
592 * \return A stasis message type
593 */
595
596/*!
597 * \since 18
598 * \brief Message type for stopping mixmonitor on a channel
599 *
600 * \return A stasis message type
601 */
603
604/*!
605 * \since 18
606 * \brief Message type for muting or unmuting mixmonitor on a channel
607 *
608 * \return A stasis message type
609 */
611
612/*!
613 * \since 18.0.0
614 * \brief Message type for agent login on a channel
615 *
616 * \return A stasis message type
617 */
619
620/*!
621 * \since 12.0.0
622 * \brief Message type for agent logoff on a channel
623 *
624 * \return A stasis message type
625 */
627
628/*!
629 * \since 12
630 * \brief Message type for starting music on hold on a channel
631 *
632 * \return A stasis message type
633 */
635
636/*!
637 * \since 12
638 * \brief Message type for stopping music on hold on a channel
639 *
640 * \return A stasis message type
641 */
643
644/*!
645 * \since 12.4.0
646 * \brief Message type for a channel starting talking
647 *
648 * \return A stasis message type
649 */
651
652/*!
653 * \since 12.4.0
654 * \brief Message type for a channel stopping talking
655 *
656 * \return A stasis message type
657 */
659
660/*!
661 * \since 22.0.0
662 * \brief Message type for a channel tone detection
663 *
664 * \return A stasis message type
665 */
667
668/*!
669 * \since 12
670 * \brief Publish in the \ref ast_channel_topic or \ref ast_channel_topic_all
671 * topics a stasis message for the channels involved in a dial operation.
672 *
673 * \param caller The channel performing the dial operation
674 * \param peer The channel being dialed
675 * \param dialstring When beginning a dial, the information passed to the
676 * dialing application
677 * \param dialstatus The current status of the dial operation (NULL if no
678 * status is known)
679 */
680void ast_channel_publish_dial(struct ast_channel *caller,
681 struct ast_channel *peer,
682 const char *dialstring,
683 const char *dialstatus);
684
685/*!
686 * \since 12
687 * \brief Publish in the \ref ast_channel_topic or \ref ast_channel_topic_all
688 * topics a stasis message for the channels involved in a dial operation that
689 * is forwarded.
690 *
691 * \param caller The channel performing the dial operation
692 * \param peer The channel being dialed
693 * \param forwarded The channel created as a result of the call forwarding
694 * \param dialstring The information passed to the dialing application when beginning a dial
695 * \param dialstatus The current status of the dial operation
696 * \param forward The call forward string provided by the dialed channel
697 */
699 struct ast_channel *peer,
700 struct ast_channel *forwarded,
701 const char *dialstring,
702 const char *dialstatus,
703 const char *forward);
704
705/*! @} */
706
707/*!
708 * \brief Build a JSON object from a \ref ast_channel_snapshot.
709 *
710 * \param snapshot The snapshot to convert to JSON
711 * \param sanitize The message sanitizer to use on the snapshot
712 *
713 * \return JSON object representing channel snapshot.
714 * \retval NULL on error
715 */
716struct ast_json *ast_channel_snapshot_to_json(const struct ast_channel_snapshot *snapshot,
717 const struct stasis_message_sanitizer *sanitize);
718
719/*!
720 * \brief Compares the context, exten and priority of two snapshots.
721 * \since 12
722 *
723 * \param old_snapshot Old snapshot
724 * \param new_snapshot New snapshot
725 *
726 * \retval True (non-zero) if context, exten or priority are identical.
727 * \retval False (zero) if context, exten and priority changed.
728 */
730 const struct ast_channel_snapshot *old_snapshot,
731 const struct ast_channel_snapshot *new_snapshot);
732
733/*!
734 * \brief Compares the callerid info of two snapshots.
735 * \since 12
736 *
737 * \param old_snapshot Old snapshot
738 * \param new_snapshot New snapshot
739 *
740 * \retval True (non-zero) if callerid are identical.
741 * \retval False (zero) if callerid changed.
742 */
744 const struct ast_channel_snapshot *old_snapshot,
745 const struct ast_channel_snapshot *new_snapshot);
746
747/*!
748 * \brief Compares the connected line info of two snapshots.
749 * \since 13.1.0
750 *
751 * \param old_snapshot Old snapshot
752 * \param new_snapshot New snapshot
753 *
754 * \retval True (non-zero) if callerid are identical.
755 * \retval False (zero) if callerid changed.
756 */
758 const struct ast_channel_snapshot *old_snapshot,
759 const struct ast_channel_snapshot *new_snapshot);
760
761/*!
762 * \brief Initialize the stasis channel topic and message types
763 * \retval 0 on success
764 * \retval Non-zero on error
765 */
767
768#endif /* STASIS_CHANNELS_H_ */
static const char type[]
Definition: chan_ooh323.c:109
General Asterisk PBX channel definitions.
ast_channel_state
ast_channel states
Definition: channelstate.h:35
static const char name[]
Definition: format_mp3.c:68
struct stasis_message_type * ast_channel_mixmonitor_mute_type(void)
Message type for muting or unmuting mixmonitor on a channel.
struct stasis_message_type * ast_channel_masquerade_type(void)
Message type for when a channel is being masqueraded.
struct ao2_container * ast_channel_cache_all(void)
void ast_channel_publish_varset(struct ast_channel *chan, const char *variable, const char *value)
Publish a ast_channel_publish_varset for a channel.
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
struct stasis_message_type * ast_channel_hold_type(void)
Message type for when a channel is placed on hold.
struct ast_multi_channel_blob * ast_multi_channel_blob_create(struct ast_json *blob)
Create a ast_multi_channel_blob suitable for a stasis_message.
struct stasis_message_type * ast_channel_talking_start(void)
Message type for a channel starting talking.
struct ast_channel_snapshot * ast_multi_channel_blob_get_channel(struct ast_multi_channel_blob *obj, const char *role)
Retrieve a channel snapshot associated with a specific role from a ast_multi_channel_blob.
struct stasis_message_type * ast_channel_chanspy_start_type(void)
Message type for when a channel starts spying on another channel.
struct stasis_message_type * ast_channel_chanspy_stop_type(void)
Message type for when a channel stops spying on another channel.
struct stasis_message_type * ast_channel_talking_stop(void)
Message type for a channel stopping talking.
struct stasis_message_type * ast_channel_dtmf_begin_type(void)
Message type for when DTMF begins on a channel.
struct stasis_message_type * ast_channel_mixmonitor_stop_type(void)
Message type for stopping mixmonitor on a channel.
struct stasis_message_type * ast_channel_tone_detect(void)
Message type for a channel tone detection.
struct stasis_message_type * ast_channel_varset_type(void)
Message type for when a variable is set on a channel.
struct stasis_message_type * ast_channel_hangup_handler_type(void)
Message type for hangup handler related actions.
void ast_channel_publish_cached_blob(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Publish a channel blob message using the latest snapshot from the cache.
void ast_channel_snapshot_invalidate_segment(struct ast_channel *chan, enum ast_channel_snapshot_segment_invalidation segment)
Invalidate a channel snapshot segment from being reused.
struct ast_channel_snapshot * ast_channel_snapshot_get_latest(const char *uniqueid)
Obtain the latest ast_channel_snapshot from the Stasis Message Bus API cache. This is an ao2 object,...
struct stasis_message_type * ast_channel_agent_logoff_type(void)
Message type for agent logoff on a channel.
struct ast_channel_snapshot * ast_channel_snapshot_create(struct ast_channel *chan)
Generate a snapshot of the channel state. This is an ao2 object, so ao2_cleanup() to deallocate.
struct ast_channel_snapshot * ast_channel_snapshot_get_latest_by_name(const char *name)
Obtain the latest ast_channel_snapshot from the Stasis Message Bus API cache. This is an ao2 object,...
void ast_channel_publish_dial(struct ast_channel *caller, struct ast_channel *peer, const char *dialstring, const char *dialstatus)
Publish in the ast_channel_topic or ast_channel_topic_all topics a stasis message for the channels in...
struct ao2_container * ast_multi_channel_blob_get_channels(struct ast_multi_channel_blob *obj, const char *role)
Retrieve all channel snapshots associated with a specific role from a ast_multi_channel_blob.
void ast_channel_publish_final_snapshot(struct ast_channel *chan)
Send the final channel snapshot for a channel, thus removing it from cache.
struct stasis_message_type * ast_channel_dial_type(void)
Message type for when a channel dials another channel.
struct stasis_message_type * ast_channel_moh_stop_type(void)
Message type for stopping music on hold on a channel.
void ast_channel_stage_snapshot_done(struct ast_channel *chan)
Clear flag to indicate channel snapshot is being staged, and publish snapshot.
void ast_multi_channel_blob_add_channel(struct ast_multi_channel_blob *obj, const char *role, struct ast_channel_snapshot *snapshot)
Add a ast_channel_snapshot to a ast_multi_channel_blob object.
struct stasis_message_type * ast_channel_unhold_type(void)
Message type for when a channel is removed from hold.
struct stasis_message_type * ast_channel_hangup_request_type(void)
Message type for when a hangup is requested on a channel.
struct stasis_message_type * ast_channel_agent_login_type(void)
Message type for agent login on a channel.
struct stasis_message_type * ast_channel_flash_type(void)
Message type for when a hook flash occurs on a channel.
struct stasis_message_type * ast_channel_snapshot_type(void)
Message type for ast_channel_snapshot_update.
struct stasis_message * ast_channel_blob_create_from_cache(const char *uniqueid, struct stasis_message_type *type, struct ast_json *blob)
Create a ast_channel_blob message, pulling channel state from the cache.
struct stasis_message_type * ast_channel_fax_type(void)
Message type for a fax operation.
struct stasis_message_type * ast_channel_dtmf_end_type(void)
Message type for when DTMF ends on a channel.
struct stasis_message_type * ast_channel_wink_type(void)
Message type for when a wink occurs on a channel.
struct ast_json * ast_multi_channel_blob_get_json(struct ast_multi_channel_blob *obj)
Retrieve the JSON blob from a ast_multi_channel_blob. Returned ast_json is still owned by obj.
ast_channel_snapshot_segment_invalidation
Channel snapshot invalidation flags, used to force generation of segments.
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.
struct ao2_container * ast_channel_cache_by_name(void)
Secondary channel cache, indexed by name.
void ast_channel_publish_blob(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Publish a channel blob message.
void ast_channel_stage_snapshot(struct ast_channel *chan)
Set flag to indicate channel snapshot is being staged.
void ast_channel_publish_dial_forward(struct ast_channel *caller, struct ast_channel *peer, struct ast_channel *forwarded, const char *dialstring, const char *dialstatus, const char *forward)
Publish in the ast_channel_topic or ast_channel_topic_all topics a stasis message for the channels in...
struct stasis_message_type * ast_channel_moh_start_type(void)
Message type for starting music on hold on a channel.
struct stasis_message * ast_channel_blob_create(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Creates a ast_channel_blob message.
struct stasis_message_type * ast_channel_mixmonitor_start_type(void)
Message type for starting mixmonitor on a channel.
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_PEER
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_CALLER
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_BRIDGE
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_CONNECTED
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
int ast_channel_snapshot_connected_line_equal(const struct ast_channel_snapshot *old_snapshot, const struct ast_channel_snapshot *new_snapshot)
Compares the connected line info of two snapshots.
struct ast_json * ast_channel_snapshot_to_json(const struct ast_channel_snapshot *snapshot, const struct stasis_message_sanitizer *sanitize)
Build a JSON object from a ast_channel_snapshot.
int ast_channel_snapshot_caller_id_equal(const struct ast_channel_snapshot *old_snapshot, const struct ast_channel_snapshot *new_snapshot)
Compares the callerid info of two snapshots.
int ast_stasis_channels_init(void)
Initialize the stasis channel topic and message types.
int ast_channel_snapshot_cep_equal(const struct ast_channel_snapshot *old_snapshot, const struct ast_channel_snapshot *new_snapshot)
Compares the context, exten and priority of two snapshots.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
Definition: stringfields.h:341
#define AST_STRING_FIELD(name)
Declare a string field.
Definition: stringfields.h:303
Generic container type.
Blob of data associated with a channel.
struct ast_channel_snapshot * snapshot
struct ast_json * blob
Structure containing base information for a channel snapshot.
const ast_string_field language
const ast_string_field tenantid
const ast_string_field accountcode
const ast_string_field userfield
AST_STRING_FIELD_EXTENDED(protocol_id)
const ast_string_field uniqueid
const ast_string_field type
const ast_string_field name
Structure containing bridge information for a channel snapshot.
Structure containing caller information for a channel snapshot.
const ast_string_field dialed_subaddr
const ast_string_field rdnis
const ast_string_field ani
const ast_string_field name
const ast_string_field subaddr
const ast_string_field dnid
Structure containing connected information for a channel snapshot.
Structure containing dialplan information for a channel snapshot.
const ast_string_field data
const ast_string_field context
const ast_string_field exten
const ast_string_field appl
Structure containing hangup information for a channel snapshot.
Structure containing peer information for a channel snapshot.
Structure representing a change of snapshot of channel state.
struct ast_channel_snapshot * old_snapshot
struct ast_channel_snapshot * new_snapshot
Structure representing a snapshot of channel state.
struct ast_channel_snapshot_connected * connected
struct varshead * manager_vars
struct varshead * ari_vars
struct ast_channel_snapshot_dialplan * dialplan
struct ast_channel_snapshot_peer * peer
struct ast_channel_snapshot_bridge * bridge
struct ast_channel_snapshot_base * base
enum ast_channel_state state
struct ast_flags softhangup_flags
struct ast_channel_snapshot_caller * caller
struct ast_flags flags
struct ast_channel_snapshot_hangup * hangup
Main Channel structure associated with a channel.
Structure used to handle boolean flags.
Definition: utils.h:199
Abstract JSON element (object, array, string, int, ...).
A multi channel blob data structure for multi_channel_blob stasis messages.
struct ast_json * blob
Number structure.
Definition: app_followme.c:154
Structure containing callbacks for Stasis message sanitization.
Definition: stasis.h:200
int value
Definition: syslog.c:37