[asterisk-commits] file: branch file/issue12713 r185961 - /team/file/issue12713/channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 2 09:00:07 CDT 2009
Author: file
Date: Thu Apr 2 09:00:04 2009
New Revision: 185961
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=185961
Log:
Add some more places where we need to send back that the transfer failed.
Modified:
team/file/issue12713/channels/chan_sip.c
Modified: team/file/issue12713/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/team/file/issue12713/channels/chan_sip.c?view=diff&rev=185961&r1=185960&r2=185961
==============================================================================
--- team/file/issue12713/channels/chan_sip.c (original)
+++ team/file/issue12713/channels/chan_sip.c Thu Apr 2 09:00:04 2009
@@ -16939,6 +16939,8 @@
*/
static void handle_response_refer(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno)
{
+ enum ast_control_transfer message = AST_TRANSFER_FAILED;
+
/* If no refer structure exists, then do nothing */
if (!p->refer)
return;
@@ -16958,12 +16960,18 @@
if (ast_strlen_zero(p->authname)) {
ast_log(LOG_WARNING, "Asked to authenticate REFER to %s:%d but we have no matching peer or realm auth!\n",
ast_inet_ntoa(p->recv.sin_addr), ntohs(p->recv.sin_port));
+ if (p->owner) {
+ ast_queue_control_data(p->owner, AST_CONTROL_TRANSFER, &message, sizeof(message));
+ }
pvt_set_needdestroy(p, "unable to authenticate REFER");
}
if (p->authtries > 1 || do_proxy_auth(p, req, resp, SIP_REFER, 0)) {
ast_log(LOG_NOTICE, "Failed to authenticate on REFER to '%s'\n", get_header(&p->initreq, "From"));
p->refer->status = REFER_NOAUTH;
- pvt_set_needdestroy(p, "failed to authenticat REFER");
+ if (p->owner) {
+ ast_queue_control_data(p->owner, AST_CONTROL_TRANSFER, &message, sizeof(message));
+ }
+ pvt_set_needdestroy(p, "failed to authenticate REFER");
}
break;
case 481: /* Call leg does not exist */
@@ -16984,11 +16992,17 @@
ast_log(LOG_NOTICE, "SIP transfer to %s failed, call miserably fails. \n", p->refer->refer_to);
pvt_set_needdestroy(p, "received 500/501 response");
p->refer->status = REFER_FAILED;
+ if (p->owner) {
+ ast_queue_control_data(p->owner, AST_CONTROL_TRANSFER, &message, sizeof(message));
+ }
break;
case 603: /* Transfer declined */
ast_log(LOG_NOTICE, "SIP transfer to %s declined, call miserably fails. \n", p->refer->refer_to);
p->refer->status = REFER_FAILED;
pvt_set_needdestroy(p, "received 603 response");
+ if (p->owner) {
+ ast_queue_control_data(p->owner, AST_CONTROL_TRANSFER, &message, sizeof(message));
+ }
break;
}
}
More information about the asterisk-commits
mailing list