Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Codec Preferences on Extensions

Discussion in '3CX Phone System - General' started by nibb, Jul 13, 2011.

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

    Joined:
    Jul 13, 2011
    Messages:
    16
    Likes Received:
    0
    Hi, im sorry for posting this but I just cannot find how to change the codec preferences on a 3CX extension.

    I only found I can change priorities and codecs on VoiP providers.

    The problem is I have a device that needs to use Speex as its codec and because of this its having issues with 3cx.

    You cannot change the codec on the software side, and I thought I could change the codec on the extension for 3cx.

    I cannot make or receive calls internal to the PBX via this extensions because of this.
     
  2. willow

    willow Member

    Joined:
    Mar 1, 2011
    Messages:
    471
    Likes Received:
    0
    Under extensions/Phone Provisioning there is an option for codec proirity.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. nibb

    Joined:
    Jul 13, 2011
    Messages:
    16
    Likes Received:
    0
    No I cant.

    The only options I have there are to change "MAC Address, Model, and BLF settings.
     
  4. eagle2

    eagle2 Well-Known Member

    Joined:
    Apr 27, 2011
    Messages:
    1,085
    Likes Received:
    11
    Codecs should be changed at the extension, not in the 3cx server.
    You should be able to change them also in the provisioning templates (if used).

    Regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. KerryG

    KerryG Active Member

    Joined:
    Jun 19, 2009
    Messages:
    960
    Likes Received:
    0
    What version of 3CX are you using?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. nibb

    Joined:
    Jul 13, 2011
    Messages:
    16
    Likes Received:
    0
    v9.0.14507.814 SP.5a
     
  7. KerryG

    KerryG Active Member

    Joined:
    Jun 19, 2009
    Messages:
    960
    Likes Received:
    0
    And problem solved. That function is not in v9, it came with v10. With v9 you have to set codec priorities on each actual phone device.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. nibb

    Joined:
    Jul 13, 2011
    Messages:
    16
    Likes Received:
    0
    He? And how I was suppose to now this?

    I always checked the update section of the software and always hit update when something new was released.

    I did not knew you had to manually upgrade and did not even knew there was a new version out.

    Thank you, but as a suggestion the software should notify you of new versions, otherwise how can your installation be secure and have te latest security patches.

    Also in the manual it says nothing about upgrading from 9 to 10, it says from 8 to 10 and I got this completely you need to completely uninstall it. I thought the upgrade would just be installer over it.
     
  9. willow

    willow Member

    Joined:
    Mar 1, 2011
    Messages:
    471
    Likes Received:
    0
    it does this in v10. but i have a feeling that it will only look for updates in your current release. if you like the 3cx facebook page it will notify you of updates/patches and ongoings with 3cx.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. SY

    SY Well-Known Member
    3CX Support

    Joined:
    Jan 26, 2007
    Messages:
    1,825
    Likes Received:
    2
    Hi
    Kindly provide information about the device that you need to use.
    If your phone needs to use speex and the only speex then you need to configure its extension as "PBX delivers audio".
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. nibb

    Joined:
    Jul 13, 2011
    Messages:
    16
    Likes Received:
    0
    Thank you, its just a specific software I need to use that gave me this problem and I was suggested to change the codec for it in the PBX, so I will upgrade first and then try it. I suppose this will fix it as the app I was testing only supports that codec and had troubles in the negotiation with 3CX about the codecs.

    Thank you again, you are very kind, im just starting with 3cx so this settings are mostly new to me and im not a VoIP expert either. Regards
     
  12. nibb

    Joined:
    Jul 13, 2011
    Messages:
    16
    Likes Received:
    0
    I wanted to reply that your information was wrong.

    I upgraded to version 10 and the section of the extension is exactly the same as 9 was.

    There is no where a setting to select the codecs for a specific extension.

    Are you sure you did not confused this with the VoIP lines? You can set codecs there but not for internal extensions.
     
  13. eagle2

    eagle2 Well-Known Member

    Joined:
    Apr 27, 2011
    Messages:
    1,085
    Likes Received:
    11
    Normally codec negotiation between SIP client and SIP server is initiated by the client, who suggests preferred codecs in order.
    The server replies with codecs acceptable, the client should select the first suggested codec from server.

    So if your client is capable of only one codec, the 3CX system should agree on it, if supported, and reply to client. Otherwise the client will not register.

    --

    Registering to provider is similar process - the 3CX server suggest codecs and the provider approves. If possible avoid transcoding for better performance.

    Regards
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. nibb

    Joined:
    Jul 13, 2011
    Messages:
    16
    Likes Received:
    0
    I selected the option "PBX delivers audio" and it works now, but quality is terrible with occasional cuts.

    I know the application side needs to be able to select the codec. I reported this to the developer already and they will add it as a feature, but currently it only supports SPEEX I think and their advise was to modify the codec on the PBX side.

    I suppose the option "PBX delivers audio" is exactly for this, but this I see only as a temporary solution until I can change the codec in the client side or the PBX side.
     
  15. eagle2

    eagle2 Well-Known Member

    Joined:
    Apr 27, 2011
    Messages:
    1,085
    Likes Received:
    11
    'PBX delivers audio' is independent from codec, in fact if transcoding is necessary, the audio will pass through the PBX.

    The idea behind SIP is that SIP clients could exchange media in peer-to-peer mode, not involving the PBX. This can be extremely important for video. In case the network route for peer-to-peer audio is blocked by firewall / NAT, select 'PBX delivers audio' -- this will force media (voice) to pass through the PBX.

    Example - if your main office network is 192.168.0.0/24, remote office '1' is 192.168.1.0/24, and remote office '2' is 192.168.2.0/24, it is quite possible the direct route between networks 192.168.1.0/24 and 192.168.2.0/24 is not configured. In this case you will have one-way audio, or no audio at all. Creating necessary routes will solve your peer-to-peer issues and will not be necessary to force 'PBX delivers audio'.

    Regards
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. nibb

    Joined:
    Jul 13, 2011
    Messages:
    16
    Likes Received:
    0
    What you are saying is that this settings has nothing to do with the codecs?

    This is strange because with that setting on I hear audio, without it I dont. And the software developer told after looking at the logs that it was a codec issue.

    Now im really mixed up into who is correct with this.

    This was his initial reply:
    Looking at the log you provided, it looks like a codec negotiation issue.

    14:25:38.377 pjsua_call.c Got answer with multiple codecs, start updating media session to use only one codec..
    14:25:38.524 strm0E5FFC2C Bad RTP pt 99 (expecting 102)

    Your PBX is offering multiple codecs, so, what the client does is try to force the use of a single codec, which may not be installed on your PBX.

    Do you have access to the PBX's configuration? If so, can you try changing the codec settings? For a list of supported codecs, please visit http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__CODEC__CODECS.htm

    Now what you are telling here is that its a routing problem and that PBX delivers audio is not related to this? So how does it work then with that setting marked?
     
  17. eagle2

    eagle2 Well-Known Member

    Joined:
    Apr 27, 2011
    Messages:
    1,085
    Likes Received:
    11
    The two peers of a VoIP call must agree on the same codec. Unsuccessful negotiation leads to unregistering.

    Codec is related to bandwidth (8 kbit/s to 90 kbit/s).

    Not all codecs supported by all VoIP devices.

    If codec has to be changed this is done by the CPU (or special DSP in hardware IP PBXs), this means that media (voice) in this case will pass through the PBX.

    SIP clients in one and the same network segment may exchange media (voice) directly in peer-to-peer mode. The PBX is controlling only the call setup, connecting, termination, etc. 'PBX delivers audio' forces media to pass through the PBX (this could be only network traffic, if codec is not changing; codec changes happen normally between provider and the extension).
    Changing codec creates significant CPU load, second forcing media passing through the PBX. This affect significantly your system performance.

    Issues with one-way audio or no-audio are NAT/firewall related and not related to codec used.


    In the earlier example with main site (LAN #0) and 2 remote sites (LAN #1 and LAN #2) you may experience permanent loss of packets in peer-to-peer mode between LAN #1 and LAN #2 (due to IP routing or NAT issues), also it is possible to experience similar problems between LAN #0 and LAN #n. In this case forcing non peer-to-peer mode would normally solve the issue. Codec is not important except bandwidth requirements. Traffic from/to remote sites will be the same regardless of peer-to-peer mode or non peer-to-peer mode. Only the traffic from/to main site (LAN #0), housing the PBX, is changed.

    The problem with codec in your case is bandwidth related. Speaking of IP routing I meant bandwidth optimization. I'm not sure SPEEX is supported by 3CX (!?) So this may be a problem.

    You can easily track what's happening in your network with Wireshark, etc.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. nibb

    Joined:
    Jul 13, 2011
    Messages:
    16
    Likes Received:
    0
    Im not sure its bandwidth like you say.

    3CX is in a remote datacenter and has a dedicated 100 mbit line.

    Im on a 10 mbit line.

    The other user is on a 3 mbit line.

    I can connect to 3CX just fine, using the 3CX phone, remotely via the Internet, can send and receive audio.

    Other party using this software was not getting audio when calling to a test voice in PBX, just the main system that says Thank your calling, please press 1, etc.

    He is not using 3CX, activating the option on his extension PBX sends audio resulted in him hearing audio.

    Now this is the funny part, regardless if he uses 3CX or the other software we are testing (a CRM with voip)

    If I call him, we can talk, both have audio in and out. If he calls me neither of us can hear ourself. If he calls only the PBX he can hear audio but I did no tested if the pbx hears him.

    This is obviously a port problem with RTP but I cannot find the issue, both of us have STUN running, the server 3cx is on a public network with a fixed IP, all ports are correctly open for it, STUN is disabled in the server as its runs with a public IP.

    Since we both are connecting via the Internet I think the RTP ports are wrong somehow. 3CX has 2 settings in Network, but they are most very bad described. It says Internal leg and External leg for RTP ports so im not sure which one are im suppose to use as configuration for RTP ports in the client side. I used the 9000 to 9049 one.

    Where does the codec issue come here into play? I have no idea, I think this may never was an codec issue the software developer just informed me wrong about this. Its a RTP port problem it seems.

    I thought when I call this extension, 3CX would act as an intermediary between us, connecting us, so they dont have to peer directly.
     
  19. eagle2

    eagle2 Well-Known Member

    Joined:
    Apr 27, 2011
    Messages:
    1,085
    Likes Received:
    11
    The bandwidth may be insufficient, especially this link (3 Mbit/s) is used for other purposes. Also it is important what is the upload speed (I suppose 3 Mbit/s is the download speed), and the link is not symmetric.

    Playing with codecs you will decrease the bandwidth requirements (G.711a/u would need 90 kbit/s in each direction). Implement QoS in routers of two remote sites, if possible (strongly recommended).

    It is safer to use 'PBX delivers audio' for remote extensions, this will only increase the bandwidth requirements on the main site (the datacenter), which should not be important.

    Depending on router / NAT in some cases STUN may not function correctly on remote sites (if you have symmetric NAT for example, or router is SIP ALG compliant). This may be the case. If STUN is not resolving correctly your public address:port you will experience problems with voice (RTP media) or even with signaling (SIP/SDP). Try not using STUN or change the setting of the router. 3CX Version 10 supports also a parameter called 'ALLOWSOURCEASOUTBOUND' which is helpful is such situations.

    Problems with one-way audio are typically firewall / NAT issues - either router is blocking certain ports / addresses, NAT is not correctly configured (especially with tunnels), SIP ALG is not functioning properly, STUN is not resolving external address:port correctly.

    Check what is the address of remote extension registration in 3CX server (Phones) while playing with STUN - you should see the public address:port of the remote extension (also in 3CX logs). If using 3CX tunnel you should see 127.0.0.1:some_port. If STUN is not working the address:port will be erratic (like 0.0.0.0) or internal LAN address of the extension in the remote site (the last is OK with some types of tunnels between routers).

    Regards
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  20. nibb

    Joined:
    Jul 13, 2011
    Messages:
    16
    Likes Received:
    0
    Routers at my office have QoS enabled and I bought compatible VoiP routers, the devices there work just fine, even where there I have less than 256 kb upload speeds, I configured everything to work. The problem is im not there right now, neither is the other party.

    Im traveling and where im located the speed the upload speed is 512 kb to 800 kb. The datacenter of course if full duplex 100/100.

    The party which is giving me problems also have the same upload speeds (256 to 400 kb tops) as the office (where my voip devices just work fine).

    But this persons has deap cheap dirty routers, I asked him and its a china router brand im not even aware. I know they are cheap because I was in his place before once and we had all kinds of troubles to get something else working once, we could not even ping our self being connected to the same router at his place. So I know the problem is on his end, the router is probably the one to blame on his side (as I can just use my voip extension fine from where im located right now)

    But he does use Skype, and other services and they work. So this means something on the PBX or his extensions needs to adjusted to make it work.

    Disabled STUN on his side, he doesnt hear anything when we call the PBX. Enabling STUN he hears voice again when calling the PBX. I can call him and we both hear audio. If he calls me, we both dont.

    The logs in the PBX do complain about RTP ports and from time to time I see his his IP like 127.0.0.1 (at least on my tests) instead of the public one which is suppose stun.3cx.com to advertise.

    I will not be back for over 2 months so I cannot go and do local tests, I just use TeamViewer to try to adjust his settings in his 3cx phone. Besides that I can only adjust remotely my PBX settings and his router. Nothing else that can be done.

    I did had tons of problems in my office when I first configured 3cx, and after allot of configuration I got it working. But I assumed everything was fine from this point and for remote parties I just needed to install the voip client, adjust his setting and good to go. It seems its not the case and since we both are remote connections in this case it may be complicated.
     
Thread Status:
Not open for further replies.