posted 17 years ago
hi, thanks for yr reply
this is my code:
public void service(AgiRequest request, AgiChannel channel)
throws AgiException
{
//here i getting callerid
String callerid=request.getCallerId();
System.out.println(callerid);
if(callerid!=null)
{
int call=callerid.length();
if(call>3)
{
//i truncated the callerid i have to pass newcallerid value to another program
newcallerid=(callerid.substring(call-3,call));
System.out.println(newcallerid);
}
else
{
newcallerid=callerid;
}
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/campaign", "meetme", "meetme");
st = conn.createStatement();
rs5=st.executeQuery("select * from customerdetails where telno='"+ newcallerid +"' || mblno='"+ newcallerid +"'");
if(rs5.next())
{
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/inboundcrm", "meetme", "meetme");
st = conn.createStatement();
rs3=st.executeQuery("select * from queue where loginflag=0");
if(rs3.next())
{
System.out.println(newcallerid);
//this below i calling another program
Class b=Class.forName("MLogoff_Calleridin");
Object obj1=b.newInstance();
MLogoff_Calleridin f=(MLogoff_Calleridin)obj1;
f.service( request,channel);
}//if close
}catch
}
}