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
Every page on the wiki should be editable. If you don't already have an account, go to: http://wiki.freeswitch.org/index.php?title=Special:UserLogin&type=signup Mike On Aug 22, 2009, at 12:42 PM, Lars Zeb wrote:
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
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch- users http://www.freeswitch.org
participants (2)
-
Lars Zeb
-
Michael Jerris