Error executing AGI script of CallOriginate

Hi All,
I am having small doubt, while running a AGI script for the below java program for originate call.
public String ExecuteAction( String agentName1, String context, String extension, String callerid, int timeout) throws Exception{

    String asteriskCommand ="Action: Originate\r\n "+"Channel:" + "IAX2/" + agentName1 + "/" + agentName1 +
            "\r\nContext :"  + context +"\r\nExten: " +   extension +
            "\r\nPriority: 1" + "\r\nCallerid: " + callerid
            +"\r\nTimeout:" + timeout +"\r\n";


when I run my AGI script for the above code I am getting 510 error, although I am writing command properly.
Please help me with this, Is there any to change the code?

I am eagerly waiting for your response.

Thanks & Regards

Ajay Singh Yaduwanshi