[asterisk-dev] app_meetme.c problem

Zac Amsler list-astbiz at netiq.biz
Sun Feb 5 09:48:44 MST 2006


I am using chan_sccp2. When I leave a meetme the channels are not torn 
down correctly. i have been working with the developer on this and can 
find no way to prevent this. Please look at the code snips and debug 
below and let me know what needs to happen to make this work.

TIA!!!


Debug:

Feb  5 10:32:08 DEBUG[21185] channel.c: Scheduling timer at 160 sample 
intervals
Feb  5 10:32:11 DEBUG[21185] channel.c: Scheduling timer at 0 sample 
intervals
Feb  5 10:32:11 DEBUG[21185] channel.c: Scheduling timer at 0 sample 
intervals
Feb  5 10:32:11 DEBUG[21185] app_meetme.c: Placed channel 
SCCP/361-00000001 in ZAP conf 1023
Feb  5 10:32:11 DEBUG[21185] channel.c: Scheduling timer at 160 sample 
intervals
Feb  5 10:32:11 DEBUG[21185] channel.c: Generator got voice, switching 
to phase locked mode
Feb  5 10:32:11 DEBUG[21185] channel.c: Scheduling timer at 0 sample 
intervals

---- Hungup the phone
Feb  5 10:32:26 DEBUG[21185] app_meetme.c: Ooh, something swapped out 
under us, starting over
Feb  5 10:32:26 DEBUG[21185] app_meetme.c: Placed channel 
SCCP/361-00000001 in ZAP conf 1023



sccp2 code:

void sccp_channel_endcall(sccp_channel_t * c) {
       sccp_device_t * d;
       struct ast_channel * ast;


       uint8_t res = 0;

       if (!c || !c->device)
               return;

       ast_mutex_lock(&c->lock);

       /* this is a station active endcall or onhook */
       d = c->device;
       sccp_log(1)(VERBOSE_PREFIX_3 "%s: Ending call %d on line %s\n", 
DEV_ID_LOG(d), c->callid, c->line->name);

       if ( (ast = c->owner) ) {
               /* there could be an asterisk dialplan hangup in progress */
               while (ast && ast_mutex_trylock(&ast->lock)) {
                       ast_log(LOG_DEBUG, "%s: Waiting to lock the 
asterisk channel %s for hangup\n", DEV_ID_LOG(d), ast->name);
                       usleep(1000);
                       /* while che sccp channel is locked c->owner 
should not change. Just in case... */
                       ast = c->owner;
               }
       }

       if (c->rtp) {
               sccp_channel_closereceivechannel(c);
               sccp_channel_stop_rtp(c);
       }

       sccp_indicate_nolock(c, SCCP_CHANNELSTATE_ONHOOK);

       if (!ast) {
               sccp_log(10)(VERBOSE_PREFIX_3 "%s: No Asterisk channel to 
hangup for sccp channel %d on line %s\n", DEV_ID_LOG(d), c->callid, 
c->line->name);
               ast_mutex_unlock(&c->lock);
               /* let's delete the sccp channel */
               ast_mutex_lock(&GLOB(channels_lock));
               sccp_channel_delete(c);
               ast_mutex_unlock(&GLOB(channels_lock));
               return;
       }

       /* what type of hangup? */
//      res = (c->calltype == SKINNY_CALLTYPE_INBOUND || ast->pbx || 
ast->blocker || CS_AST_BRIDGED_CHANNEL(ast));
       /* is there a blocker? */
       res = (ast->blocker);

       sccp_log(10)(VERBOSE_PREFIX_3 "%s: Sending %s hangup request to 
%s\n", DEV_ID_LOG(d), res ? "(queue)" : "(force)", ast->name);

       ast_mutex_unlock(&c->lock);
       ast_mutex_unlock(&ast->lock);

       if (res) {
               ast_queue_hangup(ast);
       } else {
               ast_hangup(ast);
       }
       return;
}


This function normally uses ast_queue_hangup. I tried ast_hangup, and * 
seg faults.

All other calls work. The only problem is meetme.

Any thoughts, ideas, resolutions are appreciated.

Thanks!

/Zac





More information about the asterisk-dev mailing list