[Asterisk-Users] Codec control

Damian Minkov damian at space-comm.com
Thu Nov 25 02:05:15 MST 2004


But yhis doesn't deal with the canreinvite
i have 3 call directions

1. Local - Internet / Internet Local  - g729 , media through *
2. Local - Local - g711, media not through *
3. Internet - Internet - g729, media not through *

Your solution is working ok , except in the 3-td situation. Can this be 
done som how with peers ?

Eric Wieling wrote:

> Damian Minkov wrote:
>
>> How can i control the codec for the calls. For example I have 3 SIP 
>> phones registered to asterisk
>> The firs two are in the local area network (behind nat)- I want to 
>> use g711 between them and to connect directly (canreinvite=yes)
>> and the third is in internet - want all calls to it and from it to 
>> use g729 and media to go through asterisk.
>> So if Phone 1 calls Phone 2 the codec to be g711, but when Phone 1 
>> calls Phone 3 to use g729 ?
>
>
> Because of the problem with disallow= in sip.conf peer sections this 
> may not work the way you expect.  This is what I do.
>
> [general]
> diallow=all
> allow=ulaw
> allow=g729
>
> [phone1]
> disallow=all
> allow=ulaw
>
> [phone2]
> disallow=all
> allow=ulaw
>
> [phone3]
> disallow=all
> allow=g729
>
> Now for the trick.  Make the PHONE only support the codec you want. 
> i.e. diallow all the codecs on phone1 and phone 2 except for ulaw.  On 
> phone 3 disallow all the codecs except for g729.  Because of the 
> problems with disallow= in the [happypeer] parts of sip.conf this 
> won't work unless the codecs are specified on the phone.  Do NOT allow 
> both ulaw and alaw.  I've seen problems with this reported on #asterisk
>
> --Eric
>


-- 
    Best Regards,
    Damian Minkov
 
    COSMOS Software Enterprises, Ltd.
    Tel:    (+359-2)   983-32-62
    Mobile: (+359-88)  853-28-25
    E-Mail: damian at space-comm.com
    http://www.space-comm.com
 
    Post address:
       P. O. Box 941,
       1000 Sofia,
       Bulgaria
 
    Office address:
       ap. 9, fl. 4,
       "11 August" str., No. 43,
       1202 Sofia,
       Bulgaria





More information about the asterisk-users mailing list