Selecting codec priorities for incoming calls

Discussion in '3CX Phone System - General' started by dkintana, Jan 14, 2016.

Thread Status:
Not open for further replies.
  1. dkintana

    Joined:
    Dec 21, 2015
    Messages:
    9
    Likes Received:
    0
    I'm having troubles selecting codec priority for incoming calls. I have v12.5 and, for incoming calls, the PBX selects the first codec that the SBC offers and that is present in the active codecs list in the advanced tab of the VoIP providers; does not select based on the order of the codec in the mentioned list, but on the order offered by the SBC.
    This is a problem, because if I want to receive all calls in G.729, I have to have G.729 as the only available codec. Normally I have G.729 and G.711 selected, so I can use G.729 for voice calls and G.711 for IPFax, but for incoming calls the only codec used is G.711 because this is the first codec offered by the SBC, prior to G.729.
    The SBC offers codecs with an order based in the internal code of the codec, and the code for G.711 is 0x08 and for G.729 is 0x100, so G.711 is ever offered first. The SBC also offers codec priority, but this priority is not based in the offered order, but in another field of the data transmited to the PBX.
    The SBC that my VoIP provider uses is from CISCO, so I think this problem is affecting to more people than me.
    Is there any way to force another order for the incoming calls?

    Regards
     
  2. lneblett

    lneblett Well-Known Member

    Joined:
    Sep 7, 2010
    Messages:
    2,061
    Likes Received:
    56
    The device originating the call is the one who is requesting the codec in the INVITE (SDP). So, if the call is coming in from the SBC, the SBC is telling 3CX how to set up the call. It likely has a listing of its available codecs which are presented to 3CX in a desired order. 3CX upon seeing the INVITE will accept the first available codec to which it can match to the SBC. The reverse is true when 3CX originates the call. So, your understanding is correct.

    You did not state where the SBC is located, and if on-premise with 3CX using G711, this should not present an issue as I am guessing that the bandwidth is ample on the internal LAN. Also, keep in mind that when using g729, the number of calls is limited by half as this codes is still covered by a patent and required a royalty payment for its use based upon the number of calls supported by your edition of 3CX.

    As you have observed, the only way to force the issue is to set 3CX up with only g729.
     
  3. dkintana

    Joined:
    Dec 21, 2015
    Messages:
    9
    Likes Received:
    0
    Ineblet,

    First of all, thanks for your answer. Have a happy new year.

    What you say about the codec selection is right, but this doesn't mean that it is a correct solution. The CISCO SBC presents a codec list to 3cx in an order based NOT on priorities, but on the hexadecimal number of the codec. So, G.711 is almost always the first one in that list, because of its code: 0x8. But this doesn't mean that this codec is the preferred one by the SBC. CISCO SBC uses another field in the protocol to indicate the precedence of the codec, so, in my case, G.711 is not the first one, but the last. BUT because of 3cx only uses the order of the codec list, my PBX ALWAYS uses G.711 in the incoming calls, and this is completely annoying...
    In the codec selection of the VoIP providers it says "Codec Priorities", when it should say "Codec Priorities for Outgoing calls".

    As you say, my bandwidth is wide enough to support incoming calls in G.711, but many calls are redirected to remote locations that doesn't have enough bandwidth to ensure proper communication using this codec, so I have to use G.729. I know about licensing an so with this codec, and I have a 3cx licensed for 16 G.729 concurrent calls.

    But the worst thing I've just discovered is that every incoming call received by 3cx is ALWAYS offered to the final extension using these four codecs and in this order:
    -PCMA
    -PCMU
    -G.722
    -GSM
    So, although my incoming calls are in G.729, the communication between 3cx and the phone is made ONLY using one of those codecs, acting 3cx as a transcoder. Is there any place in 3cx where I can select wich four codecs will be used to transfer calls? Actually it is ridiculus for me that 3cx will offer GSM because none of my phones support that codec...

    Regards,
     
  4. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    10,357
    Likes Received:
    224
    This would be up to the Codec "list" in the destination set. Some sets allow the Codec order to be chosen and hopefully the PBX would abide by that, if a call were transferred to that set. Of course you are limited by the selection offered by the particular set, so, if G.729 is not one of the choices, you would want to choose another low bandwidth codec (one that was also supported by 3CX), if that was a requirement.

    It may be that none of your current phones support GSM, but, I'm sure that there are others that do, and that's why it's there. If you were creating a system from scratch, then, obviously, a set that supported the GSM Codec would go to the top of the short-list. Having to deal with existing hardware, will mean limitations and compromises.
     
  5. dkintana

    Joined:
    Dec 21, 2015
    Messages:
    9
    Likes Received:
    0
    Hi Leejor.

    First of all, please excuse me for not to answer you til today, nor to thank you for your reply.

    Ok, my sets support a large list of codecs (Yealink T2X), and I've specified four of them in the Phone Provisioning tab of the extension. I have specified 4 of them because 3CX only allows me to list four.
    But when 3CX transfers a call to ANY extension, it doesn't make sense of this list of codecs, and only offers those four codecs:
    -PCMA
    -PCMU
    -G.722
    -GSM

    When any extension calls another one, 3CX honours the list specified in the Phone Provisioning tab and offers to the final extension the codecs supported by the originator of the call, but whenever a call is received from one VOIP Provider or a VOIP/PSTN Gateway, the list of codecs offered to the destination is the one listed above.
    Why I can't change that list???? It should be a place in the configuration in wich to change the entries in this list, and, of course, the "Codec Priorities" in the VoIP Providers should work not only for outgoing calls, but for incoming ones too.

    I think this two annoying issues are really important things to consider.

    Regards,
     
  6. Frank D

    Frank D New Member

    Joined:
    Oct 6, 2014
    Messages:
    215
    Likes Received:
    6
    Hi,

    very interesting,
    I think, 3cx could think about supporting the codec priority in order to make the interoperability with Cisco and some other devices more smooth. On the other hand of course, cisco could offer the codecs in a different order, but this is outside the control of 3cx.
    I added a feature request here: use-codec-priorities-44187.html Please Vote :D

    One more thing:
    The codec priorities defined in the 3cx management interface of the extension for Yealink phones are not the priorities chosen on the phone if you are using the standard template. Have a look at the template, some other codecs are chosen in addition to those codecs. The codecs are "just" option values, all of them are used, but some other codecs too. And those "default" codes are offered early, regarding the order, which is so important in 3cx codec selection.
    You can look at the webinterface of your phone to see, which codes are active.

    I changed the provisioning template and I am not using options values at all for the phones, it is more transparent and my phones happen to need all the same codecs anyway.

    Maybe this will change the behaviour you experience.
     
  7. dkintana

    Joined:
    Dec 21, 2015
    Messages:
    9
    Likes Received:
    0
    Hi Frank,

    Thanks a lot for your comments and actions.
    I use a modified template for Yealink, so my phones use only the codecs especified in the Phone Provisioning tab of the extension. In this way I can control which codecs to use in each case, because I have extensions in my own LAN and others in remote offices and I have to take control of exactly which codecs are used in every location so I can ensure the best quality in each situation, and optimize the bandwidth.
    I have made a lot of tests and I'm totally sure that any call that I make between any extension uses only the desired codecs and in the desired order of precedence. In this way, all calls between sets located in the LAN are made using G.722 (HD codec), but if any of the parties are in a remote location, the communication are ever made ussing G.729
    This efforts become unsuccessful when I realize that the incoming calls are ever transferred using a set of codecs that I cannot select in any way, none of those codecs are of interest for my installation, and with them I cannot have HD audio, nor low bandwidth optimization despite having licenses for using G.729. Very annoying...
    3CX have to have the ability of selecting the codec offered by the SBC, for a incoming call, in a priority based order, and not in a hexadecimal ordered list of codecs.

    Regards,
     
Thread Status:
Not open for further replies.