<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Thu, Aug 29, 2013 at 9:07 AM, Gareth Blades <span dir="ltr"><<a href="mailto:mailinglist+asterisk@dns99.co.uk" target="_blank">mailinglist+asterisk@dns99.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>On 29/08/13 14:42, Olivier wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Thanks for your very helpful reply.<br>
<br>
1.My system prints out:<br>
CLI> core show application Hangup<br>
<br>
-= Info about application 'Hangup' =-<br>
<br>
[Synopsis]<br>
Hang up the calling channel.<br>
<br>
[Description]<br>
This application will hang up the calling channel.<br>
<br>
[Syntax]<br>
Hangup([causecode])<br>
<br>
[Arguments]<br>
causecode<br>
If a <causecode> is given the channel's hangup cause will be set<br>
to the given value.<br>
<br>
[See Also]<br>
Answer(), Busy(), Congestion()<br>
<br>
How could we improve this Arguments section so that other Asterisk admins can find available <causecode> values ?<br>
<br>
</blockquote>
<br></div>
Have a look in the source code in channels/chan_sip.c and you will see :-<br>
<br>
const char *hangup_cause2sip(int cause)<br>
{<br>
switch (cause) {<br>
case AST_CAUSE_UNALLOCATED: /* 1 */<br>
case AST_CAUSE_NO_ROUTE_<u></u>DESTINATION: /* 3 IAX2: Can't find extension in context */<br>
case AST_CAUSE_NO_ROUTE_TRANSIT_<u></u>NET: /* 2 */<br>
return "404 Not Found";<br>
case AST_CAUSE_CONGESTION: /* 34 */<br>
case AST_CAUSE_SWITCH_CONGESTION: /* 42 */<br>
return "503 Service Unavailable";<br>
case AST_CAUSE_NO_USER_RESPONSE: /* 18 */<br>
return "408 Request Timeout";<br>
case AST_CAUSE_NO_ANSWER: /* 19 */<br>
case AST_CAUSE_UNREGISTERED: /* 20 */<br>
return "480 Temporarily unavailable";<br>
case AST_CAUSE_CALL_REJECTED: /* 21 */<br>
return "403 Forbidden";<br>
case AST_CAUSE_NUMBER_CHANGED: /* 22 */<br>
return "410 Gone";<br>
case AST_CAUSE_NORMAL_UNSPECIFIED: /* 31 */<br>
return "480 Temporarily unavailable";<br>
case AST_CAUSE_INVALID_NUMBER_<u></u>FORMAT:<br>
return "484 Address incomplete";<br>
case AST_CAUSE_USER_BUSY:<br>
return "486 Busy here";<br>
case AST_CAUSE_FAILURE:<br>
return "500 Server internal failure";<br>
case AST_CAUSE_FACILITY_REJECTED: /* 29 */<br>
return "501 Not Implemented";<br>
case AST_CAUSE_CHAN_NOT_<u></u>IMPLEMENTED:<br>
return "503 Service Unavailable";<br>
/* Used in chan_iax2 */<br>
case AST_CAUSE_DESTINATION_OUT_OF_<u></u>ORDER:<br>
return "502 Bad Gateway";<br>
case AST_CAUSE_BEARERCAPABILITY_<u></u>NOTAVAIL: /* Can't find codec to connect to host */<br>
return "488 Not Acceptable Here";<br>
case AST_CAUSE_INTERWORKING: /* Unspecified Interworking issues */<br>
return "500 Network error";<br>
<br>
case AST_CAUSE_NOTDEFINED:<br>
default:<br>
ast_debug(1, "AST hangup cause %d (no match found in SIP)\n", cause);<br>
return NULL;<br>
}<br>
<br>
For any given hangup cause you can change the sip response there. For a list of the hangup numbers and the internal variable name look in include/asterisk/causes.h<br>
<br>
So if you change chan_sip.c and add the following just before the 'AST_CAUSE_NOTDEFINED' line and recompile and reinstall you should in theory be able to do a Hangup(44) to achieve what you want.<br>
<br>
case AST_CAUSE_REQUESTED_CHAN_<u></u>UNAVAIL: /* 44 */<br>
return "480 Temporarily Unavailable (Call limit)";<br>
<br>
Thats only in theory. I havent tested it myself and I am not an asterisk developer.<div><div><br></div></div></blockquote><div><br></div><div style>Also, a table of all of the hangup cause mappings is on the Asterisk wiki:</div>
<div style><br></div><div style><a href="https://wiki.asterisk.org/wiki/display/AST/Hangup+Cause+Mappings">https://wiki.asterisk.org/wiki/display/AST/Hangup+Cause+Mappings</a><br></div><div> </div></div>-- <br><div dir="ltr">
<div>
Matthew Jordan<br></div><div>Digium, Inc. | Engineering Manager</div><div>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA</div><div>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></div>
</div>
</div></div>