Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[Freeswitch-users] Problems passing arguments to lua


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





PostPosted: Sun Feb 08, 2009 5:32 pm    Post subject: [Freeswitch-users] Problems passing arguments to lua Reply with quote

Hi Guys,

I’m having some issues passing an argument to an lua script.

Basically in an originate command I pass the name of a .wav file

If I hard code the file session:streamFile(“myfile.wav”]);

It works,

However, using this:

session:streamFile(argv[1]);

causes this error

2009-02-08 22:09:07 [ERR] mod_lua.cpp:176 lua_parse_and_execute() cannot open /usr/local/freeswitch/scripts/helloworld.lua,myfile.wav: No such file or directory

Any Ideas?

Regards
Back to top
msc at freeswitch.org
Guest





PostPosted: Sun Feb 08, 2009 6:23 pm    Post subject: [Freeswitch-users] Problems passing arguments to lua Reply with quote

Print out the variable to make sure it is what you expect:
io.write("argv is " .. argv[1] .. "\n";


Also, if you don't give the sound file an absolute path name then it will automatically use the sound dir path.


-MC

Sent from my iPhone

On Feb 8, 2009, at 2:31 PM, "Nik Middleton" <nik.middleton@noblesolutions.co.uk (nik.middleton@noblesolutions.co.uk)> wrote:



Quote:

Hi Guys,

I’m having some issues passing an argument to an lua script.

Basically in an originate command I pass the name of a .wav file

If I hard code the file session:streamFile(“myfile.wav”]);

It works,

However, using this:

session:streamFile(argv[1]);

causes this error

2009-02-08 22:09:07 [ERR] mod_lua.cpp:176 lua_parse_and_execute() cannot open /usr/local/freeswitch/scripts/helloworld.lua,myfile.wav: No such file or directory

Any Ideas?

Regards


_______________________________________________
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
nik.middleton at noble...
Guest





PostPosted: Sun Feb 08, 2009 7:26 pm    Post subject: [Freeswitch-users] Problems passing arguments to lua Reply with quote

Done that, still doesn’t work. My guess is “related

Regards,


From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael S Collins
Sent: 08 February 2009 23:21
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Problems passing arguments to lua


Print out the variable to make sure it is what you expect:

io.write("argv is " .. argv[1] .. "\n";



Also, if you don't give the sound file an absolute path name then it will automatically use the sound dir path.



-MC

Sent from my iPhone


On Feb 8, 2009, at 2:31 PM, "Nik Middleton" <nik.middleton@noblesolutions.co.uk (nik.middleton@noblesolutions.co.uk)> wrote:
Quote:

Hi Guys,

I’m having some issues passing an argument to an lua script.

Basically in an originate command I pass the name of a .wav file

If I hard code the file session:streamFile(“myfile.wav”]);

It works,

However, using this:

session:streamFile(argv[1]);

causes this error

2009-02-08 22:09:07 [ERR] mod_lua.cpp:176 lua_parse_and_execute() cannot open /usr/local/freeswitch/scripts/helloworld.lua,myfile.wav: No such file or directory

Any Ideas?

Regards



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:[/url][url=http://lists.freeswitch.org/mailman/options/freeswitch-users]http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
brian at freeswitch.org
Guest





PostPosted: Sun Feb 08, 2009 7:58 pm    Post subject: [Freeswitch-users] Problems passing arguments to lua Reply with quote

Looks like you put a , instead of a space when calling the script.

/b

On Feb 8, 2009, at 6:21 PM, Nik Middleton wrote:
Quote:
cannot open /usr/local/freeswitch/scripts/helloworld.lua,myfile.wav
Back to top
nik.middleton at noble...
Guest





PostPosted: Mon Feb 09, 2009 3:59 am    Post subject: [Freeswitch-users] Problems passing arguments to lua Reply with quote

That and not enclosing in single quotes, thanks

Regards,


From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Brian West
Sent: 09 February 2009 00:56
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Problems passing arguments to lua


Looks like you put a , instead of a space when calling the script.


/b


On Feb 8, 2009, at 6:21 PM, Nik Middleton wrote:




cannot open /usr/local/freeswitch/scripts/helloworld.lua,myfile.wav
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