mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-15 05:08:26 +00:00
freetdm: use SIGBOOST_EVENT_CALL_PROGRESS
This commit is contained in:
parent
c74d1f1d00
commit
3baa799d7f
@ -1400,8 +1400,14 @@ static __inline__ void state_advance(ftdm_channel_t *ftdmchan)
|
|||||||
BOOST_CHAN(ftdmchan),
|
BOOST_CHAN(ftdmchan),
|
||||||
0,
|
0,
|
||||||
SIGBOOST_EVENT_CALL_START_ACK,
|
SIGBOOST_EVENT_CALL_START_ACK,
|
||||||
0, SIGBOOST_PROGRESS_MEDIA);
|
0, 0);
|
||||||
}
|
}
|
||||||
|
sangomabc_exec_command(mcon,
|
||||||
|
BOOST_SPAN(ftdmchan),
|
||||||
|
BOOST_CHAN(ftdmchan),
|
||||||
|
0,
|
||||||
|
SIGBOOST_EVENT_CALL_PROGRESS,
|
||||||
|
0, SIGBOOST_PROGRESS_MEDIA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1420,7 +1426,7 @@ static __inline__ void state_advance(ftdm_channel_t *ftdmchan)
|
|||||||
BOOST_CHAN(ftdmchan),
|
BOOST_CHAN(ftdmchan),
|
||||||
0,
|
0,
|
||||||
SIGBOOST_EVENT_CALL_START_ACK,
|
SIGBOOST_EVENT_CALL_START_ACK,
|
||||||
0, SIGBOOST_PROGRESS_RING);
|
0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,12 +223,20 @@ int sangomabc_connection_open(sangomabc_connection_t *mcon, char *local_ip, int
|
|||||||
|
|
||||||
int sangomabc_exec_command(sangomabc_connection_t *mcon, int span, int chan, int id, int cmd, int cause, int flags)
|
int sangomabc_exec_command(sangomabc_connection_t *mcon, int span, int chan, int id, int cmd, int cause, int flags)
|
||||||
{
|
{
|
||||||
sangomabc_short_event_t oevent;
|
sangomabc_event_t *oevent;
|
||||||
int retry = 5;
|
sangomabc_short_event_t sevent;
|
||||||
|
sangomabc_event_t fevent;
|
||||||
|
int retry = 5;
|
||||||
|
|
||||||
sangomabc_event_init(&oevent, cmd, chan, span);
|
if (boost_full_event(cmd)) {
|
||||||
oevent.release_cause = (uint8_t)cause;
|
sangomabc_event_init((void *)&fevent, cmd, chan, span);
|
||||||
oevent.flags = flags;
|
oevent = &fevent;
|
||||||
|
} else {
|
||||||
|
sangomabc_event_init(&sevent, cmd, chan, span);
|
||||||
|
sevent.release_cause = (uint8_t)cause;
|
||||||
|
oevent = (sangomabc_event_t *)&sevent;
|
||||||
|
}
|
||||||
|
oevent->flags = flags;
|
||||||
|
|
||||||
if (cmd == SIGBOOST_EVENT_SYSTEM_RESTART || cmd == SIGBOOST_EVENT_SYSTEM_RESTART_ACK) {
|
if (cmd == SIGBOOST_EVENT_SYSTEM_RESTART || cmd == SIGBOOST_EVENT_SYSTEM_RESTART_ACK) {
|
||||||
mcon->rxseq_reset = 1;
|
mcon->rxseq_reset = 1;
|
||||||
@ -237,21 +245,21 @@ int sangomabc_exec_command(sangomabc_connection_t *mcon, int span, int chan, int
|
|||||||
mcon->txwindow = 0;
|
mcon->txwindow = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id >= 0) {
|
if (id >= 0) {
|
||||||
oevent.call_setup_id = (uint16_t)id;
|
oevent->call_setup_id = (uint16_t)id;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (sangomabc_connection_write(mcon, (sangomabc_event_t*)&oevent) <= 0) {
|
while (sangomabc_connection_write(mcon, (sangomabc_event_t*)oevent) <= 0) {
|
||||||
if (--retry <= 0) {
|
if (--retry <= 0) {
|
||||||
ftdm_log(FTDM_LOG_CRIT, "Failed to tx on boost socket: %s\n", strerror(errno));
|
ftdm_log(FTDM_LOG_CRIT, "Failed to tx on boost socket: %s\n", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
ftdm_log(FTDM_LOG_WARNING, "Failed to tx on boost socket: %s :retry %i\n", strerror(errno), retry);
|
ftdm_log(FTDM_LOG_WARNING, "Failed to tx on boost socket: %s :retry %i\n", strerror(errno), retry);
|
||||||
ftdm_sleep(1);
|
ftdm_sleep(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -540,7 +548,11 @@ void sangomabc_call_init(sangomabc_event_t *event, const char *calling, const ch
|
|||||||
|
|
||||||
void sangomabc_event_init(sangomabc_short_event_t *event, sangomabc_event_id_t event_id, int chan, int span)
|
void sangomabc_event_init(sangomabc_short_event_t *event, sangomabc_event_id_t event_id, int chan, int span)
|
||||||
{
|
{
|
||||||
memset(event, 0, sizeof(sangomabc_short_event_t));
|
if (boost_full_event(event_id)) {
|
||||||
|
memset(event, 0, sizeof(sangomabc_event_t));
|
||||||
|
} else {
|
||||||
|
memset(event, 0, sizeof(sangomabc_short_event_t));
|
||||||
|
}
|
||||||
event->event_id = event_id;
|
event->event_id = event_id;
|
||||||
event->chan = (uint8_t)chan;
|
event->chan = (uint8_t)chan;
|
||||||
event->span = (uint8_t)span;
|
event->span = (uint8_t)span;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user