diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-25 21:06:08 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-25 21:06:08 +0000 |
commit | d55c1b0a2738867c5ae14e032a2907136f08c7c8 (patch) | |
tree | 4fe44d15650b8006b0758698032508ad25351b21 /apps/app_meetme.c | |
parent | 08fc2908d3a3edc75807a73189c78761a8bae7d7 (diff) |
Remove possibility of sending duplicate MeetmeJoin manager events, and only send a MeetmeLeave event if a MeetmeJoin event occured in the first place. (issue #6599 reported by imran - provided patch with few tiny mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30409 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_meetme.c')
-rw-r--r-- | apps/app_meetme.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c index b1385bedc..6cd7faee7 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -883,6 +883,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c int using_pseudo = 0; int duration=20; int hr, min, sec; + int sent_event = 0; time_t now; struct ast_dsp *dsp=NULL; struct ast_app *app; @@ -1135,12 +1136,15 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c } ast_log(LOG_DEBUG, "Placed channel %s in ZAP conf %d\n", chan->name, conf->zapconf); - manager_event(EVENT_FLAG_CALL, "MeetmeJoin", - "Channel: %s\r\n" - "Uniqueid: %s\r\n" - "Meetme: %s\r\n" - "Usernum: %d\r\n", - chan->name, chan->uniqueid, conf->confno, user->user_no); + if (!sent_event) { + manager_event(EVENT_FLAG_CALL, "MeetmeJoin", + "Channel: %s\r\n" + "Uniqueid: %s\r\n" + "Meetme: %s\r\n" + "Usernum: %d\r\n", + chan->name, chan->uniqueid, conf->confno, user->user_no); + sent_event = 1; + } if (!firstpass && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN)) { firstpass = 1; @@ -1693,19 +1697,21 @@ bailoutandtrynormal: min = ((now - user->jointime) % 3600) / 60; sec = (now - user->jointime) % 60; - manager_event(EVENT_FLAG_CALL, "MeetmeLeave", - "Channel: %s\r\n" - "Uniqueid: %s\r\n" - "Meetme: %s\r\n" - "Usernum: %d\r\n" - "CallerIDnum: %s\r\n" - "CallerIDname: %s\r\n" - "Duration: %ld\r\n", - chan->name, chan->uniqueid, conf->confno, - user->user_no, - S_OR(user->chan->cid.cid_num, "<unknown>"), - S_OR(user->chan->cid.cid_name, "<unknown>"), - (now - user->jointime)); + if (sent_event) { + manager_event(EVENT_FLAG_CALL, "MeetmeLeave", + "Channel: %s\r\n" + "Uniqueid: %s\r\n" + "Meetme: %s\r\n" + "Usernum: %d\r\n" + "CallerIDnum: %s\r\n" + "CallerIDname: %s\r\n" + "Duration: %ld\r\n", + chan->name, chan->uniqueid, conf->confno, + user->user_no, + S_OR(user->chan->cid.cid_num, "<unknown>"), + S_OR(user->chan->cid.cid_name, "<unknown>"), + (now - user->jointime)); + } conf->users--; conf->refcount--; |