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

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Wed Sep 21 11:19:01 CDT 2016


     [ https://issues.asterisk.org/jira/browse/ASTERISK-26396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Mudgett updated ASTERISK-26396:
---------------------------------------

    Description: 
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.

  was:
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.


> chan_pjsip: 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