twilio / twilio-go

A Go package for communicating with the Twilio API.
MIT License
271 stars 40 forks source link

Library Removes waitUrl Attribute When Set to Empty String Contrary to Documentation (<Conference> TwiML) #225

Open vlad-tokarev opened 5 months ago

vlad-tokarev commented 5 months ago

Issue Summary

In the library, when setting the waitUrl attribute of a Conference TwiML conference to an empty string ('') to prevent any playback while waiting for the conference to start, the attribute is unexpectedly removed from the rendered TwiML. This behavior is inconsistent with the official documentation, which states that setting waitUrl to an empty string should be a valid option for achieving no playback during the wait period.

Steps to Reproduce

  1. Run Code snippet
  2. Check console output

Code Snippet

package main

import (
    "fmt"
    "github.com/twilio/twilio-go/twiml"
)

func main() {
    twimlConference := twiml.VoiceConference{
        Name:                "MyConference",
        WaitUrl: "",
    }

    voice, err := twiml.Voice([]twiml.Element{twimlConference})
    if err != nil {
        panic(err)
    }

    fmt.Printf("%s", voice)
}

Exception/Log

<?xml version="1.0" encoding="UTF-8"?><Response><Conference>MyConference</Conference></Response>

Technical details:

tiwarishubham635 commented 1 month ago

I can look into this