<div dir="ltr">Yes, I used the term proxy to include statefullness and dialog awareness, which makes me think: What is the point of being transaction-aware without being dialog-aware? I am trying to find a use for it, but I cant. 
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 3, 2013 at 3:34 PM, Jiri Kuthan <span dir="ltr"><<a href="mailto:jiri@iptel.org" target="_blank">jiri@iptel.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Bill,<br>
<br>
plain-kamailio cannot send BYEs (not sure if some module can). The point is the proxy is<br>
sort of "passive element" and doesn't initiate transactions on its own.<br>
<br>
Why isn't it enough to have the BYEs sent by UAC? I mean sometimes there can be some<br>
confusing situations (say forking downstream) and it is eventually the UAC that's in<br>
the best position to know what to BYE or CANCEL.<br>
<br>
The point is this all seems a UAS business to me, for which a proxy can only do some<br>
approximiations risking it will be wrong. Like in the case 2, you may not even notice<br>
the ACK is already on its way (because you didn't record-route)... Getting control<br>
of this would really mean using the dialog module and running in B2BUA mode rather<br>
than proxy.<br>
<br>
-jiri<div class="im"><br>
<br>
On 5/3/13 11:59 AM, Vassilis Radis wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Thank you jiri,<br>
<br>
I totally agree, but I have a question that occured to me now and I cant find answer:<br>
<br>
If Kamailio receives a CANCEL from a UAC after kamailio has responded with a 200 to the corresponding INVITE, what does t_relay_cancel() do in the following 2<br>
cases:<br>
<br>
1. CANCEL received before the ACK from UAC. This is legal from the side of the UAC, since the UAC may have sent the CANCEL before it receives the 200 to the<br>
INVITE that kamailio sent.<br>
2. CANCEL received after the ACK . This is illegal, but anyway, kamailio must do something. I can't find in the RFC if it should respond  200 to the CANCEL and<br>
drop it, or 481(Call/Transaction Does Not Exist). Although 481 seems more resonable, 16.10 section of RFC says: "... If a matching response context is found,<br>
the element MUST immediately return a 200 (OK) response to the CANCEL request.". It does not discriminate if the corresponding INVITE has been 200ed or not. Any<br>
insights?<br>
<br>
In the spirit of what you wrote in your reply, could I configure it somehow, to take initiative and translate the CANCEL to a BYE downstream, no matter whether<br>
CANCEL is received before or after the ACK?<br>
<br>
Bill<br>
<br>
<br></div><div class="im">
On Fri, May 3, 2013 at 12:26 PM, Jiri Kuthan <<a href="mailto:jiri@iptel.org" target="_blank">jiri@iptel.org</a> <mailto:<a href="mailto:jiri@iptel.org" target="_blank">jiri@iptel.org</a>>> wrote:<br>
<br>
    On 5/3/13 11:04 AM, Vassilis Radis wrote:<br>
<br>
        Hello all,<br>
<br>
        In the documentation of the t_relay_cancel() (TM module) there is an example that reads:<br>
<br>
        if (method == CANCEL) {<br>
        if (!t_relay_cancel()) {  # implicit drop if relaying was successful,<br>
                                            # nothing to do<br>
<br>
        # corresponding INVITE transaction found but error occurred<br>
        sl_reply("500", "Internal Server Error");<br>
        drop;<br>
        }<br>
        # bad luck, corresponding INVITE transaction is missing,<br>
        # do the same as for INVITEs<br>
        }<br>
<br></div>
        What bothers me is the phrase#do the same as or INVITEs, because in RFC(<a href="http://tools.ietf.org/__html/rfc3261#section-16.10" target="_blank">http://tools.ietf.org/__<u></u>html/rfc3261#section-16.10</a><div>
<div class="h5"><br>
        <<a href="http://tools.ietf.org/html/rfc3261#section-16.10" target="_blank">http://tools.ietf.org/html/<u></u>rfc3261#section-16.10</a>> )  it says:<br>
<br>
        If a response context is not found, the element does not have any<br>
        knowledge of the request to apply the CANCEL to.  It MUST*statelessly*<br>
<br>
        forward the CANCEL request (it may have statelessly forwarded the<br>
        associated request previously).<br>
<br>
<br>
        So aren't we supposed to immediately statelessly forward the CANCEL if t_relay_cancel() did not find the INVITE transaction, instead of doing the same<br>
        as INVITEs, which could be t_relay() (not stateless)?. Like below:<br>
<br>
<br>
        if (method == CANCEL) {<br>
        if (!t_relay_cancel()) {  # implicit drop if relaying was successful,<br>
<br>
                                            # nothing to do<br>
<br>
        # corresponding INVITE transaction found but error occurred<br>
        sl_reply("500", "Internal Server Error");<br>
        drop;<br>
<br>
        }<br>
        # bad luck, corresponding INVITE transaction is missing,<br>
<br>
        forward();<br>
        }<br>
<br>
        Am I correct or am i missing something?<br>
<br>
<br>
<br>
    It could be even more standardized this way indeed. Aparts<br>
    from standards, measured by common sense I cannot realize<br>
    that either way would break something. The CANCEL should<br>
    not be appearing there at all. Perhaps it would make a difference<br>
    when SER is restarted and one after it went alive again,<br>
    UAC sent a CANCEL. Then what you suggest would perform better.<br>
    If you want to make sure you have captured this case, also make<br>
    sure that branch ids are configured to be produced statelessly.<br>
    Otherwise SER-proxied CANCEL won't match the previous INVITE anyhow.<br>
<br>
    other than that, SER is much better than RFC3261. Its<br>
    registrar is stateless (in departure from the RFC, otherwise<br>
    it would be more vulnerable to DoS attacks),  INVITE transaction<br>
    is hold after a 200 passes through (otherwise it would not<br>
    absorb retransmissions, create another transaction and<br>
    cause interop issues), and probably more.<br>
<br>
    I just wanted to say it is really important to look first<br>
    at what interop issues one may have or not, as SER the<br>
    way it is is likely to produce better interop than<br>
    consequent standard compliance. In most cases you<br>
    can achieve it by configuration changes, I just think<br>
    you don't want to :)<br>
<br>
    -jiri<br>
<br>
<br>
<br>
        Thank you in advance,<br>
        Bill<br>
<br>
<br>
<br></div></div>
        ______________________________<u></u>___________________<div class="im"><br>
        SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br></div>
        <a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a> <mailto:<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-<u></u>router.org</a>><br>

        <a href="http://lists.sip-router.org/__cgi-bin/mailman/listinfo/sr-__users" target="_blank">http://lists.sip-router.org/__<u></u>cgi-bin/mailman/listinfo/sr-__<u></u>users</a> <<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>users</a>><br>

<br>
<br>
</blockquote>
</blockquote></div><br></div>