# Bandwidth SIP trunk failover

**URL:** <https://hub.soprani.ca/t/bandwidth-sip-trunk-failover/552>\
**Category:** Issues\
**Tags:** sgx-bwmsgsv2, cheogram-sip\
**Created:** [November 5, 2025, 2:58pm UTC](https://hub.soprani.ca/t/bandwidth-sip-trunk-failover/552 "2025-11-05T14:58:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![singpolyma](https://hub.soprani.ca/user_avatar/hub.soprani.ca/singpolyma/32/11_2.png) [@singpolyma](https://hub.soprani.ca/u/singpolyma)\
**Post date:** [November 5, 2025, 2:58pm UTC](https://hub.soprani.ca/t/bandwidth-sip-trunk-failover/552/1 "2025-11-05T14:58:51Z")

</div>

[https://support.bandwidth.com/hc/en-us/articles/29816399870359-PBX-integration-guide](https://support.bandwidth.com/hc/en-us/articles/29816399870359-PBX-integration-guide)

- Primary: `67.231.3.4`
- Failover: `67.231.4.70`

Something with `scarlet:/etc/asterisk/sip.conf::bandwidth#host`. It’s currently set to the failover IP because of their outage.

–

Solution steps:

- swap bandwidth peer back to primary IP
- configure “qualify” on bandwidth peer
- configure separate, unqualified failover peer
- check SIPPEER(bandwidth,status) and dial failover peer if it’s UNREACHABLE  
(up to here, this can be derived [here](https://irockasterisk.blogspot.com/2012/08/how-to-setup-failover-for-multiple-sip.html))
- configure a CHANNEL(hangup\_handler\_push) that checks the specific SIP status code and dials the failover if it’s an error: [https://stackoverflow.com/questions/39207289/asterisk-hangup-handler-using-lua](https://stackoverflow.com/questions/39207289/asterisk-hangup-handler-using-lua)

TODO:

- in a docker compose application, configure two instances of our asterisk fork that behave like our production asterisk and bandwidth respectively. the bandwidth asterisk is configured to reply with specific error codes to test the failover
- point local, development cheogram + rest of stack to this asterisk setup and call using my normal number
