[Gelöst] Failover via Hunt Groups?

wuesten.fuchs

Neuer User
Mitglied seit
4 Sep 2008
Beiträge
83
Punkte für Reaktionen
2
Punkte
8
Hallo zusammen,

ist es möglich, ein Failover via Hunt Groups mit Registrierung zu ermöglichen?

So weit ich sehen kann, scheitert das daran, dass sich nur ein SIP-Gateway an das IP-Interface binden kann. Zur Registrierung müsste ich jedoch zwei SIP-Gateways angeben, jeweils mit ihren eigenen Location Services (für den jeweiligen SIP-Server).

Oder denke ich zu kompliziert?

Grüße,

Robert
 
Zuletzt bearbeitet:
Hallo Robert,

nun - es ist ein smartnode.

So könnte man das machen und die GWs über die Ports trennen:

Code:
context sip-gateway GWUSER

  interface IFGWUSER
    bind interface eth0 context router port 5060

context sip-gateway GWUSER
  bind location-service USER
  no shutdown

context sip-gateway GWFreePBX

  interface IFFreePBX
    bind interface eth0 context router port 5064

context sip-gateway GWFreePBX
  no shutdown

Gruß, Sebastian
 
Hallo Sebastian,

Klasse, du hast mich auf die richtige Spur gebracht! Der Schlüssel ist also, verschiedene Ports zu verwenden - und es klappt!

Wichtig ist zu wissen, dass der SmartNode zwar DNS SRV-Einträge unterstützt, aber keine Prioritäten unterstützt, also kein Umschalten vom Server sip1.example.com mit der Priorität=10 auf sip2.example.com mit der Priorität=20, wenn der erste Server ausfällt.
Stattdessen kann man das über Hunt Groups lösen, was gar nicht so schlecht ist, denn damit hat man eine genauere Kontrolle über das Failover.

Ich werde weiter unten zwei vollständige Beispiele für ein Failover mit Hunt Groups posten (der Übersicht halber getrennt). Als PBX fungiert in diesen Beispielen Asterisk.

Das erste Posting bildet ein Failover ohne Registrierung ab, das zweite Posting ein Failover mit Registrierung.

Grüße,

Robert
 
Zuletzt bearbeitet:
Failover ohne Registrierung: Hier das Beispiel eines Failovers von sip1.example.com auf sip2.example.com, wenn sip1 ausfällt. In diesem Beispiel findet keine Registrierung statt; das Failover erfolgt über Hunt Groups:

Asterisk sip.conf:
Code:
[pstn_isdn]
type = peer
host = 192.168.23.10
port = 5060
acl = host_pstn_isdn
context = trunk_pstn_isdn

Und die dazu passende SmartNode-Konfiguration:
Code:
#----------------------------------------------------------------#
#                                                                #
# SN4552/2BIS/EUI                                                #
# R5.3 2009-11-17 SIP                                            #
# 2015-06-22T20:31:46                                            #
# SN/00A0BA0340C0                                                #
# Generated configuration file                                   #
#                                                                #
#----------------------------------------------------------------#

cli version 3.20
gui type basic
administrator administrator password XXX
clock local offset +01:00
dns-client server 192.168.23.1
dns-client server 192.168.23.2
dns-relay
webserver port 80 language en
snmp community public ro
sntp-client
sntp-client server primary ntp1.example.com port 123 version 4
sntp-client server secondary ntp2.example.com port 123 version 4
system hostname isdn
system location "XXX"
system contact "XXX"

system

  ic voice 0

profile acl ACL_WAN_PERMIT_ALL_MGMT
  permit 1 ip any any ""

profile acl ACL_WAN_PERMIT_SEL_MGMT
  deny 1 tcp any any eq 23 ""
  deny 2 tcp any any eq 80 ""
  deny 3 udp any any eq 161 ""
  permit 4 ip any any ""

profile acl ACL_WAN_BLOCK_ALL_MGMT
  deny 1 tcp any any eq 23 ""
  deny 2 tcp any any eq 80 ""
  deny 3 udp any any eq 161 ""
  permit 4 ip any any ""

profile service-policy SP_WAN_OUT
  rate-limit 100000 header-length 18 voice-margin 0

  source traffic-class local-voice
    priority

  source traffic-class default
    priority

profile service-policy SP_WAN_IN
  rate-limit 100000 header-length 18 voice-margin 200

  source traffic-class local-voice
    priority

  source traffic-class default
    queue-limit 4

profile napt NAPT_WAN

profile ppp default

profile call-progress-tone US_DIAL_TONE
  play 1 10 350 -13 440 -13

profile call-progress-tone US_RB_TONE
  play 1 2000 440 -19 480 -19
  pause 2 4000

profile call-progress-tone US_BUSY_TONE
  play 1 500 480 -24 620 -24
  pause 2 500

profile call-progress-tone US_CONGESTION_TONE
  play 1 250 480 -24 620 -24
  pause 2 250

profile tone-set default
profile tone-set Europe
profile tone-set UnitedStates
  map call-progress-tone dial-tone US_DIAL_TONE
  map call-progress-tone ringback-tone US_RB_TONE
  map call-progress-tone busy-tone US_BUSY_TONE
  map call-progress-tone release-tone US_BUSY_TONE
  map call-progress-tone congestion-tone US_CONGESTION_TONE

profile voip default
  codec 1 g711alaw64k rx-length 20 tx-length 20
  codec 2 g711ulaw64k rx-length 20 tx-length 20

profile voip VOIP
  codec 1 g729 rx-length 20 tx-length 20
  codec 2 g711alaw64k rx-length 20 tx-length 20
  codec 3 g711ulaw64k rx-length 20 tx-length 20
  dejitter-mode static
  dejitter-max-delay 120

profile pstn default

profile sip default

profile dhcp-server DHCPS_LAN
  network 192.168.23.10 255.255.255.0
  lease 2 hours
  default-router 1 192.168.23.10
  domain-name patton.com
  domain-name-server 1 192.168.23.10

profile aaa default
  method 1 local
  method 2 none

context ip router

  interface IF_IP_WAN
    ipaddress dhcp
    use profile acl ACL_WAN_PERMIT_ALL_MGMT in
    use profile service-policy SP_WAN_IN in
    use profile service-policy SP_WAN_OUT out
    use profile napt NAPT_WAN
    tcp adjust-mss rx 582
    tcp adjust-mss tx 1440

  interface IF_IP_LAN
    ipaddress 192.168.23.10 255.255.255.0
    icmp router-discovery

  dyndns
    service custom

context ip router
  route 0.0.0.0 0.0.0.0 192.168.23.100 0

subscriber ppp SUB_PPPOE
  dial out
  no multilink
  authentication chap
  authentication pap
  bind interface IF_IP_WAN router

context cs switch
  national-prefix 0
  international-prefix 00

  routing-table called-e164 RT_SPEED_DIAL
    route T dest-table RT_NR_BLOCKING MT_SPEED_DIAL

  routing-table called-e164 RT_NR_BLOCKING
    route default dest-table RT_CALL_ROUTING MT_SET_CNPN

  routing-table called-e164 RT_CALL_ROUTING
    route default dest-service SER_HG_PSTN_FALLBACK

  routing-table called-e164 RT_INCOMING
    route default dest-interface IF_S0_01 MT_NR_TRANSLATION

  mapping-table called-e164 to called-e164 MT_SPEED_DIAL
  mapping-table calling-e164 to calling-e164 MT_SET_CNPN
  mapping-table called-e164 to called-e164 MT_NR_TRANSLATION

  interface isdn IF_S0_00
    route call dest-table RT_INCOMING

  interface isdn IF_S0_01
    route call dest-table RT_SPEED_DIAL
    use profile tone-set Europe
    isdn-date-time

  interface isdn IF_TE_00
    route call dest-service SER_HG_ASTERISK

  interface sip IF_SIP_SERVICE
    bind context sip-gateway GW_SIP
    route call dest-table RT_INCOMING
    use profile voip VOIP

  interface sip IF_SIP_ASTERISK
    bind context sip-gateway GW_ASTERISK
    route call dest-interface IF_TE_00
    remote sip1.example.com

  interface sip IF_SIP_ASTERISK2
    bind context sip-gateway GW_ASTERISK
    route call dest-interface IF_TE_00
    remote sip2.example.com

  service hunt-group SER_HG_PSTN_FALLBACK
    timeout 6
    drop-cause normal-unspecified
    drop-cause no-circuit-channel-available
    drop-cause network-out-of-order
    drop-cause temporary-failure
    drop-cause switching-equipment-congestion
    drop-cause access-info-discarded
    drop-cause circuit-channel-not-available
    drop-cause resources-unavailable
    drop-cause no-route-to-destination
    route call 1 dest-interface IF_SIP_SERVICE
    route call 2 dest-interface IF_S0_00

  service hunt-group SER_HG_ASTERISK
    timeout 3
    drop-cause normal-unspecified
    drop-cause no-circuit-channel-available
    drop-cause network-out-of-order
    drop-cause temporary-failure
    drop-cause switching-equipment-congestion
    drop-cause access-info-discarded
    drop-cause circuit-channel-not-available
    drop-cause resources-unavailable
    drop-cause no-route-to-destination
    route call 1 dest-interface IF_SIP_ASTERISK
    route call 2 dest-interface IF_SIP_ASTERISK2
	
context cs switch
  no shutdown

authentication-service AUTH_SVC

location-service LOCATION_SVC

  identity-group default

    authentication outbound
      authenticate 1 authentication-service AUTH_SVC

    registration outbound
      register auto

    call outbound

context sip-gateway GW_SIP

  interface SIP_WAN
    bind interface IF_IP_WAN context router port 5060

context sip-gateway GW_SIP
  bind location-service LOCATION_SVC
  no shutdown

context sip-gateway GW_ASTERISK

  interface IF_LAN
    bind interface IF_IP_LAN context router port 5060

context sip-gateway GW_ASTERISK
  no shutdown

port ethernet 0 0
  bind interface IF_IP_WAN router

  pppoe

    session SES_PPPOE
      bind subscriber SUB_PPPOE
      shutdown

port ethernet 0 0
  no shutdown

port ethernet 0 1
  bind interface IF_IP_LAN router
  no shutdown

port bri 0 0
  clock auto
  encapsulation q921

  q921
    uni-side auto
    encapsulation q931

    q931
      protocol dss1
      uni-side user
      bchan-number-order ascending
      encapsulation cc-isdn
      bind interface IF_TE_00 switch

port bri 0 0
  no shutdown

port bri 0 1
  clock auto
  encapsulation q921

  q921
    uni-side auto
    encapsulation q931

    q931
      protocol dss1
      uni-side net
      bchan-number-order ascending
      encapsulation cc-isdn
      bind interface IF_S0_01 switch

port bri 0 1
  no shutdown

Ankommende Anrufe werden nur zum sip1 geroutet; und nur bei Ausfall desselben an sip2. Ausgehende Anrufe sind jedoch vom sip2 jederzeit möglich.
 
Zuletzt bearbeitet:
Failover mit Registrierung: Hier das Beispiel eines Failovers von sip1.example.com auf sip2.example.com, wenn sip1 ausfällt. Hier wird Registrierung verwendet; das Failover erfolgt über Hunt Groups:

Asterisk sip.conf:
Code:
[pstn_isdn]
secret = XXX
type = friend
host = dynamic
port = 5060
acl = host_pstn_isdn
qualify = yes
insecure = port,invite
context = trunk_pstn_isdn

Und die dazu passende SmartNode-Konfiguration:
Code:
#----------------------------------------------------------------#
#                                                                #
# SN4552/2BIS/EUI                                                #
# R5.3 2009-11-17 SIP                                            #
# 2015-06-25T21:01:15                                            #
# SN/00A0BA0340C0                                                #
# Generated configuration file                                   #
#                                                                #
#----------------------------------------------------------------#

cli version 3.20
gui type basic
administrator administrator password XXX
clock local offset +01:00
dns-client server 192.168.23.1
dns-client server 192.168.23.2
dns-relay
webserver port 80 language en
snmp community public ro
sntp-client
sntp-client server primary ntp1.example.com port 123 version 4
sntp-client server secondary ntp2.example.com port 123 version 4
system hostname isdn
system location "XXX"
system contact "XXX"

system

  ic voice 0

profile acl ACL_WAN_PERMIT_ALL_MGMT
  permit 1 ip any any ""

profile acl ACL_WAN_PERMIT_SEL_MGMT
  deny 1 tcp any any eq 23 ""
  deny 2 tcp any any eq 80 ""
  deny 3 udp any any eq 161 ""
  permit 4 ip any any ""

profile acl ACL_WAN_BLOCK_ALL_MGMT
  deny 1 tcp any any eq 23 ""
  deny 2 tcp any any eq 80 ""
  deny 3 udp any any eq 161 ""
  permit 4 ip any any ""

profile service-policy SP_WAN_OUT
  rate-limit 100000 header-length 18 voice-margin 0

  source traffic-class local-voice
    priority

  source traffic-class default
    priority

profile service-policy SP_WAN_IN
  rate-limit 100000 header-length 18 voice-margin 200

  source traffic-class local-voice
    priority

  source traffic-class default
    queue-limit 4

profile napt NAPT_WAN

profile ppp default

profile call-progress-tone US_DIAL_TONE
  play 1 10 350 -13 440 -13

profile call-progress-tone US_RB_TONE
  play 1 2000 440 -19 480 -19
  pause 2 4000

profile call-progress-tone US_BUSY_TONE
  play 1 500 480 -24 620 -24
  pause 2 500

profile call-progress-tone US_CONGESTION_TONE
  play 1 250 480 -24 620 -24
  pause 2 250

profile tone-set default
profile tone-set Europe
profile tone-set UnitedStates
  map call-progress-tone dial-tone US_DIAL_TONE
  map call-progress-tone ringback-tone US_RB_TONE
  map call-progress-tone busy-tone US_BUSY_TONE
  map call-progress-tone release-tone US_BUSY_TONE
  map call-progress-tone congestion-tone US_CONGESTION_TONE

profile voip default
  codec 1 g711alaw64k rx-length 20 tx-length 20
  codec 2 g711ulaw64k rx-length 20 tx-length 20

profile voip VOIP
  codec 1 g729 rx-length 20 tx-length 20
  codec 2 g711alaw64k rx-length 20 tx-length 20
  codec 3 g711ulaw64k rx-length 20 tx-length 20
  dejitter-mode static
  dejitter-max-delay 120

profile pstn default

profile sip default

profile dhcp-server DHCPS_LAN
  network 192.168.23.10 255.255.255.0
  lease 2 hours
  default-router 1 192.168.23.10
  domain-name patton.com
  domain-name-server 1 192.168.23.10

profile aaa default
  method 1 local
  method 2 none

context ip router

  interface IF_IP_WAN
    ipaddress dhcp
    use profile acl ACL_WAN_PERMIT_ALL_MGMT in
    use profile service-policy SP_WAN_IN in
    use profile service-policy SP_WAN_OUT out
    use profile napt NAPT_WAN
    tcp adjust-mss rx 582
    tcp adjust-mss tx 1440

  interface IF_IP_LAN
    ipaddress 192.168.23.10 255.255.255.0
    icmp router-discovery

  dyndns
    service custom

context ip router
  route 0.0.0.0 0.0.0.0 192.168.23.100 0

subscriber ppp SUB_PPPOE
  dial out
  no multilink
  authentication chap
  authentication pap
  bind interface IF_IP_WAN router

context cs switch
  national-prefix 0
  international-prefix 00

  routing-table called-e164 RT_SPEED_DIAL
    route T dest-table RT_NR_BLOCKING MT_SPEED_DIAL

  routing-table called-e164 RT_NR_BLOCKING
    route default dest-table RT_CALL_ROUTING MT_SET_CNPN

  routing-table called-e164 RT_CALL_ROUTING
    route default dest-service SER_HG_PSTN_FALLBACK

  routing-table called-e164 RT_INCOMING
    route default dest-interface IF_S0_01 MT_NR_TRANSLATION

  mapping-table called-e164 to called-e164 MT_SPEED_DIAL
  mapping-table calling-e164 to calling-e164 MT_SET_CNPN
  mapping-table called-e164 to called-e164 MT_NR_TRANSLATION

  interface isdn IF_S0_00
    route call dest-table RT_INCOMING

  interface isdn IF_S0_01
    route call dest-table RT_SPEED_DIAL
    use profile tone-set Europe
    isdn-date-time

  interface isdn IF_TE_00
    route call dest-service SER_HG_ASTERISK

  interface sip IF_SIP_SERVICE
    bind context sip-gateway GW_SIP
    route call dest-table RT_INCOMING
    use profile voip VOIP

  interface sip IF_SIP_ASTERISK
    bind context sip-gateway GW_ASTERISK
    route call dest-interface IF_TE_00
    remote sip1.example.com

  interface sip IF_SIP_ASTERISK_2
    bind context sip-gateway GW_ASTERISK_2
    route call dest-interface IF_TE_00
    remote sip2.example.com

  service hunt-group SER_HG_PSTN_FALLBACK
    timeout 6
    drop-cause normal-unspecified
    drop-cause no-circuit-channel-available
    drop-cause network-out-of-order
    drop-cause temporary-failure
    drop-cause switching-equipment-congestion
    drop-cause access-info-discarded
    drop-cause circuit-channel-not-available
    drop-cause resources-unavailable
    drop-cause no-route-to-destination
    route call 1 dest-interface IF_SIP_SERVICE
    route call 2 dest-interface IF_S0_00

  service hunt-group SER_HG_ASTERISK
    timeout 3
    drop-cause normal-unspecified
    drop-cause no-circuit-channel-available
    drop-cause network-out-of-order
    drop-cause temporary-failure
    drop-cause switching-equipment-congestion
    drop-cause access-info-discarded
    drop-cause circuit-channel-not-available
    drop-cause resources-unavailable
    drop-cause no-route-to-destination
    route call 1 dest-interface IF_SIP_ASTERISK
    route call 2 dest-interface IF_SIP_ASTERISK_2

context cs switch
  no shutdown

authentication-service AUTH_SVC
  username pstn_isdn password XXX

location-service LOCATION_SVC
  domain 1 sip1.example.com

  identity-group default

    call outbound

  identity pstn_isdn inherits default

    authentication outbound
      authenticate 1 authentication-service AUTH_SVC username pstn_isdn

    authentication inbound
      authenticate 1 authentication-service AUTH_SVC username pstn_isdn

    registration outbound
      registrar sip1.example.com
      lifetime 10
      register auto
      retry-timeout on-system-error 10
      retry-timeout on-client-error 10
      retry-timeout on-server-error 10

    registration inbound
      lifetime default 10 min 1 max 30

location-service LOCATION_SVC_2
  domain 1 sip2.example.com

  identity-group default

    call outbound

  identity pstn_isdn inherits default

    authentication outbound
      authenticate 1 authentication-service AUTH_SVC username pstn_isdn

    authentication inbound
      authenticate 1 authentication-service AUTH_SVC username pstn_isdn

    registration outbound
      registrar sip2.example.com
      lifetime 10
      register auto
      retry-timeout on-system-error 10
      retry-timeout on-client-error 10
      retry-timeout on-server-error 10

    registration inbound
      lifetime default 10 min 1 max 30

context sip-gateway GW_SIP

  interface SIP_WAN
    bind interface IF_IP_WAN context router port 5060

context sip-gateway GW_SIP
  bind location-service LOCATION_SVC
  no shutdown

context sip-gateway GW_ASTERISK

  interface IF_LAN
    bind interface IF_IP_LAN context router port 5060

context sip-gateway GW_ASTERISK
  bind location-service LOCATION_SVC
  no shutdown

context sip-gateway GW_ASTERISK_2

  interface IF_LAN_2
    bind interface IF_IP_LAN context router port 5064

context sip-gateway GW_ASTERISK_2
  bind location-service LOCATION_SVC_2
  no shutdown

port ethernet 0 0
  bind interface IF_IP_WAN router

  pppoe

    session SES_PPPOE
      bind subscriber SUB_PPPOE
      shutdown

port ethernet 0 0
  no shutdown

port ethernet 0 1
  bind interface IF_IP_LAN router
  no shutdown

port bri 0 0
  clock auto
  encapsulation q921

  q921
    uni-side auto
    encapsulation q931

    q931
      protocol dss1
      uni-side user
      bchan-number-order ascending
      encapsulation cc-isdn
      bind interface IF_TE_00 switch

port bri 0 0
  no shutdown

port bri 0 1
  clock auto
  encapsulation q921

  q921
    uni-side auto
    encapsulation q931

    q931
      protocol dss1
      uni-side net
      bchan-number-order ascending
      encapsulation cc-isdn
      bind interface IF_S0_01 switch

port bri 0 1
  no shutdown

Dabei ist der SmartNode an beiden SIP-Servern gleichzeitig registriert, routet aber ankommende Anrufe nur zum sip1; und nur bei Ausfall desselben an sip2. Ausgehende Anrufe sind jedoch vom sip2 jederzeit möglich.
 
Zuletzt bearbeitet:
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.

IPPF im Überblick

Neueste Beiträge