[asterisk-bugs] [JIRA] (ASTERISK-26396) HANGUPCAUSE return the wrong code when dialed channel answer.

Aaron An (JIRA) noreply at issues.asterisk.org
Wed Sep 21 05:39:01 CDT 2016


Aaron An created ASTERISK-26396:
-----------------------------------

             Summary: HANGUPCAUSE return the wrong code when dialed channel answer.
                 Key: ASTERISK-26396
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26396
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Channels/chan_pjsip
    Affects Versions: 13.8.0
         Environment: CentOS6.5 X64

            Reporter: Aaron An
            Severity: Minor


A dial into asterisk and run in dialplan. The dialplan execute Dial() to dial B, and B answer the call, then ${HANGUPCAUSE(${CHANNEL_B},tech)} shows the result of "SIP 183 Session Progress". it should be "SIP 200 Ok".

look at the source code channels/chan_pjsip.c function chan_pjsip_incoming_response(). In this function first call ast_queue_control(session->channel, AST_CONTROL_ANSWER) and then call ast_queue_control_data(session->channel, AST_CONTROL_PVT_CAUSE_CODE, cause_code, data_size).

look at the source code apps/app_dial.c function wait_for_answer. In this funciton if frame (frame_type=AST_FRAME_CONTROL && subclass=AST_CONTROL_ANSWER) first comes, the line 
`while ((*to = ast_remaining_ms(start, orig)) && !peer) {`
will terminate the while and there is no chance to execute 
`    case AST_CONTROL_PVT_CAUSE_CODE:
                    ast_indicate_data(in, AST_CONTROL_PVT_CAUSE_CODE, f->data.ptr, f->datalen);`



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list