aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwedhorn <wedhorn@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-04 08:25:47 +0000
committerwedhorn <wedhorn@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-04 08:25:47 +0000
commitdea9501e866f0fbc8e3268dacb25c7f423024147 (patch)
tree0466a483044d9d0e2562f54a0a38d3c4b6f6a7a8
parent1f202ad5d33fffeaa16b7e50e799b09cbd98370e (diff)
Add setsubstate_ringin.
Added setsubstate_ringin. skinny_call now calls sss_ringin rather than inline. Fixed previous issue so that setsubstate_connected now use SUBSTATE_RINGIN to determine is an AST_CONTROL_ANSWER should be queued. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@316584 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_skinny.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index c225b2a93..e4ae04235 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -1408,6 +1408,7 @@ static void mwi_event_cb(const struct ast_event *event, void *userdata);
static int skinny_reload(void);
static void setsubstate_ringout(struct skinny_subchannel *sub, char exten[AST_MAX_EXTENSION]);
+static void setsubstate_ringin(struct skinny_subchannel *sub);
static void setsubstate_connected(struct skinny_subchannel *sub);
static struct ast_channel_tech skinny_tech = {
@@ -4064,26 +4065,7 @@ static int skinny_call(struct ast_channel *ast, char *dest, int timeout)
return -1;
}
- switch (l->hookstate) {
- case SKINNY_OFFHOOK:
- break;
- case SKINNY_ONHOOK:
- l->activesub = sub;
- break;
- default:
- ast_log(LOG_ERROR, "Don't know how to deal with hookstate %d\n", l->hookstate);
- break;
- }
-
- transmit_callstate(d, sub->parent->instance, sub->callid, SKINNY_RINGIN);
- transmit_selectsoftkeys(d, l->instance, sub->callid, KEYDEF_RINGIN);
- transmit_displaypromptstatus(d, "Ring-In", 0, l->instance, sub->callid);
- transmit_callinfo(sub);
- transmit_lamp_indication(d, STIMULUS_LINE, l->instance, SKINNY_LAMP_BLINK);
- transmit_ringer_mode(d, SKINNY_RING_INSIDE);
-
- ast_setstate(ast, AST_STATE_RINGING);
- ast_queue_control(ast, AST_CONTROL_RINGING);
+ setsubstate_ringin(sub);
return res;
}
@@ -4771,6 +4753,28 @@ static void setsubstate_ringout(struct skinny_subchannel *sub, char exten[AST_MA
}
}
+static void setsubstate_ringin(struct skinny_subchannel *sub)
+{
+ struct skinny_line *l = sub->parent;
+ struct skinny_device *d = l->device;
+ struct ast_channel *c = sub->owner;
+
+ transmit_callstate(d, sub->parent->instance, sub->callid, SKINNY_RINGIN);
+ transmit_selectsoftkeys(d, l->instance, sub->callid, KEYDEF_RINGIN);
+ transmit_displaypromptstatus(d, "Ring-In", 0, l->instance, sub->callid);
+ transmit_callinfo(sub);
+ transmit_lamp_indication(d, STIMULUS_LINE, l->instance, SKINNY_LAMP_BLINK);
+ transmit_ringer_mode(d, SKINNY_RING_INSIDE);
+
+ if (l->hookstate == SKINNY_ONHOOK) {
+ l->activesub = sub;
+ }
+
+ ast_setstate(c, AST_STATE_RINGING);
+ ast_queue_control(c, AST_CONTROL_RINGING);
+ sub->substate = SUBSTATE_RINGIN;
+}
+
static void setsubstate_connected(struct skinny_subchannel *sub)
{
struct skinny_line *l = sub->parent;
@@ -4785,7 +4789,7 @@ static void setsubstate_connected(struct skinny_subchannel *sub)
if (!sub->rtp) {
start_rtp(sub);
}
- if (sub->substate != SUBSTATE_RINGOUT) { /* Bad form, neet to test for RINGIN, when it's implemented */
+ if (sub->substate != SUBSTATE_RINGIN) {
ast_queue_control(sub->owner, AST_CONTROL_ANSWER);
}
if (sub->substate == SUBSTATE_RINGOUT) {