PJSIP Opus codec v/s G729

Hi Guys,

Need a help.

I have two server one is running with web phone where i have used Web RTC and pjsip asterisk version 13, and other server is based on asterisk 11 where I am using 3cx as a softphone with G729 codec.

I place call from PJSIP server which use code opus and route this call on other server(G729) because pri is plugged only there.

will it make any issue?


So your network diagram looks like this?

Web RTC Client (opus) <> Asterisk 13 <> Asterisk 11 <> 3cx Client (G729)

Since Asterisk 11 wont’ have Opus support you will need to transcode between opus and G729 on your Asterisk 13 server. Define your trunk between the two servers to only allow formats the Asterisk 13 server supports and it should work.

I have just added this in sip.conf on serverA(opus) calls are going through but I have doubt wther it is correct technically or it can create any issue.


the allow=all line is specficially what I recommended you change.

I would recommend


ok thanks…can you also explain why

You can use the disallow & allow parameters to control what codecs are offered and accepted when using the account you have defined.

Your Asterisk 11 box can’t transcode Opus so don’t send it calls in that format.

Ideally you would want common codecs everywhere possible.

ok got it but if i disallow opus on serverA and allow= ulaw,alaw,g729 and do the same code on serverB will it work, I mean what would be the technial journey from serverA to serverB

while call will be routing from ServerA opus would be out or ulaw?

So pretend you have two users, Bob and Sally.

You have your two servers, ServerA speaks OPUS and ULAW, ServerB speaks ULAW and G729.

Bob’s got a WebRTC client and he’s registered to your ServerA.

Bob < OPUS > ServerA

Sally’s got a hard phone and she’s registered to your ServerB.

Sally < G729 > Server B.

ServerA and ServerB speak ULAW between each other.

ServerA < ULAW > ServerB

Bob calls Sally, His call goes from his WebRTC Client to ServerA and is in OPUS format.

ServerA now needs to call ServerB, The call goes between ServerA and ServerB in ULAW format.

ServerB then sends a call to Sally, The call goes between ServerB and Sally in G729 format.

Bob’s sends audio to ServerA in OPUS format.

Bob’s audio gets transcoded from OPUS to ULAW on ServerA

Bob’s audio gets transcoded from ULAW to G729 on ServerB

Sally receives audio in G729 format from ServerB.

If Both servers support G729 you can allow that codec between ServerA and ServerB.

Then you could skip a transcoding step, ServerA would transcode OPUS to G729 directly.

thanks a lot for helping in such a great way…