Skinny cleanup (mwi_event_cb).

Original was testing for d->session, setting and testing again (all nested).

Removed duplicate testing and restructured function to test/return and then
the main code.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
certified/11.2
Damien Wedhorn 14 years ago
parent 0271734f2e
commit d979399071

@ -3179,13 +3179,13 @@ static void mwi_event_cb(const struct ast_event *event, void *userdata)
{
struct skinny_line *l = userdata;
struct skinny_device *d = l->device;
if (d && d->session) {
struct skinnysession *s = d->session;
struct skinny_line *l2;
int new_msgs = 0;
int dev_msgs = 0;
if (s) {
if (!d || !d->session) {
return;
}
if (event) {
l->newmsgs = ast_event_get_ie_uint(event, AST_EVENT_IE_NEWMSGS);
}
@ -3208,9 +3208,7 @@ static void mwi_event_cb(const struct ast_event *event, void *userdata)
} else {
transmit_lamp_indication(d, STIMULUS_VOICEMAIL, 0, SKINNY_LAMP_OFF);
}
ast_verb(3, "Skinny mwi_event_cb found %d new messages\n", new_msgs);
}
}
ast_verb(3, "Skinny mwi_event_cb found %d new messages\n", l->newmsgs);
}
/* I do not believe skinny can deal with video.

Loading…
Cancel
Save