Asterisk - The Open Source Telephony Project GIT-master-27fb039
Loading...
Searching...
No Matches
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; /*!< Who is responsible for hanging up this channel */
136 int tech_cause; /*!< Technology-specific hangup cause */
137 char buffer[0]; /*!< \private Buffer to store source in */
138};
139
140/*!
141 * \since 12
142 * \brief Structure representing a snapshot of channel state.
143 *
144 * While not enforced programmatically, this object is shared across multiple
145 * threads, and should be treated as an immutable object.
146 *
147 * It is guaranteed that the segments of this snapshot will always exist
148 * when accessing the snapshot.
149 */
151 struct ast_channel_snapshot_base *base; /*!< Base information about the channel */
152 struct ast_channel_snapshot_peer *peer; /*!< Peer information */
153 struct ast_channel_snapshot_caller *caller; /*!< Information about the caller */
154 struct ast_channel_snapshot_connected *connected; /*!< Information about who this channel is connected to */
155 struct ast_channel_snapshot_bridge *bridge; /*!< Information about the bridge */
156 struct ast_channel_snapshot_dialplan *dialplan; /*!< Information about the dialplan */
157 struct ast_channel_snapshot_hangup *hangup; /*!< Hangup information */
158 enum ast_channel_state state; /*!< State of line */
159 int amaflags; /*!< AMA flags for billing */
160 struct ast_flags flags; /*!< channel flags of AST_FLAG_ type */
161 struct ast_flags softhangup_flags; /*!< softhangup channel flags */
162 struct varshead *manager_vars; /*!< Variables to be appended to manager events */
163 struct varshead *ari_vars; /*!< Variables to be appended to ARI events */
164};
165
166/*!
167 * \since 17
168 * \brief Structure representing a change of snapshot of channel state.
169 *
170 * While not enforced programmatically, this object is shared across multiple
171 * threads, and should be treated as an immutable object.
172 *
173 * \note This structure will not have a transition of an old snapshot with no
174 * new snapshot to indicate that a channel has gone away. A new snapshot will
175 * always exist and a channel going away can be determined by checking for the
176 * AST_FLAG_DEAD flag on the new snapshot.
177 */
179 struct ast_channel_snapshot *old_snapshot; /*!< The old channel snapshot */
180 struct ast_channel_snapshot *new_snapshot; /*!< The new channel snapshot */
181};
182
183/*!
184 * \since 12
185 * \brief Blob of data associated with a channel.
186 *
187 * This blob is actually shared amongst several \ref stasis_message_type's.
188 */
190 /*! Channel blob is associated with (or NULL for global/all channels) */
192 /*! JSON blob of data */
193 struct ast_json *blob;
194};
195
196/*!
197 * \since 12
198 * \brief A set of channels with blob objects - see \ref ast_channel_blob
199 */
201
203
204/*!
205 * \since 12
206 * \brief A topic which publishes the events for all channels.
207 * \return Topic for all channel events.
208 */
210
211/*!
212 * \since 12
213 * \brief Secondary channel cache, indexed by name.
214 *
215 * \return Cache of \ref ast_channel_snapshot.
216 */
218
219/*!
220 * \since 12
221 * \brief Message type for \ref ast_channel_snapshot_update.
222 *
223 * \return Message type for \ref ast_channel_snapshot_update.
224 */
226
227/*!
228 * \since 12
229 * \brief Generate a snapshot of the channel state. This is an ao2 object, so
230 * ao2_cleanup() to deallocate.
231 *
232 * \pre chan is locked
233 *
234 * \param chan The channel from which to generate a snapshot
235 *
236 * \return pointer on success (must be unreffed)
237 * \retval NULL on error
238 */
240 struct ast_channel *chan);
241
242/*!
243 * \since 12
244 * \brief Obtain the latest \ref ast_channel_snapshot from the \ref stasis cache. This is
245 * an ao2 object, so use \ref ao2_cleanup() to deallocate.
246 *
247 * \param uniqueid The channel's unique ID
248 *
249 * \return A \ref ast_channel_snapshot on success
250 * \retval NULL on error
251 */
252struct ast_channel_snapshot *ast_channel_snapshot_get_latest(const char *uniqueid);
253
254/*!
255 * \since 12
256 * \brief Obtain the latest \ref ast_channel_snapshot from the \ref stasis cache. This is
257 * an ao2 object, so use \ref ao2_cleanup() to deallocate.
258 *
259 * \param name The channel's name
260 *
261 * \return A \ref ast_channel_snapshot on success
262 * \retval NULL on error
263 */
265
266/*!
267 * \since 17
268 * \brief Send the final channel snapshot for a channel, thus removing it from cache
269 *
270 * \pre chan is locked
271 *
272 * \param chan The channel to send the final channel snapshot for
273 *
274 * \note This will also remove the cached snapshot from the channel itself
275 */
277
278/*!
279 * \since 12
280 * \brief Creates a \ref ast_channel_blob message.
281 *
282 * The given \a blob should be treated as immutable and not modified after it is
283 * put into the message.
284 *
285 * \pre chan is locked
286 *
287 * \param chan Channel blob is associated with, or \c NULL for global/all channels.
288 * \param type Message type for this blob.
289 * \param blob JSON object representing the data, or \c NULL for no data. If
290 * \c NULL, ast_json_null() is put into the object.
291 *
292 * \return \ref ast_channel_blob message.
293 * \retval NULL on error
294 */
296 struct stasis_message_type *type, struct ast_json *blob);
297
298/*!
299 * \since 12
300 * \brief Create a \ref ast_channel_blob message, pulling channel state from
301 * the cache.
302 *
303 * \param uniqueid Uniqueid of the channel.
304 * \param type Message type for this blob.
305 * \param blob JSON object representing the data, or \c NULL for no data. If
306 * \c NULL, ast_json_null() is put into the object.
307 *
308 * \return \ref ast_channel_blob message.
309 * \retval NULL on error
310 */
312 const char *uniqueid, struct stasis_message_type *type,
313 struct ast_json *blob);
314
315/*!
316 * \since 12
317 * \brief Create a \ref ast_multi_channel_blob suitable for a \ref stasis_message.
318 *
319 * The given \a blob should be treated as immutable and not modified after it is
320 * put into the message.
321 *
322 * \param blob The JSON blob that defines the data of this \ref ast_multi_channel_blob
323 *
324 * \return \ref ast_multi_channel_blob object
325 * \retval NULL on error
326*/
328
329/*!
330 * \since 12
331 * \brief Retrieve a channel snapshot associated with a specific role from a
332 * \ref ast_multi_channel_blob
333 *
334 * \note The reference count of the \ref ast_channel_snapshot returned from
335 * this function is not changed. The caller of this function does not own the
336 * reference to the snapshot.
337 *
338 * \param obj The \ref ast_multi_channel_blob containing the channel snapshot
339 * to retrieve
340 * \param role The role associated with the channel snapshot
341 *
342 * \return \ref ast_channel_snapshot matching the role on success
343 * \retval NULL on error or not found for the role specified
344 */
346 struct ast_multi_channel_blob *obj, const char *role);
347
348/*!
349 * \since 12
350 * \brief Retrieve all channel snapshots associated with a specific role from
351 * a \ref ast_multi_channel_blob
352 *
353 * \note Because this function returns an ao2_container (hashed by channel name)
354 * of all channel snapshots that matched the passed in role, the reference of
355 * the snapshots is increased by this function. The caller of this function must
356 * release the reference to the snapshots by disposing of the container
357 * appropriately.
358 *
359 * \param obj The \ref ast_multi_channel_blob containing the channel snapshots to
360 * retrieve
361 * \param role The role associated with the channel snapshots
362 *
363 * \return A container containing all \ref ast_channel_snapshot objects matching
364 * the role on success.
365 * \retval NULL on error or not found for the role specified
366 */
368 struct ast_multi_channel_blob *obj, const char *role);
369
370/*!
371 * \since 12
372 * \brief Retrieve the JSON blob from a \ref ast_multi_channel_blob.
373 * Returned \ref ast_json is still owned by \a obj
374 *
375 * \param obj Channel blob object.
376 * \return Type field value from the blob.
377 * \retval NULL on error.
378 */
380
381/*!
382 * \since 12
383 * \brief Add a \ref ast_channel_snapshot to a \ref ast_multi_channel_blob object
384 *
385 * \note This will increase the reference count by 1 for the channel snapshot. It is
386 * assumed that the \ref ast_multi_channel_blob will own a reference to the object.
387 *
388 * \param obj The \ref ast_multi_channel_blob object that will reference the snapshot
389 * \param role A \a role that the snapshot has in the multi channel relationship
390 * \param snapshot The \ref ast_channel_snapshot being added to the
391 * \ref ast_multi_channel_blob object
392 */
394 const char *role, struct ast_channel_snapshot *snapshot);
395
396/*!
397 * \brief Publish a channel blob message.
398 * \since 12.0.0
399 *
400 * \pre chan is locked
401 *
402 * \param chan Channel publishing the blob.
403 * \param type Type of stasis message.
404 * \param blob The blob being published. (NULL if no blob)
405 *
406 * \note This will use the current snapshot on the channel and will not generate a new one.
407 */
409 struct ast_json *blob);
410
411/*!
412 * \brief Publish a channel blob message using the latest snapshot from the cache
413 * \since 12.4.0
414 *
415 * \param chan Channel publishing the blob.
416 * \param type Type of stasis message.
417 * \param blob The blob being published. (NULL if no blob)
418 *
419 * \note As this only accesses the uniqueid and topic of the channel - neither of
420 * which should ever be changed on a channel anyhow - a channel does not have to
421 * be locked when calling this function.
422 */
424 struct ast_json *blob);
425
426/*!
427 * \since 12
428 * \brief Set flag to indicate channel snapshot is being staged.
429 *
430 * \pre chan is locked
431 *
432 * \param chan Channel being staged.
433 */
434void ast_channel_stage_snapshot(struct ast_channel *chan);
435
436/*!
437 * \since 12
438 * \brief Clear flag to indicate channel snapshot is being staged, and publish snapshot.
439 *
440 * \pre chan is locked
441 *
442 * \param chan Channel being staged.
443 */
445
446/*!
447 * \since 17
448 * \brief Invalidate a channel snapshot segment from being reused
449 *
450 * \pre chan is locked
451 *
452 * \param chan Channel to invalidate the segment on.
453 * \param segment The segment to invalidate.
454 */
457
458/*!
459 * \since 12
460 * \brief Publish a \ref ast_channel_snapshot for a channel.
461 *
462 * \pre chan is locked
463 *
464 * \param chan Channel to publish.
465 */
467
468/*!
469 * \since 12
470 * \brief Publish a \ref ast_channel_publish_varset for a channel.
471 *
472 * \pre chan is locked
473 *
474 * \param chan Channel to publish the event for, or \c NULL for 'none'.
475 * \param variable Name of the variable being set
476 * \param value Value.
477 */
479 const char *variable, const char *value);
480
481/*!
482 * \since 12
483 * \brief Message type for when a channel dials another channel
484 *
485 * \return A stasis message type
486 */
488
489/*!
490 * \since 12
491 * \brief Message type for when a variable is set on a channel.
492 *
493 * \return A stasis message type
494 */
496
497/*!
498 * \since 12
499 * \brief Message type for when a hangup is requested on a channel.
500 *
501 * \return A stasis message type
502 */
504
505/*!
506 * \since 16
507 * \brief Message type for when a channel is being masqueraded
508 *
509 * \return A stasis message type
510 */
512
513/*!
514 * \since 12
515 * \brief Message type for when DTMF begins on a channel.
516 *
517 * \return A stasis message type
518 */
520
521/*!
522 * \since 12
523 * \brief Message type for when DTMF ends on a channel.
524 *
525 * \return A stasis message type
526 */
528
529/*!
530 * \brief Message type for when a hook flash occurs on a channel.
531 *
532 * \return A stasis message type
533 */
535
536/*!
537 * \brief Message type for when a wink occurs on a channel.
538 *
539 * \return A stasis message type
540 */
542
543/*!
544 * \since 12
545 * \brief Message type for when a channel is placed on hold.
546 *
547 * \return A stasis message type
548 */
550
551/*!
552 * \since 12
553 * \brief Message type for when a channel is removed from hold.
554 *
555 * \return A stasis message type
556 */
558
559/*!
560 * \since 12
561 * \brief Message type for when a channel starts spying on another channel
562 *
563 * \return A stasis message type
564 */
566
567/*!
568 * \since 12
569 * \brief Message type for when a channel stops spying on another channel
570 *
571 * \return A stasis message type
572 */
574
575/*!
576 * \since 12
577 * \brief Message type for a fax operation
578 *
579 * \return A stasis message type
580 */
582
583/*!
584 * \since 12
585 * \brief Message type for hangup handler related actions
586 *
587 * \return A stasis message type
588 */
590
591/*!
592 * \since 18
593 * \brief Message type for starting mixmonitor on a channel
594 *
595 * \return A stasis message type
596 */
598
599/*!
600 * \since 18
601 * \brief Message type for stopping mixmonitor on a channel
602 *
603 * \return A stasis message type
604 */
606
607/*!
608 * \since 18
609 * \brief Message type for muting or unmuting mixmonitor on a channel
610 *
611 * \return A stasis message type
612 */
614
615/*!
616 * \since 18.0.0
617 * \brief Message type for agent login on a channel
618 *
619 * \return A stasis message type
620 */
622
623/*!
624 * \since 12.0.0
625 * \brief Message type for agent logoff on a channel
626 *
627 * \return A stasis message type
628 */
630
631/*!
632 * \since 12
633 * \brief Message type for starting music on hold on a channel
634 *
635 * \return A stasis message type
636 */
638
639/*!
640 * \since 12
641 * \brief Message type for stopping music on hold on a channel
642 *
643 * \return A stasis message type
644 */
646
647/*!
648 * \since 12.4.0
649 * \brief Message type for a channel starting talking
650 *
651 * \return A stasis message type
652 */
654
655/*!
656 * \since 12.4.0
657 * \brief Message type for a channel stopping talking
658 *
659 * \return A stasis message type
660 */
662
663/*!
664 * \since 22.0.0
665 * \brief Message type for a channel tone detection
666 *
667 * \return A stasis message type
668 */
670
671/*
672 * \since 23
673 * \brief Message type for a attended or blind transfer request
674 *
675 * \return A stasis message type
676 */
678
679/*!
680 * \since 12
681 * \brief Publish in the \ref ast_channel_topic or \ref ast_channel_topic_all
682 * topics a stasis message for the channels involved in a dial operation.
683 *
684 * \param caller The channel performing the dial operation
685 * \param peer The channel being dialed
686 * \param dialstring When beginning a dial, the information passed to the
687 * dialing application
688 * \param dialstatus The current status of the dial operation (NULL if no
689 * status is known)
690 */
691void ast_channel_publish_dial(struct ast_channel *caller,
692 struct ast_channel *peer,
693 const char *dialstring,
694 const char *dialstatus);
695
696/*!
697 * \since 12
698 * \brief Publish in the \ref ast_channel_topic or \ref ast_channel_topic_all
699 * topics a stasis message for the channels involved in a dial operation that
700 * is forwarded.
701 *
702 * \param caller The channel performing the dial operation
703 * \param peer The channel being dialed
704 * \param forwarded The channel created as a result of the call forwarding
705 * \param dialstring The information passed to the dialing application when beginning a dial
706 * \param dialstatus The current status of the dial operation
707 * \param forward The call forward string provided by the dialed channel
708 */
710 struct ast_channel *peer,
711 struct ast_channel *forwarded,
712 const char *dialstring,
713 const char *dialstatus,
714 const char *forward);
715
716/*! @} */
717
718/*!
719 * \brief Build a JSON object from a \ref ast_channel_snapshot.
720 *
721 * \param snapshot The snapshot to convert to JSON
722 * \param sanitize The message sanitizer to use on the snapshot
723 *
724 * \return JSON object representing channel snapshot.
725 * \retval NULL on error
726 */
727struct ast_json *ast_channel_snapshot_to_json(const struct ast_channel_snapshot *snapshot,
728 const struct stasis_message_sanitizer *sanitize);
729
730/*!
731 * \brief Compares the context, exten and priority of two snapshots.
732 * \since 12
733 *
734 * \param old_snapshot Old snapshot
735 * \param new_snapshot New snapshot
736 *
737 * \retval True (non-zero) if context, exten or priority are identical.
738 * \retval False (zero) if context, exten and priority changed.
739 */
741 const struct ast_channel_snapshot *old_snapshot,
742 const struct ast_channel_snapshot *new_snapshot);
743
744/*!
745 * \brief Compares the callerid info of two snapshots.
746 * \since 12
747 *
748 * \param old_snapshot Old snapshot
749 * \param new_snapshot New snapshot
750 *
751 * \retval True (non-zero) if callerid are identical.
752 * \retval False (zero) if callerid changed.
753 */
755 const struct ast_channel_snapshot *old_snapshot,
756 const struct ast_channel_snapshot *new_snapshot);
757
758/*!
759 * \brief Compares the connected line info of two snapshots.
760 * \since 13.1.0
761 *
762 * \param old_snapshot Old snapshot
763 * \param new_snapshot New snapshot
764 *
765 * \retval True (non-zero) if callerid are identical.
766 * \retval False (zero) if callerid changed.
767 */
769 const struct ast_channel_snapshot *old_snapshot,
770 const struct ast_channel_snapshot *new_snapshot);
771
772
773/*!
774 * \since 23
775 * \brief Message published during an "ARI" transfer
776 */
778 /*! The channel receiving the transfer request */
780 /*! The bridge associated with the source channel */
782 /*! The peer channel */
784 /*! Referer identity */
786
787
788 /*! Destination extension */
790 /*! Information for attended transfers */
792 /*! The identified destination channel. */
794 /*! The bridge associated with the channel. */
796 /*! The peer of the destination channel. */
798 /*! An array of protocol specific params, e.g. from/to information */
800 /*! The current state of the transfer. */
802};
803
804
806 const char *referred_by, const char *exten,
807 const char *protocol_id, struct ast_channel *dest,
808 struct ast_refer_params *params, enum ast_control_transfer);
809
810/*!
811 * \brief Initialize the stasis channel topic and message types
812 * \retval 0 on success
813 * \retval Non-zero on error
814 */
816
817#endif /* STASIS_CHANNELS_H_ */
static const char type[]
General Asterisk PBX channel definitions.
#define AST_MAX_EXTENSION
Definition channel.h:134
ast_channel_state
ast_channel states
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
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.
#define AST_STRING_FIELD(name)
Declare a string field.
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:220
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.
Structure containing callbacks for Stasis message sanitization.
Definition stasis.h:200
int value
Definition syslog.c:37