futel / asteriskserver

SIP server for Futel
Creative Commons Zero v1.0 Universal
25 stars 7 forks source link

can we reduce incoming-dialstatus-CHANUNAVAIL? #133

Open kra opened 7 years ago

kra commented 7 years ago

when sip clients become unreachable we lose incoming calls.

qualify=no or a longer timeout might prevent these messages, and might prevent asterisk from refusing to connect to client because it feels it is unreachable. OTOH the problem might be real and the connection would fail anyway. alternately, qualifyfreq with a shorter timeout might keep us connected due to network activity.

can we tell the clients to register more often?

keepalive? rtpkeepalive?

does nat setting have an effect?

[Jan 20 12:42:30] VERBOSE[2563][C-00000127] pbx.c: -- Executing [s@ring-r2d2:2] Dial("SIP/callcentric-r2d2-000001ec", "SIP/670") in new stack [Jan 20 12:42:30] WARNING[2563][C-00000127] app_dial.c: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent) [Jan 20 12:42:30] VERBOSE[2563][C-00000127] app_dial.c: == Everyone is busy/congested at this time (1:0/0/1) [Jan 20 12:42:30] VERBOSE[2563][C-00000127] pbx.c: -- Executing [s@ring-r2d2:3] Macro("SIP/callcentric-r2d2-000001ec", "metric,incoming-dialstatus-CHANUNAVAIL") in new stack [Jan 20 12:42:30] VERBOSE[2563][C-00000127] pbx.c: -- Executing [s@macro-metric:1] AGI("SIP/callcentric-r2d2-000001ec", "metric.agi,incoming-dialstatus-CHANUNAVAIL") in new stack [Jan 20 12:42:30] VERBOSE[2563][C-00000127] res_agi.c: -- Launched AGI Script /opt/asterisk/var/lib/asterisk/agi-bin/metric.agi [Jan 20 12:42:30] VERBOSE[2563][C-00000127] res_agi.c: metric.agi,incoming-dialstatus-CHANUNAVAIL: CALLERID(number)=12096894560, UNIQUEID=1484944949.528, CHANNEL=SIP/callcentric-r2d2-000001ec, name=incoming-dialstatus-CHANUNAVAIL [Jan 20 12:42:30] VERBOSE[2563][C-00000127] res_agi.c: -- <SIP/callcentric-r2d2-000001ec>AGI Script metric.agi completed, returning 0 [Jan 20 12:42:30] VERBOSE[2563][C-00000127] pbx.c: -- Auto fallthrough, channel 'SIP/callcentric-r2d2-000001ec' status is 'CHANUNAVAIL' [Jan 20 12:42:37] VERBOSE[1362] chan_sip.c: -- Registered SIP '670' at 159.203.231.254:1156 [Jan 20 12:42:37] NOTICE[1362] chan_sip.c: Peer '670' is now Reachable. (52ms / 2000ms)

kra commented 7 years ago

still getting it with these settings

qualify=yes qualifyfreq=10 nat=yes ;force_rport, comedia

peer becomes unreachable even though it can make outgoing calls

[Feb 9 11:45:27] NOTICE[1356] chan_sip.c: Peer '668' is now UNREACHABLE! Last qualify: 39 [Feb 9 12:17:37] VERBOSE[10441][C-00000095] pbx.c: -- Executing [999@default-outgoing:1] Set("SIP/668-000000f0", "destination=outgoing-ivr") in new stack

later, incoming call fails

[Feb 9 12:21:11] VERBOSE[10462][C-00000096] pbx.c: -- Executing [s@ring-oskar:2] Dial("SIP/voipms-000000f2", "SIP/668") in new stack [Feb 9 12:21:11] VERBOSE[10462][C-00000096] pbx.c: -- Executing [s@ring-oskar:3] Macro("SIP/voipms-000000f2", "metric,incoming-dialstatus-CHANUN AVAIL") in new stack [Feb 9 12:21:11] VERBOSE[10462][C-00000096] pbx.c: -- Executing [s@macro-metric:1] AGI("SIP/voipms-000000f2", "metric.agi,incoming-dialstatus-CH ANUNAVAIL") in new stack [Feb 9 12:21:11] VERBOSE[10462][C-00000096] res_agi.c: metric.agi,incoming-dialstatus-CHANUNAVAIL: CALLERID(number)=XXXXXXXXXX, UNIQUEID=1486671671 .242, CHANNEL=SIP/voipms-000000f2, name=incoming-dialstatus-CHANUNAVAIL [Feb 9 12:21:11] VERBOSE[10462][C-00000096] pbx.c: -- Auto fallthrough, channel 'SIP/voipms-000000f2' status is 'CHANUNAVAIL'

kra commented 7 years ago

with qualify=no, clients are only reachable for a short period after they make an outgoing connection

kra commented 7 years ago

these qualify values reduce the unreachables, but we still get 670 unreachable, which is the most important one. Less than before, though.

qualify=1800 ; 30 min timeout before we consider unreachable qualifyfreq=5 ; qualify every 5 sec to hopefuly keep connection

[Feb 20 14:28:04] NOTICE[3776] chan_sip.c: Peer '670' is now UNREACHABLE!  Last qualify: 51