Codec selection for inbound route

jandir

Joined
Aug 24, 2008
Messages
65
Likes
0
Points
0
#1
How can I restrict/select the codec(s) used on an inbound route.

I have an inbound route setup from IPKall to my elastix box (Note that there is no Trunk configured for this IPKall route since this line is inbound only). I can successfully receive calls from IPKall to my Elastix box but I want to force the codec to g729. From the SIP traces (see below) I see that IPKall offers ulaw, alaw, gsm, g729, etc. but the SIP traces show that Elastix only supports ulaw and alaw for this SIP INVITE.

How do I enable/force g729 codec for the inbound route? I don't see any allow/disallow options in the webgui for the inbound routes.

I have installed g729 coded as per "Elastix without Tears" and can see g729 being used for outgoing calls to Gizmo5 trunk (sip show channels at the Asterisk CLI shows g729 being used).

Thanks.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From SIP Trace dump ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Capabilities: us - 0xc (ulaw|alaw), peer - audio=0x50e (gsm|ulaw|alaw|g729|ilbc)/video=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

mihpel

Joined
May 8, 2007
Messages
87
Likes
0
Points
0
#2
edit sip_custom.conf and add

disallow=all
allow=g729
allow=gsm
allow=ulaw
...
Note that the order in which you set the allow=codec will be the preferred order in which peers will negotiate the finally used codec.

For example if under disallow=all you have allow=g729 asterisk will initially negotiate using that codec with each peer.
If a peer does not support g729 then asterisk will ask using the next available under allow=g729 and so on.
 

mihpel

Joined
May 8, 2007
Messages
87
Likes
0
Points
0
#3
Come to thinking of it .... :) (assuming you use freepbx)

a better solution would be adding

disallow=all
allow=g729&gsm&ulaw (see the pattern? again the order is preferred order )
under PEER details and USER details in the IPKall trunk configuration
 

jandir

Joined
Aug 24, 2008
Messages
65
Likes
0
Points
0
#4
I don't have a trunk setup for this inbound route (it work fine without the trunk). Should I/ Do I need to setup a trunk for this? The IPKall line only supports incoming calls. I already have the g729 specified for the trunk I use for outgoing calls and it seems to works fine.

For the first solution where you suggest I should add the codecs to the sip_custom.conf file, will it apply to all inbound routes? trunks? Where is this file located?
 

mihpel

Joined
May 8, 2007
Messages
87
Likes
0
Points
0
#5
How does IPKall knows where to forward your traffic if you haven't setup an appropriate trunk containing username-password-IPKall's domain (ex. voip.ipkall.net) , etc?

sip_custom.conf can be found under /etc/asterisk/ but you can access-edit it through elastix web gui.
changes made at sip_custom.conf apply globally.
 

jandir

Joined
Aug 24, 2008
Messages
65
Likes
0
Points
0
#6
IPKall (ipkall.com) does not need a SIP register. IPKall gives a free DID and I just configure my Elastix box public IP (dynamic DNS) and the extension that I want the invite to come to. All of this is configured on the ipcall.com website under my account. Whenever someone calls the ipkall number it will send my elastix box a SIP INVITE to the configured extension (in my case a group extension). I have configured Elastix to accept anonymous SIP calls.

IPKall's configuration does not let me select the Codecs to be used. They make the SDP offer with all the codecs they support as you can see above.
 

mihpel

Joined
May 8, 2007
Messages
87
Likes
0
Points
0
#7
While trying to figure out what IPKall is :) i found out that in order to force a codec on it you have to setup a trunk.

do it like following:

1. click add sip trunk
2. leave everything blank except the following items

Outgoing Settings

Trunk Name: ipkall
Peer Details

context=from-pstn
host=voiper.ipkall.com
type=peer

Incoming Settings

USER Context from-trunk
USER Details:

allow=g729
context=from-trunk
disallow=all
dtmfmode=rfc2833
host=voiper.ipkall.com
insecure=very
type=peer


hope it helps!
 

jandir

Joined
Aug 24, 2008
Messages
65
Likes
0
Points
0
#8
Did not work. Same behavior as earlier.
 

mihpel

Joined
May 8, 2007
Messages
87
Likes
0
Points
0
#9
Are you sure you have g729 working on your system?

If yes try setting sip_custom.conf as described in earlier post and check what happens.
 

jandir

Joined
Aug 24, 2008
Messages
65
Likes
0
Points
0
#10
Yes, changing sip_custon.conf works. Traces below. And channel list showed that g729 was being used towards ipkall.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Capabilities: us - 0x106 (gsm|ulaw|g729), peer - audio=0x50e (gsm|ulaw|alaw|g729|ilbc)/video=0x0 (nothing), combined - 0x106 (gsm|ulaw|g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

mihpel

Joined
May 8, 2007
Messages
87
Likes
0
Points
0
#11
Thats nice to hear.

If you have no problem leaving sip_custom.conf as it is then everything is fine.

Anyway i would suggest that you try and force the codec through a trunk for better control of your system.

Regards
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,886
Members
17,563
Latest member
dineshr
Top