Transcoding

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(How to do transcoding in Yate)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Transcoding ==
 
 
Automatic transcoding is performed (if possible) when call legs are connected together. By default negotiation does not take into account possible transcodings since this is route dependent.
 
  
 +
Automatic transcoding is performed (if possible) when call legs are connected together. By default negotiation does not take into account possible transcodings since this is route dependent.<br>
 
Transcoding can work only if RTP passes through Yate. When ''rtp_forward'' is enabled transcoding won't work and you must '''not''' add formats to the list - at most you can remove.
 
Transcoding can work only if RTP passes through Yate. When ''rtp_forward'' is enabled transcoding won't work and you must '''not''' add formats to the list - at most you can remove.
  
Currently there is one easy way to compute the list of possible transcoded formats. The regexroute module offers a ''transcode'' function to build an extended list. You should not use this list always, only when you are sure RTP is proxied through Yate.
+
=== How to do transcoding in Yate ===
 +
 
 +
Currently there is one easy way to compute the list of possible transcoded formats.  
 +
 
 +
The regexroute module offers a ''transcode'' function to build an extended list. You should not use this list always, only when you are sure RTP is proxied through Yate.
  
 
You can put this line in regexroute.conf section [contexts] that handles call.preroute:
 
You can put this line in regexroute.conf section [contexts] that handles call.preroute:
  
{|width="50%"
 
|
 
 
  [contexts]
 
  [contexts]
 
  ...
 
  ...
 
  .*=;oformats=$(transcode,,${formats})
 
  .*=;oformats=$(transcode,,${formats})
|}
 
  
The empty parameter above (between the two commas) controls which formats are  returned. Please see the comments in [[Regular_Expressions|regexroute.conf.sample]] for more info.
+
The empty parameter above (between the two commas) controls which formats are  returned.  
 +
 
 +
Please see the comments in [[Regular_expressions#The regexroute configuration file|regexroute.conf]] for more info.
 +
 
 +
If inbound formats='''alaw,mulaw''' you will get something like oformats='''alaw,mulaw,slin,gsm,ilbc,speex''' (assuming the modules are compiled and loaded).
 +
 
 +
You can then use '''${oformats}''' in routing either in regexroute or in [[Register|register]] (database routing) to set the formats parameter:
  
If inbound formats='''alaw,mulaw''' you will get something like oformats='''alaw,mulaw,slin,gsm,ilbc,speex''' (assuming the modules are compiled and loaded). You can then use '''${oformats}''' in routing either in regexroute or in [[Register|register]] (database routing) to set the formats parameter:
 
{|width="50%"
 
|
 
 
  [default]
 
  [default]
 
  ...
 
  ...
 
  ; Offer transcoded formats on outbound unless rtp_forward is in use
 
  ; Offer transcoded formats on outbound unless rtp_forward is in use
 
  ${rtp_forward}^yes$^=;formats=${oformats}
 
  ${rtp_forward}^yes$^=;formats=${oformats}
|}
+
 
 +
=== Where to change the codecs ===
 +
 
 +
Here is how the list of codecs is passed around inside and outside Yate.
 +
 
 +
[[File:Format flow.png]]
 +
 
 +
The numbers indicate the places where the list can be altered:
 +
 
 +
# Inbound channel supported codecs (automatically filters inbound offer)
 +
# Routing (alters inbound and outbound codecs)
 +
# Executing outbound call (alters outbound codecs)
 +
# Outbound channel supported codecs (automatically filters outbound offer)
 +
# Outbound channel supported codecs (automatically filters response)
 +
# Inbound channel supported codecs (automatically filters response)
 +
 
 +
 
 +
'''See also'''
 +
* [[Register]]
 +
* [[Regular expressions]]

Latest revision as of 14:06, 3 April 2013

Automatic transcoding is performed (if possible) when call legs are connected together. By default negotiation does not take into account possible transcodings since this is route dependent.
Transcoding can work only if RTP passes through Yate. When rtp_forward is enabled transcoding won't work and you must not add formats to the list - at most you can remove.

[edit] How to do transcoding in Yate

Currently there is one easy way to compute the list of possible transcoded formats.

The regexroute module offers a transcode function to build an extended list. You should not use this list always, only when you are sure RTP is proxied through Yate.

You can put this line in regexroute.conf section [contexts] that handles call.preroute:

[contexts]
...
.*=;oformats=$(transcode,,${formats})

The empty parameter above (between the two commas) controls which formats are returned.

Please see the comments in regexroute.conf for more info.

If inbound formats=alaw,mulaw you will get something like oformats=alaw,mulaw,slin,gsm,ilbc,speex (assuming the modules are compiled and loaded).

You can then use ${oformats} in routing either in regexroute or in register (database routing) to set the formats parameter:

[default]
...
; Offer transcoded formats on outbound unless rtp_forward is in use
${rtp_forward}^yes$^=;formats=${oformats}

[edit] Where to change the codecs

Here is how the list of codecs is passed around inside and outside Yate.

Format flow.png

The numbers indicate the places where the list can be altered:

  1. Inbound channel supported codecs (automatically filters inbound offer)
  2. Routing (alters inbound and outbound codecs)
  3. Executing outbound call (alters outbound codecs)
  4. Outbound channel supported codecs (automatically filters outbound offer)
  5. Outbound channel supported codecs (automatically filters response)
  6. Inbound channel supported codecs (automatically filters response)


See also

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers