package org.asteriskjava.fastagi.command;

public class BridgeCommand extends AbstractAgiCommand
{
    /**
     * Serial version identifier.
     */
    private static final long serialVersionUID = 3762248656229053753L;
    private String options;
    private String channel;

    /**
     * Creates a new AnswerCommand.
     */
    public BridgeCommand(String channel, String options)
    {
        super();
        this.channel = channel;
        this.options = options;
    }

    @Override
    public String buildCommand()
    {
        String command = "EXEC " + escapeAndQuote("bridge") + " " + escapeAndQuote(channel);
        if (options != null && options.length() > 0)
        {
            command += " " + escapeAndQuote(options);
        }

        return command;

    }
}

@@ -36,16 +36,58 @@
 mmand;%0A%0A
+import org.asteriskjava.AsteriskVersion;%0A%0A
 public c
@@ -720,24 +720,217 @@
 )%0A        %7B%0A
+            if (asteriskVersion.isAtLeast(AsteriskVersion.ASTERISK_13))%0A            %7B%0A                command += %22,%22 + escapeAndQuote(options);%0A            %7D%0A            else%0A            %7B%0A    
             
@@ -963,32 +963,46 @@
 Quote(options);%0A
+            %7D%0A
         %7D%0A%0A     

allow AGI bridge command to change it's syntax based on the Asterisk Version