Esempio n. 1
0
 def generate(self, sccpdevice, output):
     print >> output, u'[devices]'
     for item in sccpdevice:
         print >> output, format_ast_section(item['name'])
         print >> output, format_ast_option('device', item['device'])
         print >> output, format_ast_option('line', item['line'])
         print >> output, format_ast_option('voicemail', item['voicemail'])
         print >> output
Esempio n. 2
0
 def generate(self, sccpline, output):
     print >> output, u'[lines]'
     for item in sccpline:
         print >> output, format_ast_section(item['name'])
         print >> output, format_ast_option('cid_name', item['cid_name'])
         print >> output, format_ast_option('cid_num', item['cid_num'])
         print >> output, format_ast_option('setvar', 'XIVO_USERID=%s' % item['user_id'])
         print >> output, format_ast_option('language', self._format_language(item['language']))
         print >> output
Esempio n. 3
0
 def _generate_agents(self, output):
     agent_options = ['autologoff', 'ackcall', 'acceptdtmf', 'enddtmf', 'wrapuptime', 'musiconhold']
     for agent in self._agents:
         for option in agent_options:
             print >> output, format_ast_option(option, agent[option])
         print >> output, self._format_agent_line(agent)
         print >> output
Esempio n. 4
0
 def _gen_general_section(self, output):
     print >> output, u'[general]'
     for item in self._voicemail:
         if item['category'] == u'general':
             opt_name = item['var_name']
             if opt_name == u'emailbody':
                 opt_val = self._format_emailbody(item['var_val'])
             else:
                 opt_val = item['var_val']
             print >> output, format_ast_option(opt_name, opt_val)
Esempio n. 5
0
 def _generate_agent_global_params(self, output):
     print >> output, u'[agents]'
     for item in self._agent_global_params:
         print >> output, format_ast_option(item['option_name'], item['option_value'])
     print >> output
Esempio n. 6
0
 def _generate_general(self, output):
     print >> output, u'[general]'
     for item in self._general:
         print >> output, format_ast_option(item['option_name'], item['option_value'])
     print >> output
Esempio n. 7
0
 def generate(self, sccpgeneral, output):
     print >> output, u'[general]'
     for item in sccpgeneral:
         print >> output, format_ast_option(item['name'], item['value'])
     print >> output
Esempio n. 8
0
 def _gen_zonemessages_section(self, output):
     print >> output, u'[zonemessages]'
     for item in self._voicemail:
         if item['category'] == u'zonemessages':
             print >> output, format_ast_option(item['var_name'], item['var_val'])