Rafael, I understand that I should not change chan_sip.c, I did it justo to confirm the problem, not in production.
When using early media and sending a hangup before answering should send a SIP CANCEL what is not happening. The problem lies in channel state, that is already set to AST_STATE_UP even with p->invstate < INV_COMPLETED. It prevents the SIP CANCEL. Atenciosamente, 2017-05-02 18:52 GMT-03:00 <pr...@practis.com.br>: > Valter, > you must drop the early-media call on the dial application, not directly > in chan_sip.c > > No change should be made in that part of the chan_sip.c code. > > Att, > Rafael Prado Rocchi > > > > -------- ORIGINAL MESSAGE -------- > FROM: Valter Nogueira [val...@fastway.com.br]; > TO: Asterisk Developers Mailing List [asterisk-dev@lists.digium.com]; > SUBJECT: [asterisk-dev] chan_sip and early media > DATE: 02/05/17 - 18:47 > > I am originating call using early media option. > > Whe I issue a hangup (like in hangup request sip/...) before the b-leg > answer, it don't send a SIP CANCEL and the call keeps going on. > > I figured out that it is happening due to sip_hangup() checks: > > *if (p->invitestate < INV_COMPLETED && ast_channel_state(p->owner) != > AST_STATE_UP) {* > > *needcancel = TRUE;* > *ast_debug(4, "Hanging up channel in state %s (not UP)\n", > ast_state2str(ast_channel_state(ast)));* > *}* > > And *ast_channel_state(p->owner) == AST_STATE_UP* > > I guess that early media option puts channel state in AST_STATE_UP > > So, is there a way to not set up channel state to *AST_STATE_UP* in early > media? Or the state check could be removed? > > Thank you, > > Valter > > > ------------------------------------------------------------ > ---------------------------- > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-dev mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-dev >
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev