mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 00:04:53 +00:00
In the SIP -> SIP if the called party disconnects with 486 make sure that the calling party gets 486 also
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1010,6 +1010,31 @@ static void sip_destroy(struct sip_pvt *p)
|
|||||||
|
|
||||||
static int transmit_response_reliable(struct sip_pvt *p, char *msg, struct sip_request *req);
|
static int transmit_response_reliable(struct sip_pvt *p, char *msg, struct sip_request *req);
|
||||||
|
|
||||||
|
static int hangup_sip2cause(int cause)
|
||||||
|
{
|
||||||
|
switch(cause)
|
||||||
|
{
|
||||||
|
case 486:
|
||||||
|
return AST_CAUSE_BUSY;
|
||||||
|
default:
|
||||||
|
return AST_CAUSE_NORMAL;
|
||||||
|
}
|
||||||
|
/* Never reached */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *hangup_cause2sip(int cause)
|
||||||
|
{
|
||||||
|
switch(cause)
|
||||||
|
{
|
||||||
|
case AST_CAUSE_BUSY:
|
||||||
|
return "486 Busy";
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
/* Never reached */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int sip_hangup(struct ast_channel *ast)
|
static int sip_hangup(struct ast_channel *ast)
|
||||||
{
|
{
|
||||||
@@ -1061,8 +1086,13 @@ static int sip_hangup(struct ast_channel *ast)
|
|||||||
INVITE, but do set an autodestruct just in case. */
|
INVITE, but do set an autodestruct just in case. */
|
||||||
needdestroy = 0;
|
needdestroy = 0;
|
||||||
sip_scheddestroy(p, 15000);
|
sip_scheddestroy(p, 15000);
|
||||||
} else
|
} else {
|
||||||
transmit_response_reliable(p, "403 Forbidden", &p->initreq);
|
char *res;
|
||||||
|
if (ast->hangupcause && ((res = hangup_cause2sip(ast->hangupcause)))) {
|
||||||
|
transmit_response_reliable(p, res, &p->initreq);
|
||||||
|
} else
|
||||||
|
transmit_response_reliable(p, "403 Forbidden", &p->initreq);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!p->pendinginvite) {
|
if (!p->pendinginvite) {
|
||||||
/* Send a hangup */
|
/* Send a hangup */
|
||||||
@@ -4458,19 +4488,6 @@ static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req)
|
|||||||
strncpy(p->owner->call_forward, s, sizeof(p->owner->call_forward) - 1);
|
strncpy(p->owner->call_forward, s, sizeof(p->owner->call_forward) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hangup_sip2cause(int cause)
|
|
||||||
{
|
|
||||||
switch(cause)
|
|
||||||
{
|
|
||||||
case 486:
|
|
||||||
return AST_CAUSE_BUSY;
|
|
||||||
default:
|
|
||||||
return AST_CAUSE_NORMAL;
|
|
||||||
}
|
|
||||||
/* Never reached */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_request *req)
|
static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_request *req)
|
||||||
{
|
{
|
||||||
char *to;
|
char *to;
|
||||||
|
Reference in New Issue
Block a user