mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 08:40:16 +00:00
use an enum for control frame types
support sending control frames with payload git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@26093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
17
channel.c
17
channel.c
@@ -738,10 +738,25 @@ int ast_queue_hangup(struct ast_channel *chan)
|
||||
}
|
||||
|
||||
/*! \brief Queue a control frame */
|
||||
int ast_queue_control(struct ast_channel *chan, int control)
|
||||
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
|
||||
{
|
||||
struct ast_frame f = { AST_FRAME_CONTROL, };
|
||||
|
||||
f.subclass = control;
|
||||
|
||||
return ast_queue_frame(chan, &f);
|
||||
}
|
||||
|
||||
/*! \brief Queue a control frame with payload */
|
||||
int ast_queue_control_data(struct ast_channel *chan, enum ast_control_frame_type control,
|
||||
const void *data, size_t datalen)
|
||||
{
|
||||
struct ast_frame f = { AST_FRAME_CONTROL, };
|
||||
|
||||
f.subclass = control;
|
||||
f.data = (void *) data;
|
||||
f.datalen = datalen;
|
||||
|
||||
return ast_queue_frame(chan, &f);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user