Help save net neutrality! Learn more.

#264 IAX: does not honor the audio codec plugin's frame sizes


What I have done is take the simple sample, and write a "MyEndPoint" class:

class MyEndPoint : public OpalLocalEndPoint
PCLASSINFO(MyEndPoint, OpalLocalEndPoint);
MyEndPoint(OpalManager& manager) : OpalLocalEndPoint(manager, "test") {}
~MyEndPoint() {}

virtual OpalMediaFormatList GetMediaFormats() const;
OpalMediaFormatList MyEndPoint::GetMediaFormats() const
OpalMediaFormatList list;
list += OpalMediaFormat("GSM-06.10");
return list;

In the intialization, create an instance, add routes to/from test: etc.
Then I make an IAX call to an asterisk, using this test EP as the local endpoint.

What happens is that on the IAX connection uLaw is used, while the test EP only wants to talk GSM, so OPAL creates a media patch that transcodes uLaw -> L16 and then L16 -> GSM.
The problem here is that when the GSM plugin's encode function is first called, it receives an input size of 16 and output size of 396. The encoder function returns 0 because 16 is not enough to encode one GSM frame. The consequence is that the media patch thread aborts and stop transfering data at all.

If the codec just sets *fromLen=0 and *toLen=0 and returns 1, it works. But I checked, and all of the codec plugins check their input size and return failure if it is too small.

Well, the actual problem is that I have written my own codec plugin and encountered this problem. I just added a debug print to the GSM codec to see if the problem is the same, and it is.


  • Robert Jongbloed

    • assigned_to: nobody --> dereksmithies
  • Robert Jongbloed

    • summary: OPAL does not honor the audio codec plugin's frame sizes --> IAX: does not honor the audio codec plugin's frame sizes
  • Robert Jongbloed

    • Status: open --> closed-out-of-date

Log in to post a comment.