Asterisk - The Open Source Telephony Project GIT-master-754dea3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
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
23#include "asterisk/refer.h"
25#include "asterisk/stasis.h"
26#include "asterisk/channel.h"
27
28/*! \addtogroup StasisTopicsAndMessages
29 * @{
30 */
31
32/*!
33 * \since 17
34 * \brief Channel snapshot invalidation flags, used to force generation of segments
35 */
37 /*! Invalidate the bridge segment */
39 /*! Invalidate the dialplan segment */
41 /*! Invalidate the connected segment */
43 /*! Invalidate the caller segment */
45 /*! Invalidate the hangup segment */
47 /*! Invalidate the peer segment */
49 /*! Invalidate the base segment */
51};
52
53/*!
54 * \since 17
55 * \brief Structure containing bridge information for a channel snapshot.
56 */
58 char id[0]; /*!< Unique Bridge Identifier */
59};
60
61/*!
62 * \since 17
63 * \brief Structure containing dialplan information for a channel snapshot.
64 */
67 AST_STRING_FIELD(appl); /*!< Current application */
68 AST_STRING_FIELD(data); /*!< Data passed to current application */
69 AST_STRING_FIELD(context); /*!< Current extension context */
70 AST_STRING_FIELD(exten); /*!< Current extension number */
71 );
72 int priority; /*!< Current extension priority */
73};
74
75/*!
76 * \since 17
77 * \brief Structure containing caller information for a channel snapshot.
78 */
81 AST_STRING_FIELD(name); /*!< Caller ID Name */
82 AST_STRING_FIELD(number); /*!< Caller ID Number */
83 AST_STRING_FIELD(dnid); /*!< Dialed ID Number */
84 AST_STRING_FIELD(dialed_subaddr); /*!< Dialed subaddress */
85 AST_STRING_FIELD(ani); /*!< Caller ID ANI Number */
86 AST_STRING_FIELD(rdnis); /*!< Caller ID RDNIS Number */
87 AST_STRING_FIELD(subaddr); /*!< Caller subaddress */
88 );
89 int pres; /*!< Caller ID presentation. */
90};
91
92/*!
93 * \since 17
94 * \brief Structure containing connected information for a channel snapshot.
95 */
97 char *number; /*!< Connected Line Number */
98 char name[0]; /*!< Connected Line Name */
99};
100
101/*!
102 * \since 17
103 * \brief Structure containing base information for a channel snapshot.
104 */
107 AST_STRING_FIELD(name); /*!< ASCII unique channel name */
108 AST_STRING_FIELD(uniqueid); /*!< Unique Channel Identifier */
109 AST_STRING_FIELD(accountcode); /*!< Account code for billing */
110 AST_STRING_FIELD(userfield); /*!< Userfield for CEL billing */
111 AST_STRING_FIELD(language); /*!< The default spoken language for the channel */
112 AST_STRING_FIELD(type); /*!< Type of channel technology */
113 AST_STRING_FIELD(tenantid); /*!< Channel tenant identifier */
114 );
115 struct timeval creationtime; /*!< The time of channel creation */
116 int tech_properties; /*!< Properties of the channel's technology */
117 AST_STRING_FIELD_EXTENDED(protocol_id); /*!< Channel driver protocol id (i.e. Call-ID for chan_pjsip) */
118};
119
120/*!
121 * \since 17
122 * \brief Structure containing peer information for a channel snapshot.
123 */
125 char *linkedid; /*!< Linked Channel Identifier -- gets propagated by linkage */
126 char account[0]; /*!< Peer account code for billing */
127};
128
129/*!
130 * \since 17
131 * \brief Structure containing hangup information for a channel snapshot.
132 */
134 int cause; /*!< Why is the channel hanged up. See causes.h */
135 char source[0]; /*!< Who is responsible for hanging up this channel */
136};
137
138/*!
139 * \since 12
140 * \brief Structure representing a snapshot of channel state.
141 *
142 * While not enforced programmatically, this object is shared across multiple
143 * threads, and should be treated as an immutable object.
144 *
145 * It is guaranteed that the segments of this snapshot will always exist
146 * when accessing the snapshot.
147 */
149 struct ast_channel_snapshot_base *base; /*!< Base information about the channel */
150 struct ast_channel_snapshot_peer *peer; /*!< Peer information */
151 struct ast_channel_snapshot_caller *caller; /*!< Information about the caller */
152 struct ast_channel_snapshot_connected *connected; /*!< Information about who this channel is connected to */
153 struct ast_channel_snapshot_bridge *bridge; /*!< Information about the bridge */
154 struct ast_channel_snapshot_dialplan *dialplan; /*!< Information about the dialplan */
155 struct ast_channel_snapshot_hangup *hangup; /*!< Hangup information */
156 enum ast_channel_state state; /*!< State of line */
157 int amaflags; /*!< AMA flags for billing */
158 struct ast_flags flags; /*!< channel flags of AST_FLAG_ type */
159 struct ast_flags softhangup_flags; /*!< softhangup channel flags */
160 struct varshead *manager_vars; /*!< Variables to be appended to manager events */
161 struct varshead *ari_vars; /*!< Variables to be appended to ARI events */
162};
163
164/*!
165 * \since 17
166 * \brief Structure representing a change of snapshot of channel state.
167 *
168 * While not enforced programmatically, this object is shared across multiple
169 * threads, and should be treated as an immutable object.
170 *
171 * \note This structure will not have a transition of an old snapshot with no
172 * new snapshot to indicate that a channel has gone away. A new snapshot will
173 * always exist and a channel going away can be determined by checking for the
174 * AST_FLAG_DEAD flag on the new snapshot.
175 */
177 struct ast_channel_snapshot *old_snapshot; /*!< The old channel snapshot */
178 struct ast_channel_snapshot *new_snapshot; /*!< The new channel snapshot */
179};
180
181/*!
182 * \since 12
183 * \brief Blob of data associated with a channel.
184 *
185 * This blob is actually shared amongst several \ref stasis_message_type's.
186 */
188 /*! Channel blob is associated with (or NULL for global/all channels) */
190 /*! JSON blob of data */
191 struct ast_json *blob;
192};
193
194/*!
195 * \since 12
196 * \brief A set of channels with blob objects - see \ref ast_channel_blob
197 */
199
201
202/*!
203 * \since 12
204 * \brief A topic which publishes the events for all channels.
205 * \return Topic for all channel events.
206 */
208
209/*!
210 * \since 12
211 * \brief Secondary channel cache, indexed by name.
212 *
213 * \return Cache of \ref ast_channel_snapshot.
214 */
216
217/*!
218 * \since 12
219 * \brief Message type for \ref ast_channel_snapshot_update.
220 *
221 * \return Message type for \ref ast_channel_snapshot_update.
222 */
224
225/*!
226 * \since 12
227 * \brief Generate a snapshot of the channel state. This is an ao2 object, so
228 * ao2_cleanup() to deallocate.
229 *
230 * \pre chan is locked
231 *
232 * \param chan The channel from which to generate a snapshot
233 *
234 * \return pointer on success (must be unreffed)
235 * \retval NULL on error
236 */
238 struct ast_channel *chan);
239
240/*!
241 * \since 12
242 * \brief Obtain the latest \ref ast_channel_snapshot from the \ref stasis cache. This is
243 * an ao2 object, so use \ref ao2_cleanup() to deallocate.
244 *
245 * \param uniqueid The channel's unique ID
246 *
247 * \return A \ref ast_channel_snapshot on success
248 * \retval NULL on error
249 */
250struct ast_channel_snapshot *ast_channel_snapshot_get_latest(const char *uniqueid);
251
252/*!
253 * \since 12
254 * \brief Obtain the latest \ref ast_channel_snapshot from the \ref stasis cache. This is
255 * an ao2 object, so use \ref ao2_cleanup() to deallocate.
256 *
257 * \param name The channel's name
258 *
259 * \return A \ref ast_channel_snapshot on success
260 * \retval NULL on error
261 */
263
264/*!
265 * \since 17
266 * \brief Send the final channel snapshot for a channel, thus removing it from cache
267 *
268 * \pre chan is locked
269 *
270 * \param chan The channel to send the final channel snapshot for
271 *
272 * \note This will also remove the cached snapshot from the channel itself
273 */
275
276/*!
277 * \since 12
278 * \brief Creates a \ref ast_channel_blob message.
279 *
280 * The given \a blob should be treated as immutable and not modified after it is
281 * put into the message.
282 *
283 * \pre chan is locked
284 *
285 * \param chan Channel blob is associated with, or \c NULL for global/all channels.
286 * \param type Message type for this blob.
287 * \param blob JSON object representing the data, or \c NULL for no data. If
288 * \c NULL, ast_json_null() is put into the object.
289 *
290 * \return \ref ast_channel_blob message.
291 * \retval NULL on error
292 */
294 struct stasis_message_type *type, struct ast_json *blob);
295
296/*!
297 * \since 12
298 * \brief Create a \ref ast_channel_blob message, pulling channel state from
299 * the cache.
300 *
301 * \param uniqueid Uniqueid of the channel.
302 * \param type Message type for this blob.
303 * \param blob JSON object representing the data, or \c NULL for no data. If
304 * \c NULL, ast_json_null() is put into the object.
305 *
306 * \return \ref ast_channel_blob message.
307 * \retval NULL on error
308 */
310 const char *uniqueid, struct stasis_message_type *type,
311 struct ast_json *blob);
312
313/*!
314 * \since 12
315 * \brief Create a \ref ast_multi_channel_blob suitable for a \ref stasis_message.
316 *
317 * The given \a blob should be treated as immutable and not modified after it is
318 * put into the message.
319 *
320 * \param blob The JSON blob that defines the data of this \ref ast_multi_channel_blob
321 *
322 * \return \ref ast_multi_channel_blob object
323 * \retval NULL on error
324*/
326
327/*!
328 * \since 12
329 * \brief Retrieve a channel snapshot associated with a specific role from a
330 * \ref ast_multi_channel_blob
331 *
332 * \note The reference count of the \ref ast_channel_snapshot returned from
333 * this function is not changed. The caller of this function does not own the
334 * reference to the snapshot.
335 *
336 * \param obj The \ref ast_multi_channel_blob containing the channel snapshot
337 * to retrieve
338 * \param role The role associated with the channel snapshot
339 *
340 * \return \ref ast_channel_snapshot matching the role on success
341 * \retval NULL on error or not found for the role specified
342 */
344 struct ast_multi_channel_blob *obj, const char *role);
345
346/*!
347 * \since 12
348 * \brief Retrieve all channel snapshots associated with a specific role from
349 * a \ref ast_multi_channel_blob
350 *
351 * \note Because this function returns an ao2_container (hashed by channel name)
352 * of all channel snapshots that matched the passed in role, the reference of
353 * the snapshots is increased by this function. The caller of this function must
354 * release the reference to the snapshots by disposing of the container
355 * appropriately.
356 *
357 * \param obj The \ref ast_multi_channel_blob containing the channel snapshots to
358 * retrieve
359 * \param role The role associated with the channel snapshots
360 *
361 * \return A container containing all \ref ast_channel_snapshot objects matching
362 * the role on success.
363 * \retval NULL on error or not found for the role specified
364 */
366 struct ast_multi_channel_blob *obj, const char *role);
367
368/*!
369 * \since 12
370 * \brief Retrieve the JSON blob from a \ref ast_multi_channel_blob.
371 * Returned \ref ast_json is still owned by \a obj
372 *
373 * \param obj Channel blob object.
374 * \return Type field value from the blob.
375 * \retval NULL on error.
376 */
378
379/*!
380 * \since 12
381 * \brief Add a \ref ast_channel_snapshot to a \ref ast_multi_channel_blob object
382 *
383 * \note This will increase the reference count by 1 for the channel snapshot. It is
384 * assumed that the \ref ast_multi_channel_blob will own a reference to the object.
385 *
386 * \param obj The \ref ast_multi_channel_blob object that will reference the snapshot
387 * \param role A \a role that the snapshot has in the multi channel relationship
388 * \param snapshot The \ref ast_channel_snapshot being added to the
389 * \ref ast_multi_channel_blob object
390 */
392 const char *role, struct ast_channel_snapshot *snapshot);
393
394/*!
395 * \brief Publish a channel blob message.
396 * \since 12.0.0
397 *
398 * \pre chan is locked
399 *
400 * \param chan Channel publishing the blob.
401 * \param type Type of stasis message.
402 * \param blob The blob being published. (NULL if no blob)
403 *
404 * \note This will use the current snapshot on the channel and will not generate a new one.
405 */
407 struct ast_json *blob);
408
409/*!
410 * \brief Publish a channel blob message using the latest snapshot from the cache
411 * \since 12.4.0
412 *
413 * \param chan Channel publishing the blob.
414 * \param type Type of stasis message.
415 * \param blob The blob being published. (NULL if no blob)
416 *
417 * \note As this only accesses the uniqueid and topic of the channel - neither of
418 * which should ever be changed on a channel anyhow - a channel does not have to
419 * be locked when calling this function.
420 */
422 struct ast_json *blob);
423
424/*!
425 * \since 12
426 * \brief Set flag to indicate channel snapshot is being staged.
427 *
428 * \pre chan is locked
429 *
430 * \param chan Channel being staged.
431 */
432void ast_channel_stage_snapshot(struct ast_channel *chan);
433
434/*!
435 * \since 12
436 * \brief Clear flag to indicate channel snapshot is being staged, and publish snapshot.
437 *
438 * \pre chan is locked
439 *
440 * \param chan Channel being staged.
441 */
443
444/*!
445 * \since 17
446 * \brief Invalidate a channel snapshot segment from being reused
447 *
448 * \pre chan is locked
449 *
450 * \param chan Channel to invalidate the segment on.
451 * \param segment The segment to invalidate.
452 */
455
456/*!
457 * \since 12
458 * \brief Publish a \ref ast_channel_snapshot for a channel.
459 *
460 * \pre chan is locked
461 *
462 * \param chan Channel to publish.
463 */
465
466/*!
467 * \since 12
468 * \brief Publish a \ref ast_channel_publish_varset for a channel.
469 *
470 * \pre chan is locked
471 *
472 * \param chan Channel to publish the event for, or \c NULL for 'none'.
473 * \param variable Name of the variable being set
474 * \param value Value.
475 */
477 const char *variable, const char *value);
478
479/*!
480 * \since 12
481 * \brief Message type for when a channel dials another channel
482 *
483 * \return A stasis message type
484 */
486
487/*!
488 * \since 12
489 * \brief Message type for when a variable is set on a channel.
490 *
491 * \return A stasis message type
492 */
494
495/*!
496 * \since 12
497 * \brief Message type for when a hangup is requested on a channel.
498 *
499 * \return A stasis message type
500 */
502
503/*!
504 * \since 16
505 * \brief Message type for when a channel is being masqueraded
506 *
507 * \return A stasis message type
508 */
510
511/*!
512 * \since 12
513 * \brief Message type for when DTMF begins on a channel.
514 *
515 * \return A stasis message type
516 */
518
519/*!
520 * \since 12
521 * \brief Message type for when DTMF ends on a channel.
522 *
523 * \return A stasis message type
524 */
526
527/*!
528 * \brief Message type for when a hook flash occurs on a channel.
529 *
530 * \return A stasis message type
531 */
533
534/*!
535 * \brief Message type for when a wink occurs on a channel.
536 *
537 * \return A stasis message type
538 */
540
541/*!
542 * \since 12
543 * \brief Message type for when a channel is placed on hold.
544 *
545 * \return A stasis message type
546 */
548
549/*!
550 * \since 12
551 * \brief Message type for when a channel is removed from hold.
552 *
553 * \return A stasis message type
554 */
556
557/*!
558 * \since 12
559 * \brief Message type for when a channel starts spying on another channel
560 *
561 * \return A stasis message type
562 */
564
565/*!
566 * \since 12
567 * \brief Message type for when a channel stops spying on another channel
568 *
569 * \return A stasis message type
570 */
572
573/*!
574 * \since 12
575 * \brief Message type for a fax operation
576 *
577 * \return A stasis message type
578 */
580
581/*!
582 * \since 12
583 * \brief Message type for hangup handler related actions
584 *
585 * \return A stasis message type
586 */
588
589/*!
590 * \since 18
591 * \brief Message type for starting mixmonitor on a channel
592 *
593 * \return A stasis message type
594 */
596
597/*!
598 * \since 18
599 * \brief Message type for stopping mixmonitor on a channel
600 *
601 * \return A stasis message type
602 */
604
605/*!
606 * \since 18
607 * \brief Message type for muting or unmuting mixmonitor on a channel
608 *
609 * \return A stasis message type
610 */
612
613/*!
614 * \since 18.0.0
615 * \brief Message type for agent login on a channel
616 *
617 * \return A stasis message type
618 */
620
621/*!
622 * \since 12.0.0
623 * \brief Message type for agent logoff on a channel
624 *
625 * \return A stasis message type
626 */
628
629/*!
630 * \since 12
631 * \brief Message type for starting music on hold on a channel
632 *
633 * \return A stasis message type
634 */
636
637/*!
638 * \since 12
639 * \brief Message type for stopping music on hold on a channel
640 *
641 * \return A stasis message type
642 */
644
645/*!
646 * \since 12.4.0
647 * \brief Message type for a channel starting talking
648 *
649 * \return A stasis message type
650 */
652
653/*!
654 * \since 12.4.0
655 * \brief Message type for a channel stopping talking
656 *
657 * \return A stasis message type
658 */
660
661/*!
662 * \since 22.0.0
663 * \brief Message type for a channel tone detection
664 *
665 * \return A stasis message type
666 */
668
669/*
670 * \since 23
671 * \brief Message type for a attended or blind transfer request
672 *
673 * \return A stasis message type
674 */
676
677/*!
678 * \since 12
679 * \brief Publish in the \ref ast_channel_topic or \ref ast_channel_topic_all
680 * topics a stasis message for the channels involved in a dial operation.
681 *
682 * \param caller The channel performing the dial operation
683 * \param peer The channel being dialed
684 * \param dialstring When beginning a dial, the information passed to the
685 * dialing application
686 * \param dialstatus The current status of the dial operation (NULL if no
687 * status is known)
688 */
689void ast_channel_publish_dial(struct ast_channel *caller,
690 struct ast_channel *peer,
691 const char *dialstring,
692 const char *dialstatus);
693
694/*!
695 * \since 12
696 * \brief Publish in the \ref ast_channel_topic or \ref ast_channel_topic_all
697 * topics a stasis message for the channels involved in a dial operation that
698 * is forwarded.
699 *
700 * \param caller The channel performing the dial operation
701 * \param peer The channel being dialed
702 * \param forwarded The channel created as a result of the call forwarding
703 * \param dialstring The information passed to the dialing application when beginning a dial
704 * \param dialstatus The current status of the dial operation
705 * \param forward The call forward string provided by the dialed channel
706 */
708 struct ast_channel *peer,
709 struct ast_channel *forwarded,
710 const char *dialstring,
711 const char *dialstatus,
712 const char *forward);
713
714/*! @} */
715
716/*!
717 * \brief Build a JSON object from a \ref ast_channel_snapshot.
718 *
719 * \param snapshot The snapshot to convert to JSON
720 * \param sanitize The message sanitizer to use on the snapshot
721 *
722 * \return JSON object representing channel snapshot.
723 * \retval NULL on error
724 */
725struct ast_json *ast_channel_snapshot_to_json(const struct ast_channel_snapshot *snapshot,
726 const struct stasis_message_sanitizer *sanitize);
727
728/*!
729 * \brief Compares the context, exten and priority of two snapshots.
730 * \since 12
731 *
732 * \param old_snapshot Old snapshot
733 * \param new_snapshot New snapshot
734 *
735 * \retval True (non-zero) if context, exten or priority are identical.
736 * \retval False (zero) if context, exten and priority changed.
737 */
739 const struct ast_channel_snapshot *old_snapshot,
740 const struct ast_channel_snapshot *new_snapshot);
741
742/*!
743 * \brief Compares the callerid info of two snapshots.
744 * \since 12
745 *
746 * \param old_snapshot Old snapshot
747 * \param new_snapshot New snapshot
748 *
749 * \retval True (non-zero) if callerid are identical.
750 * \retval False (zero) if callerid changed.
751 */
753 const struct ast_channel_snapshot *old_snapshot,
754 const struct ast_channel_snapshot *new_snapshot);
755
756/*!
757 * \brief Compares the connected line info of two snapshots.
758 * \since 13.1.0
759 *
760 * \param old_snapshot Old snapshot
761 * \param new_snapshot New snapshot
762 *
763 * \retval True (non-zero) if callerid are identical.
764 * \retval False (zero) if callerid changed.
765 */
767 const struct ast_channel_snapshot *old_snapshot,
768 const struct ast_channel_snapshot *new_snapshot);
769
770
771/*!
772 * \since 23
773 * \brief Message published during an "ARI" transfer
774 */
776 /*! The channel receiving the transfer request */
778 /*! The bridge associated with the source channel */
780 /*! The peer channel */
782 /*! Referer identity */
784
785
786 /*! Destination extension */
788 /*! Information for attended transfers */
790 /*! The identified destination channel. */
792 /*! The bridge associated with the channel. */
794 /*! The peer of the destination channel. */
796 /*! An array of protocol specific params, e.g. from/to information */
798 /*! The current state of the transfer. */
800};
801
802
804 const char *referred_by, const char *exten,
805 const char *protocol_id, struct ast_channel *dest,
806 struct ast_refer_params *params, enum ast_control_transfer);
807
808/*!
809 * \brief Initialize the stasis channel topic and message types
810 * \retval 0 on success
811 * \retval Non-zero on error
812 */
814
815#endif /* STASIS_CHANNELS_H_ */
static const char type[]
Definition: chan_ooh323.c:109
General Asterisk PBX channel definitions.
#define AST_MAX_EXTENSION
Definition: channel.h:134
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 stasis_message_type * ast_channel_transfer_request_type(void)
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
ast_control_transfer
Out-of-call refer support.
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.
struct ast_ari_transfer_message * ast_ari_transfer_message_create(struct ast_channel *originating_chan, const char *referred_by, const char *exten, const char *protocol_id, struct ast_channel *dest, struct ast_refer_params *params, enum ast_control_transfer)
#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.
Message published during an "ARI" transfer.
char destination[AST_MAX_EXTENSION]
struct ast_refer_params * refer_params
struct ast_channel_snapshot * dest_peer
enum ast_control_transfer state
struct ast_bridge_snapshot * dest_bridge
struct ast_channel_snapshot * source_peer
struct ast_bridge_snapshot * source_bridge
struct ast_channel_snapshot * dest
struct ast_channel_snapshot * source
Structure that contains a snapshot of information about a bridge.
Definition: bridge.h:318
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:157
Structure containing callbacks for Stasis message sanitization.
Definition: stasis.h:200
int value
Definition: syslog.c:37