Hi Jordan, Thanks for all, but i found this bug in Asterisk : https://issues.asterisk.org/jira/browse/ASTERISK-16465
Attached the patch to fix the problem, if the online site does not work. Thanks for all Best Regards -----Messaggio originale----- Da: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] Per conto di Matthew Jordan Inviato: giovedì 20 settembre 2012 13:42 A: Asterisk Users Mailing List - Non-Commercial Discussion Oggetto: Re: [asterisk-users] SIP CANCEL, Reason ----- Original Message ----- > From: "Marco Colombo" <mcolo...@enter.it> > To: asterisk-users@lists.digium.com > Sent: Wednesday, September 19, 2012 10:51:43 AM > Subject: [asterisk-users] SIP CANCEL, Reason > Hi All! > i have a problem with asterisk 1.8.11. > I must have in the SIP cancel message, the line “Reason” > Example : Reason : SIP;cause=16;text=”Normal Call Clearing” > I have already enable “use_q850_reason=yes”, but this not work. > In my dialplan I have already add : exten => > _X.,n,Hangup(${HANGUPCAUSE}) > Can anyone help me? > I don’t know what to do The "use_q850_reason" settings applies globally. If you execute "sip show settings", what is the value of the "Q.850 Reason header"? If you enable 'sip set debug on', what is the actual CANCEL request sent to the UA? -- Matthew Jordan Digium, Inc. | Engineering Manager 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: http://digium.com & http://asterisk.org -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Index: chan_sip.c =================================================================== --- chan_sip.c (revision 280339) +++ chan_sip.c (working copy) @@ -12514,8 +12514,19 @@ } reqprep(&resp, p, sipmethod, seqno, newbranch); - if (sipmethod == SIP_CANCEL && p->answered_elsewhere) { - add_header(&resp, "Reason", "SIP;cause=200;text=\"Call completed elsewhere\""); + if (sipmethod == SIP_CANCEL) { + if (p->answered_elsewhere) { + if (ast_test_flag(&p->flags[1], SIP_PAGE2_Q850_REASON)) + add_header(&resp, "Reason", "Q.850;cause=200;text=\"Call completed elsewhere\""); + else + add_header(&resp, "Reason", "SIP;cause=200;text=\"Call completed elsewhere\""); + } + else if (ast_test_flag(&p->flags[1], SIP_PAGE2_Q850_REASON) && p->hangupcause) { + char buf[50]; + + sprintf(buf, "Q.850;cause=%i", p->hangupcause & 0x7f); + add_header(&resp, "Reason", buf); + } } return send_request(p, &resp, reliable, seqno ? seqno : p->ocseq);
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users