<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 10/29/2013 04:01 AM, Olle E.
Johansson wrote:<br>
</div>
<blockquote
cite="mid:1FD9E488-9BCB-4F8B-B2FF-01DEF1AC77C1@edvina.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Friends,
<div><br>
</div>
<div>I did something that may cause issues today, but solved a lot
of issues. I need your feedback on this.</div>
<div><br>
</div>
<div>I have a branch that makes it possible to add custom mappings
to the isdn cause code to SIP codes table in chan_sip - and the
opposite ones.</div>
<div><br>
</div>
<div>In order to a fine grained control I may want a cause code to
send a very specific SIP message, maybe even a custome one. And
in some cases I want to translate a specific SIP code to the
same without affecting other calls in sip2sip situations.</div>
<div><br>
</div>
<div>My solution was to add five custom codes to the cause table -
custom1 to custom5 in the range 115-119 that is not used as far
as I can tell.</div>
<div><br>
</div>
<div>This solved the problem we worked on and also added the
benefit of being able to run "hangup(118)" on a SIP call to
generate "498 IAX2 not supported" in the SIP channel.</div>
<div><br>
</div>
<div>The questions are:</div>
<div>- is this too dangerous, to grab some ISDN cause codes?</div>
</blockquote>
<br>
I think that if those values have not been allocated by now, they
aren't going to be. It's probably fine to make use of them for your
own benefit.<br>
<br>
<blockquote
cite="mid:1FD9E488-9BCB-4F8B-B2FF-01DEF1AC77C1@edvina.net"
type="cite">
<div>- will it have side effects?</div>
</blockquote>
<br>
As long as you're within the valid range for a Q.850 cause code
(which I believe is 7 bits), then there shouldn't be side effects
directly from stealing those values.<br>
<br>
<blockquote
cite="mid:1FD9E488-9BCB-4F8B-B2FF-01DEF1AC77C1@edvina.net"
type="cite">
<div>- what will other channels do if they get a hangup(119) ?</div>
</blockquote>
<br>
This is the interesting question. I did a brief search of channel
drivers and I found two different behaviors:<br>
1) The Q.850 cause code is sent as-is<br>
2) The Q.850 cause code is translated into a channel-specific value.<br>
<br>
For case 1, you could have issues with far-end equipment if they do
not understand the cause code. I, however, have no direct knowledge
of what sort of equipment might have such issues. For case 2,
usually channel drivers will have some default to use if the given
cause code is unknown.<br>
<br>
<blockquote
cite="mid:1FD9E488-9BCB-4F8B-B2FF-01DEF1AC77C1@edvina.net"
type="cite">
<div><br>
</div>
<div>All of this is of course a bit dangerous and have to be used
only by experienced asterisk admins, but is something that have
been asked for for a long time. There is nothing stopping you
from redefining any cause code to 401, 180 or something else,
like 302. But that will hurt...</div>
<div><br>
</div>
</blockquote>
<br>
In a controlled environment where you are aware of the equipment
that you are communicating with, the change you have made would
probably not cause trouble. I would recommend performing tests
against public ISDN networks and other equipment to be sure that
sending unallocated cause codes does not cause a problem for them
though. I would not recommend this code change as a general
improvement to open source Asterisk, though, but you probably
already knew that :) <br>
<br>
<blockquote
cite="mid:1FD9E488-9BCB-4F8B-B2FF-01DEF1AC77C1@edvina.net"
type="cite">
<div>Cheers,</div>
<div>/O</div>
<div><br>
</div>
<br>
</blockquote>
<br>
<br>
</body>
</html>