FreeSWITCH中文网,电话机器人开发网 ,微信订阅号:

FreeSWITCH及VOIP,Openser,电话机器人等产品中文技术资讯、交流、沟通、培训、咨询、服务一体化网络。QQ群:293697898

如何在FSGUI中自动批量生成分机账户?


tags:freeswitch fsgui pbx batch extension 创建时间:2017-01-11 10:21:26

QQ群: 293697898 FreeSWITCH+Kamailio+OpenSIPS

可以用如下 postgresql的function来自动生成:

--DROP FUNCTION public.create_extensions();

CREATE OR REPLACE FUNCTION public.create_extensions()
  RETURNS integer AS
$BODY$

    Declare extension_number integer;
    Declare count integer;
    Begin  
        extension_number := 1026;
    count := 0; 
     while extension_number < 1500 loop
       INSERT INTO public.call_extension(
             extension_name, extension_number, callout_number, extension_type, 
            group_id, extension_pswd, extension_login_state, extension_reg_state, 
             is_allow_callout,  is_record, answer_without_state, 
            say_job_number)
        VALUES (CAST(extension_number AS TEXT), CAST(extension_number AS TEXT), ', 1, 8, 
            '1234', 'success', ', TRUE, 
            FALSE, TRUE,FALSE);
            extension_number := extension_number +1;
            count := count+1;
          end loop;
          return count;
    END;
    $BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
ALTER FUNCTION public.create_extensions()
  OWNER TO postgres;

然后执行

SELECT public.create_extensions();

如有fsgui bug可以在www.6fok.com的fsgui bug节点提交



上海老李,QQ:1354608370,FreeSWITCH QQ群: