I think there’s something wrong with the script at http://wiki.freeswitch.org/wiki/Examples_cnam.js.

 

If you use it as is, it displays “Content-type: text/html” for the effective_caller_id_name. In cnam.pl, the first two output lines are generated by:

 

if (!$debug) {print "Content-type: text/html\n\n";}

 

with the actual name in the third line.

 

So I changed:

 

fd.open("read");

buff = fd.readln();

 

if(buff) {

   logger(buff, "info");

   session.setVariable("effective_caller_id_name", buff);

}

 

To:

 

fd.open("read");

buff = fd.readAll();

 

if(buff[2]) {

   logger(buff, "info");

   session.setVariable("effective_caller_id_name", buff[2]);

}

 

Or remove the print statement from cnam.pl.

 

Sorry for the code, but the page was not editable.

 

Lars