limit codecs for incoming calls on sip-trunc

Discussion in 'General' started by fabianus, Nov 8, 2007.

  1. fabianus

    Joined:
    Nov 8, 2007
    Messages:
    106
    Likes Received:
    0
    Hello !

    I would like to limit, or better let's say to define priorities concerning the codecs to use for incoming calls from a sip-trunc.
    I would like to use G.723.1 - would be greate if someone could telle me where I may set this up (am newbee in asterix, freepbx, etc.). I thought to put this in the Outgoing Settings of the trunc, but if I simply add :

    allow=g723&gsm
    disallow=all

    then I am quite sure that it does not do anything. Because if I set

    allow=gsm
    disallow=all

    calls still do come in, dispite the fact that the provider of the sip-account does not accept the gsm codec (I am quite sure about this).

    So my question is:

    1) is this the right place and right way to define the codec for incoming calls on a sip-trunc? If not, how may I set this up?

    2) how may I check which codec is used for an incoming call, are there any logs to look at, and if, where do I find them in Elastix?

    Thanks very much for any help!

    Regards,
    Fabianus
     
  2. cowboy47

    Joined:
    Jun 14, 2007
    Messages:
    276
    Likes Received:
    0
    apart from defining what codecs are permitted on the trunks (Incoming & Outgoing), you can define what codecs are allowed per extension. Also you need to edit sip.conf to allow or deny codecs in the general section.

    C
     
  3. fabianus

    Joined:
    Nov 8, 2007
    Messages:
    106
    Likes Received:
    0
    Hi cowboy,

    thanks for your reply !

    Just to be sure: is my entry in the Incoming settings correct?

    allow=gsm
    disallow=all

    Because as I said my provider does not support the gsm codec an thus the incoming call should be refused, right? But it doesn't, what makes me think that there is some problem in my settings.

    In fact what does the general section in the sip.conf define? Is it applied to all sip-trunks? And if so, doe I have to edit this part or is it enought to put this into the incoming settings of the specific trunk?
    Because I am not sure where to edit the sip.conf - I get an error "File Editor" section

    Error: The module modules/file_editor/index.php could not be found

    Don't know where this comes from.

    Thanks a lot for some more help on this !

    Best regards,
    Fabianus
     
  4. cowboy47

    Joined:
    Jun 14, 2007
    Messages:
    276
    Likes Received:
    0
    OK, you need to do this:

    deny=all
    allow=gsm
    allow=g723
    allow=g729 (if you have bought licenses)
    allow=ulaw (or alaw if you are in Europe)


    Always deny first then give permission.

    Note: all of your codecs are in /usr/lib/asterisk/modules and they start with codec_XXXXXX
     
  5. fabianus

    Joined:
    Nov 8, 2007
    Messages:
    106
    Likes Received:
    0
    Got it. The problem is that once I enter these settings in the
    Incoming Settings / USER Details and hit "submit changes" the line deny=all goes below the line allow=gsm. Do you understand why?

    Regards,
    Fabianus

    PS Where do I find the file sip.conf?
     
  6. cowboy47

    Joined:
    Jun 14, 2007
    Messages:
    276
    Likes Received:
    0
    No clue on why deny=all is being put after allow. You would find sip.conf in /etc/asterisk

    Regards,
     
  7. fabianus

    Joined:
    Nov 8, 2007
    Messages:
    106
    Likes Received:
    0
    Hi cowboy,

    let me come back on this thread:
    do you have any idea how I might check the codec that was used for an incoming call on truc? Are there any detailed logs about the communications and where do I find them?

    Thanks a lot for your suggestions!

    Regards,
    Fabianus
     
  8. cowboy47

    Joined:
    Jun 14, 2007
    Messages:
    276
    Likes Received:
    0
    You would look at that from the cli. You can do a debug on a sip peer or you can look at the logs. But to be honest, I am not sure I understand what the necessity is of verifying this. You define the codec that are allowed on the incoming & outgoing sections of the trunk and then again on each extension.

    C
     
  9. CleveJ

    Joined:
    Nov 12, 2007
    Messages:
    100
    Likes Received:
    0
    To check which codec is being used when on a call at CLi type the following.

    If it is a SIP channel call type

    sip show channels

    If it is a IAX2 channel call type

    iax2 show channels

    This will then tell you what codec is being used. In your sip.conf you could try the following and see if it works.

    disallow=all
    allow=g723
    allow=g729
    allow=gsm
    allow=ulaw
    allow=alaw

    As cowboy has mentioned in his excellent replys, you have to have g723 & g729 codec loaded as by default it is not there, the other codec are also you have to make sure that your VSP supports these codec's

    Hope this helps

    Cheers
     
  10. fabianus

    Joined:
    Nov 8, 2007
    Messages:
    106
    Likes Received:
    0
    Hello cowboy,

    thanks for your reply. I wonder where I might find the logs... Just wanted to check this to be sure that all my settings were applied adequately and running.

    In fact, when I restrain the sip trunk to G723 only the communication starts, but no voice passes (I do not hear the caller and the caller does not hear me). I suppose this is because, as you said Stillearning, the codec is not loaded. Could you give me a hint on how to load the codec G723 ?

    Thank you guys,
    Fabianus<br><br>Post edited by: fabianus, at: 2007/11/15 02:00
     
  11. fabianus

    Joined:
    Nov 8, 2007
    Messages:
    106
    Likes Received:
    0
    Hi stilllearning,

    just wanted to let you know that I did not understand your post in all details and I discovered by re-reading it that "sip show channels" does exactly what I needed. So, thanks for you helpfull support !

    Regards,
    Fabianus
     
  12. ivoiped

    Joined:
    Nov 25, 2007
    Messages:
    10
    Likes Received:
    0
    You would have to have g723.1 and g729 installed in order to use them, they do not come installed by default.

    Even if they are not installed asterisk would allow to use them in passthru mode I believe but since they are not installed, you will hear nothing or the call will be rejected.
     

Share This Page