The whole asterisk server is configured to use G729 licensed codecs.
However to call some certain destinations I need other codecs to be available.
The dialplan does not have any capabilities to facilitate codec selection based on dialed destiny, so perhaps there is a posibility to overcome this by making an SIP server entry in sip.conf so in the dial plan I can make use of the right redirections:
exten => _X.,1,Dial(SIP/${EXTEN}@my_provider)
The my_provider in this case are just SIP URI calls to one ore more domains (e.g. <>@sipsorcery.com)
For this extensions I want to make use of G722 and G723 codecs, like it would usually been done in sip.conf:
Thank for your reply.
Does this override the “general” settings in sip.conf?
Both the local extensions (sip and IAX) and the general settings of sip.conf only allow G729.
So this setting should override only the outgoing SIP call en start asterisk transcoding from external (g722) to internal (g729).
All the internal extensions are G729 only, the normal outgoing SIP calls are also G729.
due to the fact that if I select another codec asterisk allways starts transcoding.
In sip.conf, the general part I only allow g729.
So wat I wanted was to create an escape for just some external destinations.
My idea was to create a sort of “peer” for it in which I can have the desired codec settings.
In this case G711.
Asterisk, will see the internal extensions are tight to G729 and will trancode the call from and towards G711.
just a thought, not tested… try to double declare in sip.conf your trunk - with 2 different names & 2 different sets of codecs. route your call on the proper trunk based on destination selection.