ITeye博客

2017 年文章归档

共 17 篇文章

Freeswitch学习笔记

因为工作中项目需求使用Freeswitch,一时招不到人,作为项目负责人,只能自己从0开始学,踩坑4个多月,从一问三不知到目前能编译源码部署,不容易,特把学习笔记分享,希望对学习Freeswitch的朋友有帮助 在此也感谢在学习过程中,帮助过我的网友,朋友,同事。 技术交流只有彼此分享才能走得更远。

2017-12-27 14:42 · freeSwitch

spring data jpa 动态更新@DynamicUpdate

import org.springframework.beans.BeanUtils; @Transactional public User update(User record){ User old=this.findById(record.getId()); record.preUpdate(); BeanUtils.copyProperties(record, old, BeanUtilsExt.getNullPropertyNames(record)); return userDAO.save(old); } public class BeanUtilsExt { public st…

2017-10-21 10:10 · java

spring boot使用外部资源文件,上传文件

静态资源路径是指系统可以直接访问的路径,且路径下的所有文件均可被用户直接读取。 在Springboot中默认的静态资源路径有: classpath:/META-INF/resources/ , classpath:/resources/ , classpath:/static/ , classpath:/public/ ,从这里可以看出这里的静态资源路径都是在 classpath 中(也就是在项目路径下指定的这几个文件夹) 试想这样一种情况:一个网站有文件上传文件的功能,如果被上传的文件放在上述的那些文件夹中会有怎样的后果? 网站数据与程序代码不能有效分离; 当项目被打包成一个 .jar 文…

2017-09-26 18:38 · java

freeswitch播放mp3

freeswitch播放mp3需求扩展模块,就是下面这货,感谢热心网友送我的mod_shout.so mod_shout https://freeswitch.org/confluence/display/FREESWITCH/mod_shout 命令 bgapi originate sofia/external/11887490xxxx@192.168.188.222 &playback(http://192.168.188.100:9090/1887490xxxx.mp3)

2017-09-22 10:49 · java · freeSwitch

pjsip源码windows编译

官方文档 This page describes how to use Microsoft Visual Studio to build pjsip libraries: Build Preparation for Windows Requirements Tools and SDKs Video support (2.0 and above only) Host requirements Building the Projects Debugging Sample Applications Next: Using pjproject libraries for your own appli…

2017-09-07 13:54

讯飞语音合成pcm转wav

java版讯飞语音合成,目前只能生成pcm格式文件,在项目中需求pcm转wav 讯飞语音合成 工具类 public class Pcm2Wave { public static void convertAudioFiles(String src, String target) throws Exception { FileInputStream fis = new FileInputStream(src); FileOutputStream fos = new FileOutputStream(target); //计算长度 byte[] buf = new byte[1024 * 4]; …

2017-09-01 16:10 · java

centos 下tomcat使用开源SSL证书启用HTTPS

centos 下tomcat使用开源SSL证书启用HTTPS 项目需求使用HTTPS安全访问方式: 现有环境 centos 7,tomcat 查阅了大量的资料,方案 开源证书 Let's Encrypt ( linux下申请 , windows下申请 ) 申请证书,可以看我另一个转载的博客 证书到手,就是配置了 tomcat配置pem证书,需要arp支持,所有在centos 7中先安装 //配置gcc依赖 yum install gcc //安装openssl wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz tar -zxv…

2017-08-22 12:30 · java

CentOS 6、7 生成Let's Encrypt 安全证书

Let's Encrypt 是很火的一个免费SSL证书发行项目,自动化发行证书,证书有90天的有效期。适合个人使用或者临时使用,不用再忍受自签发证书不受浏览器信赖的提示。去年VPS侦探曾经说过 Let's Encrypt的使用教程 ,但是Let's Encrypt已经发布了新的工具 certbot ,虽然是新的工具,但是生成证书的使用方法和参数是基本一致的,证书续期更简单了。但是目前看 certbot 在一些老版本的Linux发行版上的兼容性还是有问题的,特别是在CentOS 5上因为python版本过低是无法用的,CentOS 6上需要先 安装epel 才行,当然也有很多第三方的工具你也可…

2017-08-16 15:30 · java

java 连接freeSwitch的端口,用户,密码的配置

在 java esl连接freeswitch发送拨打电话<第二篇> 中,连接socket时,账号和密码是怎么来的,我之前一直不知道,查阅资料后,得知: C:\Program Files\FreeSWITCH\conf\autoload_configs\event_socket.conf 在配置文件中 <configuration name="event_socket.conf" description="Socket Client"> <settings> <param name="nat-map" value="false"/> <param name="listen-ip" value=…

2017-08-09 10:25 · java · freeSwitch

java esl连接freeswitch发送拨打电话<第二篇>

java esl连接freeswitch发送拨打电话<第二篇> public class CopyOfEventEslInboundTestBak { private static final Logger log = LoggerFactory.getLogger(CopyOfEventEslInboundTestBak.class); private static String host = "127.0.0.1"; private static int port = 8021; private static String password = "ClueCon"; public sta…

2017-08-07 15:25 · java · freeSwitch

java esl连接freeswitch发送拨打电话

java esl连接freeswitch发送拨打电话-安装篇 1.下载安装 a.windows环境下载安装 http://files.freeswitch.org/windows/installer/x64/ b.linux环境下安装 https://freeswitch.org/confluence/display/FREESWITCH/CentOS+7+and+RHEL+7 2.java 中使用java esl开发包连接freeswitch http://wiki.freeswitch.org/wiki/Java_ESL_Client

2017-08-07 15:13 · java · freeSwitch

Elasticsearch-安装

Elasticsearch 下载 https://www.elastic.co/downloads/elasticsearch 运行结果

2017-07-24 18:14 · java · elasticsearch

Spring MVC @JsonView使用详解

原文出处:http://blog.csdn.net/gefangshuai/article/details/50328361 Spring 提供了对 Jackson 非常好的支持,这里着重说一下 @JsonView 的用法 JSON Views 基本用法 @JsonView 可以过滤序列化对象的字段属性,可以使你 有选择的 序列化对象。下面看一个例子: 首先我们定义一个 View 类,里面包含我们对“要序列化的字段”的定义,我们暂时归为 Summary (摘要)。属于 Summary 的字段都是我们要序列化的字段。 这里也可以将 View 类理解为一组“标识”,而 Summary 就是其中的…

2017-07-19 15:35 · java

Spring Boot & Spring MVC 异常处理的N种方法

github: https://github.com/chanjarste... 参考文档: https://segmentfault.com/a/1190000010060540 Spring Boot 1.5.4.RELEASE Documentation Spring framework 4.3.9.RELEASE Documentation Exception Handling in Spring MVC 默认行为 根据Spring Boot官方文档的说法: For machine clients it will produce a JSON response with detail…

2017-07-13 11:46

新闻的基于用户行为推荐-调研

新闻的基于用户行为推荐-调研 产品的调研-参考来源 基于点击行为的用户个性化新闻推荐 现有新闻推荐产品是如何向用户进行个性化推荐? 关于推荐引擎的一些典型算法是什么?

2017-07-13 11:37

异常java.security.InvalidKeyException:illegal Key Size的解决方案

java.security.InvalidKeyException: Illegal key size at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1024) 会抛出java.security.InvalidKeyException: Illegal key size 异常. 因为密钥长度是受限制的, java运行时环境读到的是受限的policy文件. 文件位于${java_home}/jre/lib/security, 这种限制是因为美国对软件出口的控制. 处理办法: 在官方网站下载JCE无限制权限策略文件 JDK7的下载地址: h…

2017-07-09 13:20 · java

Android动态改变shape填充颜色

工作中需要依据不同的银行卡显示不同背景,由于银行很多,不可能用图片,想到了用Shape,但数量多,也不可能写死在shape的XML文件中, <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#971417" ></solid> <corners android:topLeftRadius="10dp" android:topRightR…

2017-04-10 16:19 · android