mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 03:48:02 +00:00
make sending indications more robust and proper
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -617,6 +617,8 @@ struct skinny_subchannel {
|
|||||||
struct skinny_line *parent;
|
struct skinny_line *parent;
|
||||||
struct ast_rtp *rtp;
|
struct ast_rtp *rtp;
|
||||||
time_t lastouttime;
|
time_t lastouttime;
|
||||||
|
int progress;
|
||||||
|
int ringing;
|
||||||
int lastout;
|
int lastout;
|
||||||
int cxmode;
|
int cxmode;
|
||||||
int nat;
|
int nat;
|
||||||
@@ -1697,17 +1699,40 @@ static int skinny_indicate(struct ast_channel *ast, int ind)
|
|||||||
}
|
}
|
||||||
switch(ind) {
|
switch(ind) {
|
||||||
case AST_CONTROL_RINGING:
|
case AST_CONTROL_RINGING:
|
||||||
transmit_tone(s, SKINNY_ALERT);
|
if (ast->_state == AST_STATE_RINGING) {
|
||||||
transmit_callstate(s, l->instance, SKINNY_PROGRESS, sub->callid);
|
if (!sub->progress) {
|
||||||
break;
|
transmit_tone(s, SKINNY_ALERT);
|
||||||
|
transmit_callstate(s, l->instance, SKINNY_RINGOUT, sub->callid);
|
||||||
|
sub->ringing = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
case AST_CONTROL_BUSY:
|
case AST_CONTROL_BUSY:
|
||||||
transmit_tone(s, SKINNY_BUSYTONE);
|
if (ast->_state != AST_STATE_UP) {
|
||||||
transmit_callstate(s, l->instance, SKINNY_BUSY, sub->callid);
|
transmit_tone(s, SKINNY_BUSYTONE);
|
||||||
break;
|
transmit_callstate(s, l->instance, SKINNY_BUSY, sub->callid);
|
||||||
|
sub->alreadygone = 1;
|
||||||
|
ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
case AST_CONTROL_CONGESTION:
|
case AST_CONTROL_CONGESTION:
|
||||||
transmit_tone(s, SKINNY_REORDER);
|
if (ast->_state != AST_STATE_UP) {
|
||||||
transmit_callstate(s, l->instance, SKINNY_CONGESTION, sub->callid);
|
transmit_tone(s, SKINNY_REORDER);
|
||||||
break;
|
transmit_callstate(s, l->instance, SKINNY_CONGESTION, sub->callid);
|
||||||
|
sub->alreadygone = 1;
|
||||||
|
ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
case AST_CONTROL_PROGRESS:
|
||||||
|
if ((ast->_state != AST_STATE_UP) && !sub->progress && !sub->outgoing) {
|
||||||
|
transmit_callstate(s, l->instance, SKINNY_PROGRESS, sub->callid);
|
||||||
|
sub->progress = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
case -1:
|
case -1:
|
||||||
transmit_tone(s, SKINNY_SILENCE);
|
transmit_tone(s, SKINNY_SILENCE);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user