首先,我对数据库mysql进行了正确的连接,所以问题如下:
我想实时配置sip.conf:
首先进入我的数据库,我将其放入模式星号和表ast_sipfriends:
id name host type callerid contexto secret username
1 80 dynamic friend 80 internal 80 80
2 81 dynamic friend 81 internal 81 81
在sip.conf中我有类似的一般上下文:
[general]
context=default
bindaddr=0.0.0.0
bindport = 5060
videosupport=yes
disallow=all
allow=gsm
allow=alaw
allow=ulaw
allow=speex
allow=h264
allow=h261
allow=h263
allow=h263p
language=es
allowsubscribe=yes
asterisk sip allowoverlap=yes
caninvite=no ; These setting confirm we want the PBX handling the audio
canreinvite=no
nat=yes
dtmfmode=rfc2833
jbenable=yes
maxcallbitrate=384
在我的extensions.conf中有以下内容:
[internal]
exten => 80,1,Dial(SIP/80,26)
exten => 80,n,Hangup()
exten => 81,1,Dial(SIP/81,26)
exten => 81,n,Hangup()
进入我的extconfig.conf:
sippeers => odbc,asterisk,ast_sipfriends
sipusers => odbc,asterisk,ast_sipfriends
问题是80和81已注册,但当我尝试拨打电话时,星号控制台显示:
-- Executing [81@internal:1] Dial("SIP/80-00000000", "SIP/81,26") in new stack
[Jun 11 11:13:57] WARNING[2887][C-00000000]: app_dial.c:2437 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [81@internal:2] Hangup("SIP/80-00000000", "") in new stack
== Spawn extension (internal, 81, 2) exited non-zero on 'SIP/80-00000000'
当执行sip show同时80和81不在那里所以这个用户已注册但无法建立一个频道,因为星号没有看到它们所以请帮助我!
答案 0 :(得分:4)
只有当你有rtpcachefriends = yes并且只有在第一次(成功或失败)注册尝试之后才会显示同伴
Asterisk不会从db加载对等体(因为某些安装可能会有数百万可用的对等体),它只在请求时加载对等体。
如果rtpcachefriends = no,则peer将在使用时加载,而不会显示在" sip show peers"