<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Roger,<br>
I think you are complicating the picture by trying to join two quite
different worlds: SIP world and the PSTN world.&nbsp; SIP was not intended
to be introduced into the PSTN world, it applied some basic
"Internet-type" principles to the problem of setting up media session
over the Internet. Even the new IMS specifications for 3G follow the
intentions of SIP (although there are some conflicts between "telco
people" and "Internet people".&nbsp; <br>
<br>
By no means are you alone, many UAs have been implemented with PSTN
replacement services in mind.&nbsp; In PSTN, call forwarding is associated
with multiple call legs, each leg being charged to the A-number
(calling party). (Of course, tromboning can can be done to optimize the
media path, but signalling-wise the call legs are still present, and
thus also in billing).&nbsp; In SIP, a REFER is not the creation of a new
call leg, it is simple a message back to caller that callee can be
reached elsewhere. Strictly speaking, to simulate PSTN, but using SIP
intentions, the SIP UA should implement B2BUA and initiate a new INVITE
to the forwarded address. The reason is that SIP puts more
responsibility on the endpoints than in PSTN (where the endpoints are
dumb). Of course, you don't want to do this.<br>
<br>
&nbsp;&nbsp;&nbsp; So, to your problem: You probably have incoming PSTN calls to your
UA, which you have decided should use 302 for "forwarding". The 302 is
a reply, not a failure, so you will receive it in your onreply route.&nbsp;
You can probably then test for 302, change the ruri and append a
branch. Depending on your billing handling, you should add a Diversion
header, CC-Diversion or store in acc module using avpairs (Jiri noted
that this is possible in a recent thread, I have never done it) the
party who redirected.<br>
<br>
Maybe these call flows can help in understanding 302. It doesn't cover
302 from clients though.<br>
<a class="moz-txt-link-freetext" href="http://www.cisco.com/univercd/cc/td/doc/product/voice/sipsols/biggulp/bgsipcf.htm">http://www.cisco.com/univercd/cc/td/doc/product/voice/sipsols/biggulp/bgsipcf.htm</a><br>
<br>
I hope this makes sense to you.<br>
<br>
BTW, I think you would received some sensibles answers earlier if you
hadn't used your "off the wall" statement...<br>
g-)<br>
<br>
Roger Lewau wrote:
<blockquote cite="mid006001c6d593$53b35bd0$81a1d80a@DILBERTIV"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
  <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {margin-top:1.8pt;
        margin-right:0cm;
        margin-bottom:1.8pt;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.htmtableborders, li.htmtableborders, div.htmtableborders
        {margin-top:1.8pt;
        margin-right:0cm;
        margin-bottom:1.8pt;
        margin-left:0cm;
        border:none;
        padding:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
span.macro
        {background:#CCCCCC;}
span.E-postmall21
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
  </style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
  <div class="Section1">
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-GB">Hello
Greger<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-GB"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-GB">I
am surprised that you
argue that 302s is not the standard call forward scenario when this is
how it
is implemented in almost all sip equipment (haven&#8217;t seen any device who
does it differently). Customer will punch in cfwd (like
*72&lt;number&gt;) in
their phone and expect the operator (me) to forward the call to the
destination
at their expense. This is nothing new or strange. 302s signal that an
UA has temporarily
been moved and can be reached somewhere else, how is that not call
forwarding? &nbsp;Also,
I would never expect an UA to send back an email address in an IP
telephony system,
even if it is theoretically possible. I would expect it to send back a
SIP address;
everything else is not reachable through the protocol of SIP and makes
absolutely
no sense.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-GB"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-GB">Most
Voip customers are
not techies and they are not rfc knowledgeable and could not care any
less about
how the forwarding is made. They would not be upset that their 302
generate a
cost, this is the expected behaviour for this service.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-GB"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-GB">Kind
regards<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-GB">Roger<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-GB"><o:p>&nbsp;</o:p></span></font></p>
  <div>
  <div class="MsoNormal" style="text-align: center;" align="center"><font
 color="black" face="Times New Roman" size="3"><span
 style="font-size: 12pt; color: windowtext;">
  <hr tabindex="-1" align="center" size="2" width="100%"></span></font></div>
  <p class="MsoNormal"><b><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext; font-weight: bold;"
 lang="EN-GB">Fr&aring;n:</span></font></b><font color="black" face="Tahoma"
 size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext;"
 lang="EN-GB"> <a class="moz-txt-link-abbreviated" href="mailto:serusers-bounces@lists.iptel.org">serusers-bounces@lists.iptel.org</a>
[<a class="moz-txt-link-freetext" href="mailto:serusers-bounces@lists.iptel.org">mailto:serusers-bounces@lists.iptel.org</a>] <b><span
 style="font-weight: bold;">F&ouml;r
  </span></b>Greger V. Teigre<br>
  <b><span style="font-weight: bold;">Skickat:</span></b> den 11
septembe</span></font><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext;">r
2006 11:59<br>
  <b><span style="font-weight: bold;">Till:</span></b> Roger Lewau<br>
  <b><span style="font-weight: bold;">Kopia:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:serusers@iptel.org">serusers@iptel.org</a>;
<a class="moz-txt-link-abbreviated" href="mailto:jh@tutpro.com">jh@tutpro.com</a><br>
  <b><span style="font-weight: bold;">&Auml;mne:</span></b> Re: [Serusers]
Handling 302
responses</span></font><font color="black"><span
 style="color: windowtext;"><o:p></o:p></span></font></p>
  </div>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;">Hi Roger,<br>
I think that was Juha's point: we don't. <br>
302 was created to enable a user agent to communicate back to the other
user
agent that it can be reached somewhere else. Thus, your server should
relay the
302 and the receiving user agent should then decide what to do. Some
UAs
immediate initiate a new call, while others (e.g.software agents) may
pop up a
question to the user: "Callee is not available, but can be reached at
location" (which of course may well be an international PSTN call that
can
be expensive).<br>
Some UAs also have options that can be set: How to handle redirects<br>
  <br>
Server-centric forwarding can be better handled by user preferences and
loading
av pairs.<br>
  <br>
That being said, I remember a thread a while ago with a discussion on
how to
turn a 302 into a forwarding. I don't remember the outcome, but it is
probably
possible, although not according to the RFCs.&nbsp; You do have some
problems
though, e.g. if the UA sends back an email uri etc.<br>
  <br>
And of course, as people tend to follow RFCs, you will probably get one
angry
customer if he realizes that his 302 generates a cost. If you have
control over
the UA and have decided to use 302 instead of the more standardized
call
forward scenario, you&nbsp; really are making problems for yourself.<br>
g-)<br>
  <br>
Roger Lewau wrote: <o:p></o:p></span></font></p>
  <div>
  <p class="MsoNormal"><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;">Hello Juha and Andrey<o:p></o:p></span></font></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;">&nbsp;<o:p></o:p></span></font></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;">302 "Moved temporarily"
is definately
about forwarding/redirecting calls.&nbsp;This is how the vast majority of
all
IP phones and ATAs handle call forwarding. It might not be the intended
use of
302 according to RFCs, even if I see nothing that says otherwise, but
this is
how it is used in end devices today. This brings us back to my original
question. How do you guys handle 302 redirection so that costs are
charged to
the callee.<o:p></o:p></span></font></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;">&nbsp;<o:p></o:p></span></font></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;">Kind regards<o:p></o:p></span></font></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;">Roger&nbsp;<o:p></o:p></span></font></p>
  </div>
  <blockquote
 style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color black; border-width: medium medium medium 1.5pt; margin: 5pt 0cm 5pt 3.75pt; padding: 0cm 0cm 0cm 4pt;">
    <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><o:p>&nbsp;</o:p></span></font></p>
    <p class="MsoNormal" style="margin-bottom: 12pt;"><font
 color="black" face="Times New Roman" size="3"><span
 style="font-size: 12pt;">-----Original
Message-----<br>
From: "Andrey Kouprianov" <a href="mailto:andrey.kouprianov@gmail.com">&lt;andrey.kouprianov@gmail.com&gt;</a><br>
To: <a href="mailto:serusers@iptel.org">serusers@iptel.org</a><br>
Date: Mon, 11 Sep 2006 12:51:09 +0700<br>
Subject: Re: [Serusers] Handling 302 responses<o:p></o:p></span></font></p>
    <div>
    <p class="MsoNormal"><font color="black" face="Courier New" size="3"><span
 style="font-size: 12pt; font-family: &quot;Courier New&quot;;">You can also use
302
responses to gather some information about the<br>
remote party. Contacts returned in the response are not necessarily<br>
the SIP URI's. I've tried using mail addresses, SIP tel: URI's and<br>
HTTP URLs too.<br>
    <br>
So, if the remote party is Busy at the moment, but has other ways to<br>
let u contact them, 302 is one of the answers to this.<br>
    <br>
On 9/11/06, Juha Heinanen <a href="mailto:jh@tutpro.com">&lt;jh@tutpro.com&gt;</a>
wrote:<br>
&gt; Roger Lewau writes:<br>
&gt;<br>
&gt; &nbsp;&gt; In my mind that statement is completely off the wall, it is
not
the<br>
&gt; &nbsp;&gt; requesting client that should be responsible for
establishing
the forwarded<br>
&gt; &nbsp;&gt; call, it never is in the rest of the telecom industry so why
should it be<br>
&gt; &nbsp;&gt; the case for SIP?<br>
&gt;<br>
&gt; 302 is not about "forwarded call". &nbsp;it just tells the
caller that the<br>
&gt; callee is at some other uri, which the caller may or may not wish
to<br>
&gt; contact. &nbsp;in many pstn networks, you can hear an announcement that
the<br>
&gt; number you tried is not in use and you should try another number<br>
&gt; instead.<br>
&gt;<br>
&gt; if callee wants to "forward" calls, he has other means for that
purpose,<br>
&gt; for example, his phone can forward the invite to some other uri or
he<br>
&gt; may configure his proxy to do so.<br>
&gt;<br>
&gt; -- juha<br>
&gt; _______________________________________________<br>
&gt; Serusers mailing list<br>
&gt; <a href="mailto:Serusers@lists.iptel.org">Serusers@lists.iptel.org</a><br>
&gt; <a href="http://lists.iptel.org/mailman/listinfo/serusers"
 target="_blank">http://lists.iptel.org/mailman/listinfo/serusers</a><br>
&gt;<br>
_______________________________________________<br>
Serusers mailing list<br>
    <a href="mailto:Serusers@lists.iptel.org">Serusers@lists.iptel.org</a><br>
    <a href="http://lists.iptel.org/mailman/listinfo/serusers"
 target="_blank">http://lists.iptel.org/mailman/listinfo/serusers</a><o:p></o:p></span></font></p>
    </div>
  </blockquote>
  <pre wrap=""><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre style="text-align: center;"><font color="black"
 face="Courier New" size="2"><span style="font-size: 10pt;">

<hr align="center" size="4" width="90%">

</span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">_______________________________________________<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">Serusers mailing list<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><a href="mailto:Serusers@lists.iptel.org">Serusers@lists.iptel.org</a><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><a
 href="http://lists.iptel.org/mailman/listinfo/serusers">http://lists.iptel.org/mailman/listinfo/serusers</a><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">&nbsp; <o:p></o:p></span></font></pre>
  </div>
</blockquote>
</body>
</html>