[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] chan_sip and early media
From:       Valter Nogueira <valter () fastway ! com ! br>
Date:       2017-05-04 13:39:57
Message-ID: CAGu7vdaFn3aA+Ke+04KK+NsJ86ksx072=-pkyKEwEhWGHaO1aA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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 <prado@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 [valter@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
>

[Attachment #5 (text/html)]

<div dir="ltr">Rafael,<div><br></div><div>I understand that I should not change \
chan_sip.c, I did it justo to confirm the problem, not in \
production.</div><div><br></div><div>When using early media and sending a hangup \
before answering should send a SIP CANCEL what is not \
happening.</div><div><br></div><div>The problem lies in channel state, that is \
already set to AST_STATE_UP even with p-&gt;invstate &lt; INV_COMPLETED. It prevents \
the SIP CANCEL.</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div \
class="gmail_extra"><br clear="all"><div><div class="gmail_signature" \
data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div \
dir="ltr"><div><div dir="ltr"><div><br><br></div><div>Atenciosamente,<br><br><img \
src="http://fastway.com.br/assinaturas/jpg/assinatura_branca_valter-min.jpg"><br></div></div></div></div></div></div></div></div></div></div>
 <br><div class="gmail_quote">2017-05-02 18:52 GMT-03:00  <span dir="ltr">&lt;<a \
href="mailto:prado@practis.com.br" \
target="_blank">prado@practis.com.br</a>&gt;</span>:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Valter,  <br>you must drop the early-media call on the dial \
application, not directly in chan_sip.c<br><br>No change should be made in that part \
of the chan_sip.c code.<br><br>Att,<br>Rafael Prado Rocchi<br><br><br><br>-------- \
ORIGINAL MESSAGE --------<br>FROM: Valter Nogueira [<a \
href="mailto:valter@fastway.com.br" target="_blank">valter@fastway.com.br</a>]; \
<br>TO: Asterisk Developers Mailing List [<a \
href="mailto:asterisk-dev@lists.digium.com" \
target="_blank">asterisk-dev@lists.digium.com</a><wbr>]; <br>SUBJECT: [asterisk-dev] \
chan_sip and early media<br>DATE: 02/05/17 - 18:47<br><br> <div dir="ltr">I am \
originating call using early media option. <div>  </div>
<div>Whe I issue a hangup (like in hangup request sip/...) before the b-leg answer, \
it don&#39;t send a SIP CANCEL and the call keeps going on.</div> <div>  </div>
<div>I figured out that it is happening due to sip_hangup() checks:</div>
<div>  </div>
<div>
<div><strong>if (p-&gt;invitestate &lt; INV_COMPLETED &amp;&amp; \
ast_channel_state(p-&gt;owner) != AST_STATE_UP) {</strong></div> \
<div><strong>needcancel = TRUE;<br></strong></div> <div><strong>ast_debug(4, \
&quot;Hanging up channel in state %s (not UP)\n&quot;, \
ast_state2str(ast_channel_<wbr>state(ast)));</strong></div> \
<div><strong>}</strong></div> <div>
<div class="m_-5432721014604786432gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>  </div>
<div>And  <strong>ast_channel_state(p-&gt;<wbr>owner) == \
AST_STATE_UP</strong><br><br></div> <div>I guess that early media option puts channel \
state in AST_STATE_UP</div> <div>  </div>
<div>So, is there a way to not set up channel state to  <strong>AST_STATE_UP</strong> \
in early media? Or the state check could be removed?</div> <div>  </div>
<div>Thank you,</div>
<div>  </div>
<div>Valter</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br><br>------------------------------<wbr>------------------------------<wbr>----------------------------<br><br>
 <br>--<br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" \
rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br> <br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
     <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" \
target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-dev</a><br></blockquote></div><br></div>




-- 
_____________________________________________________________________
-- 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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic