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

Joshua Colp (JIRA) noreply at issues.asterisk.org
Wed Sep 21 06:41:01 CDT 2016


    [ https://issues.asterisk.org/jira/browse/ASTERISK-26396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=232370#comment-232370 ] 

Joshua Colp commented on ASTERISK-26396:
----------------------------------------

I think your fix sounds reasonable and correct. Feel free to post the change on gerrit!

> 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 dials into asterisk and runs dialplan. The dialplan execute Dial() to dial B, and B answer the call, but after that, NoOp(${ ${HANGUPCAUSE(${CHANNEL_B},tech)}) on A channel 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 the below code 
>              case AST_CONTROL_PVT_CAUSE_CODE:
>                     ast_indicate_data(in, AST_CONTROL_PVT_CAUSE_CODE, f->data.ptr, f->datalen);
> I think it shoud revert the call sequence of  "ast_queue_control" and "ast_queue_control_data" in function chan_pjsip_incoming_response() of channels/chan_pjsip.c.
> Is it ok? if so I can post a patch to gerrit.



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



More information about the asterisk-bugs mailing list