Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Problem with cnam.js?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
larclap at yahoo.com
Guest





PostPosted: Sat Aug 22, 2009 11:51 am    Post subject: [Freeswitch-users] Problem with cnam.js? Reply with quote

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
Back to top
mike at jerris.com
Guest





PostPosted: Mon Aug 24, 2009 2:52 pm    Post subject: [Freeswitch-users] Problem with cnam.js? Reply with quote

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:
Quote:
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 (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

Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services