Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tbd:intl [2009/04/28 16:17] janakj created |
tbd:intl [2009/04/29 22:20] (current) janakj |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Internalization of Reason Phrases ====== | ====== Internalization of Reason Phrases ====== | ||
+ | **Contact: | ||
+ | |||
+ | If you ever looked at any SIP reply, you probably noticed that the first line | ||
+ | of the reply contains a number code followed by a reason phrase. The purpose | ||
+ | of the reason phrase is to provide a human readable text, this is a fact | ||
+ | that is little known today, when most SIP user agents are hardware devices | ||
+ | which often resemble traditional phones with limited display capabilities. | ||
+ | |||
+ | The situation can be, however, different for software user agents, running | ||
+ | on user's computer. Such user agents have access to the screen and thus they | ||
+ | can provide the user with more information than traditional HW phones, for | ||
+ | example, with the text from the reason phrase. | ||
+ | |||
+ | So, when the sip-router server sends back " | ||
+ | while it is working hard on routing the user's request towards its destination, | ||
+ | wouldn' | ||
+ | nice people operating the server? We think so. And it would be even better if | ||
+ | such nice and informative messages were translated into the user's mother tongue, | ||
+ | so that he/she could enjoy them even more. | ||
+ | |||
+ | The goal of this work topic is to develop a sip-router module which can translate | ||
+ | reason phrases in replies passing through the server on the fly. The module shall | ||
+ | load a set of plain-text configuration files with text translations at server | ||
+ | startup and translate the text based on user's language preferences and the | ||
+ | contents of those configuration files. | ||
+ | |||
+ | The initial version of the translation module should only translate reason phrases | ||
+ | in replies that the server receives from other hosts, i.e. other servers or user | ||
+ | agents. The second version of the module shall also translate reason phrases in | ||
+ | locally generate SIP replies (this is slightly more difficult). | ||
+ | |||
+ | The format of language files is not yet decided. Here is one suggestion: | ||
+ | < | ||
+ | # Format: | ||
+ | # [Language] | ||
+ | # < | ||
+ | # | ||
+ | [en_US.ascii] | ||
+ | 100::Trying | ||
+ | 180:: | ||
+ | 181::Call Is Being Forwarded | ||
+ | 182::Queued | ||
+ | 183:: | ||
+ | 200::OK | ||
+ | 202:: | ||
+ | 300:: | ||
+ | |||
+ | [cs_CZ.iso-8859-2] | ||
+ | 100:: | ||
+ | 100: | ||
+ | 180:: | ||
+ | 181::Hovor byl presmerovan | ||
+ | 182::Jste v poradi | ||
+ | 183:: | ||
+ | 200:: | ||
+ | 202::Bude vyrizeno pozdeji | ||
+ | 300::Vice moznosti | ||
+ | </ | ||
+ | |||
+ | Translations are arranged into sections according to the language. Each line | ||
+ | contains three elements delimited by ':' | ||
+ | code. This reason code must match the reason code in the reply in order for | ||
+ | the line to take effect. | ||
+ | |||
+ | The second line is an optional regular expression. If the regular expression | ||
+ | is not empty then it will be matched against the incoming reason text and the | ||
+ | line will be applied if and only if both the reason code and the regular | ||
+ | expression match. | ||
+ | |||
+ | The third element is the new reason phrase text (in the destination language). | ||