Summary:ASTERISK-25772: res_pjsip: Unexpected two BYE when answered
Reporter:Dmitriy Serov (Demon)Labels:
Date Opened:2016-02-11 12:52:45.000-0600Date Closed:2016-07-01 11:17:49
Versions:13.7.2 Frequency of
Environment:Attachments:( 0) extensions.conf
( 1) full.res_pjsip.txt
( 2) pjsip.conf
Description:Making outgoint call to other sip server (CommuniGatePro), my asterisk suddenly sends BYE after picking up.

Log of call from device on res_pjsip via endpoint on res_pjsip is attached.

Disabling all codecs except alaw (I guess video codecs) makes call successful.
Comments:By: Asterisk Team (asteriskteam) 2016-02-11 12:52:49.530-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2016-02-12 08:24:28.233-0600

Please include the configuration in use so we can ensure the environment is as close as possible for replication.

By: Dmitriy Serov (Demon) 2016-02-13 08:53:00.771-0600

simple test configurations attached:

By: Richard Mudgett (rmudgett) 2016-06-21 16:40:54.148-0500

The call is being disconnected because the CommuniGatePro is negotiating the video stream incorrectly and providing an invalid SDP.  If the CommuniGatePro wants to reject the video stream then according to RFC3264 it should be sending a 0 port value in the (m=) video media line.  If it really wants to make the video stream inactive then according to RFC4566 it needs to be sending the rtpmap attribute for the dynamic payload type 100 being offered by Asterisk.

You should be able to work around the CommuniGatePro invalid SDP issue by putting a static payload type video format first in your pjsip.conf file.  You list two video codecs that have static payload types, H263 and H261.

The PJSIP stack is rejecting the invalid SDP from the CommuniGatePro by disconnecting the call.  However, it should be sending only one BYE request and not two.