<!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">
Yes, avp_write("$headername","$avp"); can be used to extract the
header, but remember that you cannot trust the diversion header from a
UA for billing... You probably want to keep the original callee in an
avp that can be accessed in the onreply route.<br>
g-)<br>
<br>
<br>
Roger Lewau wrote:
<blockquote cite="mid009501c6d682$b548af90$6d7e10ac@dilbertiii"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <meta content="MSHTML 6.00.2900.2963" name="GENERATOR">
  <div dir="ltr" align="left"><span class="939081214-12092006"><font
 color="#0000ff" face="Arial" size="2">Thank you for your&nbsp;answer.</font></span></div>
  <div dir="ltr" align="left"><span class="939081214-12092006"></span>&nbsp;</div>
  <div dir="ltr" align="left"><span class="939081214-12092006"><font
 color="#0000ff" face="Arial" size="2">You are probably&nbsp;right that I
would get better answer without the "off the wall" remark.&nbsp;Sorry if
upset anyone.</font></span></div>
  <div dir="ltr" align="left"><span class="939081214-12092006"></span>&nbsp;</div>
  <div dir="ltr" align="left"><span class="939081214-12092006"></span><span
 class="939081214-12092006"><font color="#0000ff" face="Arial" size="2">Ok,
now we are getting some where. The 302s I get back from the UAs
contains&nbsp;a diversion header with the callee info and the contact header
contains the destination for the "forwarding". So is it possible to
extract the info from these headers to use when appending the branch?</font></span></div>
  <div dir="ltr" align="left"><span class="939081214-12092006"></span>&nbsp;</div>
  <div dir="ltr" align="left"><span class="939081214-12092006"><font
 color="#0000ff" face="Arial" size="2">Kind regards</font></span></div>
  <div dir="ltr" align="left"><span class="939081214-12092006"><font
 color="#0000ff" face="Arial" size="2">Roger</font></span></div>
  <div dir="ltr" align="left"><span class="939081214-12092006">&nbsp;</span></div>
  <div dir="ltr" align="left">
  <hr tabindex="-1"></div>
  <div dir="ltr" align="left"><font face="Tahoma" size="2"><b>Fr&aring;n:</b>
Greger V. Teigre [<a class="moz-txt-link-freetext" href="mailto:greger@teigre.com">mailto:greger@teigre.com</a>] <br>
  <b>Skickat:</b> den 12 september 2006 08:51<br>
  <b>Till:</b> Roger Lewau<br>
  <b>Kopia:</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>&Auml;mne:</b> Re: SV: [Serusers] Handling 302 responses<br>
  </font><br>
  </div>
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>
Roger Lewau wrote:
  <blockquote cite="mid006001c6d593$53b35bd0$81a1d80a@DILBERTIV"
 type="cite">
    <meta content="Microsoft Word 11 (filtered medium)" name="Generator">
<!--[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-face {
        font-family: Tahoma;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 70.85pt 70.85pt 70.85pt 70.85pt; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; COLOR: black; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; COLOR: black; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; COLOR: black; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: blue; TEXT-DECORATION: underline
}
P {
        FONT-SIZE: 12pt; MARGIN: 1.8pt 0cm; COLOR: black; FONT-FAMILY: "Times New Roman"
}
PRE {
        FONT-SIZE: 10pt; MARGIN: 0cm 0cm 0pt; COLOR: black; FONT-FAMILY: "Courier New"
}
P.htmtableborders {
        BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; FONT-SIZE: 12pt; PADDING-BOTTOM: 0cm; MARGIN: 1.8pt 0cm; BORDER-LEFT: medium none; COLOR: black; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; FONT-FAMILY: "Times New Roman"
}
LI.htmtableborders {
        BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; FONT-SIZE: 12pt; PADDING-BOTTOM: 0cm; MARGIN: 1.8pt 0cm; BORDER-LEFT: medium none; COLOR: black; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; FONT-FAMILY: "Times New Roman"
}
DIV.htmtableborders {
        BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; FONT-SIZE: 12pt; PADDING-BOTTOM: 0cm; MARGIN: 1.8pt 0cm; BORDER-LEFT: medium none; COLOR: black; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; FONT-FAMILY: "Times New Roman"
}
SPAN.macro {
        BACKGROUND: #cccccc
}
SPAN.E-postmall21 {
        COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
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; color: navy; font-family: Arial;" 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; color: navy; font-family: Arial;" lang="EN-GB"><O:P></O:P></span></font></p>
    <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; color: navy; font-family: Arial;" 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; color: navy; font-family: Arial;" lang="EN-GB"><O:P></O:P></span></font></p>
    <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; color: navy; font-family: Arial;" 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; color: navy; font-family: Arial;" lang="EN-GB"><O:P></O:P></span></font></p>
    <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; color: navy; font-family: Arial;" 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; color: navy; font-family: Arial;" 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; color: navy; font-family: Arial;" lang="EN-GB"><O:P></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-weight: bold; font-size: 10pt; color: windowtext; font-family: Tahoma;"
 lang="EN-GB">Fr&aring;n:</span></font></b><font color="black" face="Tahoma"
 size="2"><span
 style="font-size: 10pt; color: windowtext; font-family: Tahoma;"
 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; color: windowtext; font-family: Tahoma;">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></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;"><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;"><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; 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></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: 'Courier New';">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>
</blockquote>
</body>
</html>