mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-08 16:53:21 +00:00
add preAnswer and ringReady too
This commit is contained in:
parent
41c1c1cb75
commit
2ea31f5d95
@ -237,6 +237,13 @@ ATTRS:
|
|||||||
is-conference : true|false (set the conference flag for RFC4579 stuff.
|
is-conference : true|false (set the conference flag for RFC4579 stuff.
|
||||||
|
|
||||||
|
|
||||||
|
<preAnswer>
|
||||||
|
: Establish media on the call without answering.
|
||||||
|
|
||||||
|
<ringReady>
|
||||||
|
: Indicate ringing to an unaswered channel.
|
||||||
|
|
||||||
|
|
||||||
<hangup cause action>
|
<hangup cause action>
|
||||||
: Hangup the call
|
: Hangup the call
|
||||||
|
|
||||||
|
@ -879,14 +879,21 @@ static switch_status_t parse_hangup(const char *tag_name, client_t *client, swit
|
|||||||
|
|
||||||
static switch_status_t parse_answer(const char *tag_name, client_t *client, switch_xml_t tag, const char *body)
|
static switch_status_t parse_answer(const char *tag_name, client_t *client, switch_xml_t tag, const char *body)
|
||||||
{
|
{
|
||||||
const char *conf = switch_xml_attr(tag, "is-conference");
|
|
||||||
|
|
||||||
if (conf && switch_true(conf)) {
|
if (!strcasecmp(tag_name, "answer")) {
|
||||||
switch_channel_set_flag(client->channel, CF_CONFERENCE);
|
const char *conf = switch_xml_attr(tag, "is-conference");
|
||||||
|
|
||||||
|
if (conf && switch_true(conf)) {
|
||||||
|
switch_channel_set_flag(client->channel, CF_CONFERENCE);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_channel_answer(client->channel);
|
||||||
|
} else if (!strcasecmp(tag_name, "preAnswer")) {
|
||||||
|
switch_channel_pre_answer(client->channel);
|
||||||
|
} else if (!strcasecmp(tag_name, "ringReady")) {
|
||||||
|
switch_channel_ring_ready(client->channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_channel_answer(client->channel);
|
|
||||||
|
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3011,6 +3018,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_httapi_load)
|
|||||||
bind_parser("dial", parse_dial);
|
bind_parser("dial", parse_dial);
|
||||||
bind_parser("pause", parse_playback);
|
bind_parser("pause", parse_playback);
|
||||||
bind_parser("answer", parse_answer);
|
bind_parser("answer", parse_answer);
|
||||||
|
bind_parser("preAnswer", parse_answer);
|
||||||
|
bind_parser("ringReady", parse_answer);
|
||||||
bind_parser("hangup", parse_hangup);
|
bind_parser("hangup", parse_hangup);
|
||||||
bind_parser("record", parse_record);
|
bind_parser("record", parse_record);
|
||||||
bind_parser("recordCall", parse_record_call);
|
bind_parser("recordCall", parse_record_call);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user