You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Using actual boolean instead of json string in boolean parameter causes bxml error #248
When receiving an initiate and responding with BXML to start a mult_channel recording, following the types results in a BXML failure on the bandwidth side. The error sends a call status event with cause invalid-bxml. The issue is setting mutli_channel to True instead of "true".
Environment Information
OS Version: Mac OS 15.4
SDK Version: 18.1.3
Environment: 3.11.10
Sample Code Snippet
response=Response()
response.add_verb(
StartRecording(
multi_channel=True, # this fails. To get this to work, I have to set it to `"true"`file_format="mp3",
)
)
response.add_verb(Ring(duration=5))
status_webhook_url="ws://our-url"start_stream=StartStream(
destination=f"wss://{ws_base_url}/ws/bandwidth/",
stream_event_url=status_webhook_url,
mode="bidirectional",
)
start_stream.add_verb(StreamParam(name="hotel_uuid", value=str(hotel.uuid)))
start_stream.add_verb(StreamParam(name="canary_call_uuid", value=str(call.uuid)))
response.add_verb(start_stream)
response.add_verb(
Pause(duration=86400) # hack to keep the call alive
)
logger.info("bandwidth_initiate_call.response", response=response.to_bxml())
returnHttpResponse(content=response.to_bxml(), status=200, content_type="application/xml")
Stack Trace
None
Expected Behavior
I would expect to be able to pass a native boolean instead of a string version to multi_channel
We've done some digging into this and it's actually an issue with the underlying Voice service. When passing a native boolean to the verb in the SDK, the BXML serializes to "True", as opposed to your solution which serializes to "true". The service that handles this BXML is actually case sensitive for this field, which is what causes the invalid-bxml error.
We're going to begin working on a backwards compatible fix for this that should accept both True and true. For now, could you please leave your workaround in your code? I'm happy to notify you here when the fix is released so you can use a true boolean. Thanks for bringing this to our attention!
Hello, is this still an issue? Does this underlying problem exist for other booleans like StopStream(name=start_stream.name, wait="true")? Does this one also need to be forced like: response.add_verb(StopStream(name=start_stream.name, wait="true")) # type: ignore
Hey! @stephenreddek, sorry for the delay on this, we thought we were going to change the backend but that still hasn't happened yet :/
I did just merge #311 which should fix all of these and is going out in the next release (23.3.0) today. Let me know if this solves your issue!
Activity
ckoegel commentedon Apr 24, 2025
Hey @stephenreddek!
We've done some digging into this and it's actually an issue with the underlying Voice service. When passing a native boolean to the verb in the SDK, the BXML serializes to
"True", as opposed to your solution which serializes to"true". The service that handles this BXML is actually case sensitive for this field, which is what causes theinvalid-bxmlerror.We're going to begin working on a backwards compatible fix for this that should accept both
Trueandtrue. For now, could you please leave your workaround in your code? I'm happy to notify you here when the fix is released so you can use a true boolean. Thanks for bringing this to our attention!stephenreddek commentedon Aug 28, 2026
Hello, is this still an issue? Does this underlying problem exist for other booleans like
StopStream(name=start_stream.name, wait="true")? Does this one also need to be forced like:response.add_verb(StopStream(name=start_stream.name, wait="true")) # type: ignoreckoegel commentedon Sep 22, 2026
Hey! @stephenreddek, sorry for the delay on this, we thought we were going to change the backend but that still hasn't happened yet :/
I did just merge #311 which should fix all of these and is going out in the next release (23.3.0) today. Let me know if this solves your issue!