使用Asterisk 16和本地SIP中继提供商,我们可以拨出电话,但是拨入电话无效。
如果我通过手机拨打电话,则会在服务器上看到呼叫邀请,并且看到正在应答的呼叫。但是,在我的手机上,该呼叫仍未接听,然后被拒绝。
在其他服务器(本地托管而不是在数据中心托管)上工作时,这些确切的设置有效。
EXTENSIONS.CONF
[IncomingContext]
exten=>[NumberRemoved],1,NoOp(Incoming)
same=>n,Answer()
same=>n,Playback(tt-monkeys)
same=>n,HangUp()
PJSIP.CONF
[transport-udp-main]
type=transport
protocol=udp
bind=0.0.0.0:5060
;DEVICES
;TEMPLATES
[gEndpoint](!)
type=endpoint
transport=transport-udp-main
context=from-internal
disallow=all
allow=alaw
;allow=opus
;allow=alaw
[gAors](!)
type=aor
max_contacts=2
[gAuth](!)
type=auth
auth_type=userpass
[LOCAL1040](gEndpoint)
aors=LOCAL1040
auth=LOCAL1040
[LOCAL1040](gAors)
[LOCAL1040](gAuth)
username=LOCAL1040
password=#1040*
;--------TRUNK PROVIDER
[siptrunk]
type=auth
auth_type=userpass
username=USERNAME
password=PASSWORD
[siptrunk]
type=aor
contact=sip:sip.PROVIDER.co.za:5060
[siptrunk]
type=registration
outbound_auth=siptrunk
server_uri=sip:USERNAME@sip.PROVIDER.co.za:5060
client_uri=sip:USERNAME@sip.PROVIDER.co.za
contact_user=9999
[siptrunk]
type=identify
endpoint=siptrunk
match=sip.PROVIDER.co.za
[siptrunk]
type=endpoint
transport=transport-udp-main
context=IncomingContext
direct_media=yes
disallow=all
allow=ulaw,iLBC,opus,GSM
outbound_auth=siptrunk
aors=siptrunk
日志:
[Oct 7 14:02:41] Asterisk 16.5.1 built by root @ asterisk on a x86_64 running Linux on 2019-09-20 09:48:51 UTC
[Oct 7 14:02:41] NOTICE[1498] loader.c: 304 modules will be loaded.
[Oct 7 14:02:47] NOTICE[1498] cdr.c: CDR logging disabled.
[Oct 7 14:02:49] NOTICE[1498] res_smdi.c: No SMDI interfaces are available to listen on, not starting SMDI listener.
[Oct 7 14:02:49] WARNING[1498] res_phoneprov.c: Unable to find a valid server address or name.
[Oct 7 14:02:49] NOTICE[1498] chan_skinny.c: Configuring skinny from skinny.conf
[Oct 7 14:02:49] ERROR[1498] ari/config.c: No configured users for ARI
[Oct 7 14:02:49] NOTICE[1498] confbridge/conf_config_parser.c: Adding default_menu menu to app_confbridge
[Oct 7 14:02:49] WARNING[1498] config.c: parse error: No category context for line 33 of /etc/asterisk/cdr_adaptive_odbc.conf
[Oct 7 14:02:49] WARNING[1498] cdr_adaptive_odbc.c: Unable to load cdr_adaptive_odbc.conf. No adaptive ODBC CDRs.
[Oct 7 14:02:49] NOTICE[1498] cel_custom.c: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs.
[Oct 7 14:02:50] WARNING[1498] res_hep_pjsip.c: res_hep is disabled; declining module load
[Oct 7 14:02:50] WARNING[1498] loader.c: Some non-required modules failed to load.
[Oct 7 14:02:50] ERROR[1498] loader.c: Error loading module 'cdr_addon_odbc.so': /usr/lib/asterisk/modules/cdr_addon_odbc.so: cannot open shared object file: No such file or directory
[Oct 7 14:02:50] ERROR[1498] loader.c: cel_sqlite3_custom declined to load.
[Oct 7 14:02:50] ERROR[1498] loader.c: cdr_sqlite3_custom declined to load.
[Oct 7 14:02:50] ERROR[1498] loader.c: res_hep_pjsip declined to load.
[Oct 7 14:02:50] VERBOSE[1498] asterisk.c: Asterisk Ready.
[Oct 7 14:03:38] WARNING[1708] res_pjsip_pubsub.c: No registered publish handler for event presence
[Oct 7 14:04:48] VERBOSE[2253] pbx_variables.c: Setting global variable 'SIPDOMAIN' to '192.168.26.11'
[Oct 7 14:04:48] VERBOSE[2258][C-00000001] pbx.c: Executing [[Number Removed]@IncomingContext:1] NoOp("PJSIP/siptrunk-00000000", "Incoming [Number Removed]") in new stack
[Oct 7 14:04:48] VERBOSE[2258][C-00000001] pbx.c: Executing [[Number Removed]@IncomingContext:2] Answer("PJSIP/siptrunk-00000000", "") in new stack
[Oct 7 14:04:48] VERBOSE[2253] res_rtp_asterisk.c: 0x7f17400122e0 -- Strict RTP learning after remote address set to: XXX.XXX.XXX.XXX:40570
[Oct 7 14:04:49] VERBOSE[2258][C-00000001] pbx.c: Executing [[Number Removed]@IncomingContext:3] Playback("PJSIP/siptrunk-00000000", "tt-monkeys") in new stack
[Oct 7 14:04:49] VERBOSE[2258][C-00000001] file.c: <PJSIP/siptrunk-00000000> Playing 'tt-monkeys.gsm' (language 'en')
[Oct 7 14:05:05] VERBOSE[2258][C-00000001] pbx.c: Executing [[Number Removed]@IncomingContext:4] Hangup("PJSIP/siptrunk-00000000", "") in new stack
[Oct 7 14:05:05] VERBOSE[2258][C-00000001] pbx.c: Spawn extension (IncomingContext, [Number Removed], 4) exited non-zero on 'PJSIP/siptrunk-00000000'
答案 0 :(得分:0)
可能是您背后的服务器。在pjsip配置中,模拟net = yes在下面。 将这三行添加到siptrunk端点中。
dict
注意:不要忘记重新加载星号。
答案 1 :(得分:0)
检查防火墙是否阻止rtp端口
默认端口是10000-20000。有关更多信息,请参见rtp.conf