If progress message is received, go into proceeding state.
Send audio, if proceeding/alerting state, so RTP stream is sent in both
directions. This is essential when using NAT.
break;
case AST_CONTROL_PROGRESS:
CDEBUG(call, ast, "Received indicate AST_CONTROL_PROGRESS from Asterisk.\n");
+ if (call->state == CHAN_LCR_STATE_IN_SETUP
+ || call->state == CHAN_LCR_STATE_IN_DIALING) {
+ CDEBUG(call, ast, "Changing to proceeding state, because no more dialing possible.\n");
+ /* send message to lcr */
+ memset(&newparam, 0, sizeof(union parameter));
+ send_message(MESSAGE_PROCEEDING, call->ref, &newparam);
+ /* change state */
+ call->state = CHAN_LCR_STATE_IN_PROCEEDING;
+ }
/* request bchannel */
CDEBUG(call, ast, "Requesting audio path.\n");
memset(&newparam, 0, sizeof(union parameter));
p_r_ref = new_remote++;
SCPY(p_r_remote_app, interface->remote_app);
p_r_tones = (interface->is_tones == IS_YES);
+ p_r_earlyb = (interface->is_earlyb == IS_YES);
/* send new ref to remote socket */
memset(¶m, 0, sizeof(union parameter));
union parameter newparam;
int l;
- /* don't send tones, if not enabled or not connected */
- if (!p_r_tones
- && p_state != PORT_STATE_CONNECT)
+ /* send tones, if connected, or if early audio is enabled in proceeding/alerting state */
+ if (p_state != PORT_STATE_CONNECT
+ && !(p_r_earlyb
+ && (p_state == PORT_STATE_OUT_PROCEEDING
+ || p_state == PORT_STATE_OUT_ALERTING))
+ && !(p_r_tones
+ && (p_state == PORT_STATE_IN_PROCEEDING
+ || p_state == PORT_STATE_IN_ALERTING)))
return 0;
if (p_tone_name[0])
int p_r_remote_id; /* remote instance (socket) */
char p_r_remote_app[32];
int p_r_tones;
+ int p_r_earlyb;
int message_epoint(unsigned int epoint_id, int message_id, union parameter *param);
void message_remote(int message_type, union parameter *param);