症状:
1.呼入正常
2.外呼部分手机号正常
3.外呼部分号码时,外线一接通,IMS会返回487,然后就挂掉了
经查是maxptime 与移动IMS不匹配造成,移动要求是240,但是asterisk的是150
参考了下面的文档
RTP Packetization - Asterisk Project - Asterisk Project Wiki
尝试了 修改sip_additional.conf
外呼结果是如下,因为这样只能改变ptime ,而 maxptime 超过150时最自动被降为140
asterisk不支持配置maxptime, 所以只能修改源码
vim ./main/codec_builtin.c
static struct ast_codec ulaw = {
.name = "ulaw",
.description = "G.711 u-law"
.type = AST_MEDIA_TYPE_AUDIO,
.sample_rate = 8000,
.minimum_ms = 10,
.maximum_ms = 240, // 原本是150
.default_ms = 20,
.minimum_bytes = 80,
.samples_count = ulaw_samples,
.get_length = ulaw_length,
.smooth = 1,
};
static struct ast_codec alaw = {
.name = "alaw",
.description = "G.711 a-law",
.type = AST_MEDIA_TYPE_AUDIO,
.sample_rate = 8000,
.minimum_ms = 10,
.maximum_ms = 240, //原本是150
.default_ms = 20,
.minimum_bytes = 80,
.samples_count = ulaw_samples,
.get_length = ulaw_length,
.smooth = 1,
};
static struct ast_codec g729a = {
.name = "g729",
.description = "G.729A",
.type = AST_MEDIA_TYPE_AUDIO,
.sample_rate = 8000,
.minimum_ms = 10,
.maximum_ms = 240, // 原本是230
.default_ms = 20,
.minimum_bytes = 10,
.samples_count = g729_samples,
.get_length = g729_length,
.smooth = 1,
};
这里我只改了ulaw、alaw和g729的编码,因为只用到了这三个,最后,重新编译一下
./configure
make menuselect
make
make install
外呼结果是 maxptime :240 ,问题解决
感谢移动公司李老师的支持