Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8123403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:10:25+00:00 2026-06-06T06:10:25+00:00

In Freeswitch arguments passed to lua scripts are space delimited (see http://wiki.freeswitch.org/wiki/Mod_lua#Passing_Arguments ). I’ve

  • 0

In Freeswitch arguments passed to lua scripts are space delimited (see http://wiki.freeswitch.org/wiki/Mod_lua#Passing_Arguments ).

I’ve worked out that you can wrap the argument in single quotes, and this then ignores the space but I can’t then work out how to escape single quotes.

How should arguments with spaces be passed to Lua?

To recreate the problem:

Example Lua script:

argumentOne=argv[1];
argumentTwo=argv[2];
argumentThree=argv[3];
argumentFour=argv[4];

freeswitch.consoleLog("info", "*******************\n");
freeswitch.consoleLog("info", argumentOne);
freeswitch.consoleLog("info", "\n");
freeswitch.consoleLog("info", argumentTwo);
freeswitch.consoleLog("info", "\n");
freeswitch.consoleLog("info", argumentThree);
freeswitch.consoleLog("info", "\n");
freeswitch.consoleLog("info", argumentFour);
freeswitch.consoleLog("info", "\n");
freeswitch.consoleLog("info", "*******************\n");

This works fine:

freeswitch@internal> luarun luaargumenttest.lua one two 'thr ee'  four
+OK

freeswitch@internal> 2012-06-24 11:56:55.873757 [INFO] switch_cpp.cpp:1197 *******************
2012-06-24 11:56:55.873757 [INFO] switch_cpp.cpp:1197 one2012-06-24 11:56:55.873757 [INFO] switch_cpp.cpp:1197
2012-06-24 11:56:55.873757 [INFO] switch_cpp.cpp:1197 two2012-06-24 11:56:55.873757 [INFO] switch_cpp.cpp:1197
2012-06-24 11:56:55.873757 [INFO] switch_cpp.cpp:1197 thr ee2012-06-24 11:56:55.873757 [INFO] switch_cpp.cpp:1197
2012-06-24 11:56:55.873757 [INFO] switch_cpp.cpp:1197 four2012-06-24 11:56:55.873757 [INFO] switch_cpp.cpp:1197
2012-06-24 11:56:55.873757 [INFO] switch_cpp.cpp:1197 *******************

But how would I send in the argument value “three’s a crowd”?

I’ve tried \’, ”, ”’ and also ” and \” but non of these work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:10:28+00:00Added an answer on June 6, 2026 at 6:10 am

    I looked through the FreeSWITCH code, and it looks like there’s no way to escape a single quote:

    here mod_lua calls switch_separate_string()
    https://github.com/FreeSWITCH/FreeSWITCH/blob/ee8c9e869ba0da3d4f620769c1e241be71d99e6f/src/mod/languages/mod_lua/mod_lua.cpp#L156

    here switch_separate_string calls separate_string_blank_delim(), and it only catches a single quote as an argument delimiter:
    https://github.com/FreeSWITCH/FreeSWITCH/blob/ee8c9e869ba0da3d4f620769c1e241be71d99e6f/src/switch_utils.c#L2062

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am beginner to freeswitch.While learning this I have seen the terms 'leg A'
I am learning FreeSWITCH applications. In this the application called 'javascript' which is used
Can anyone please give me some tutorial URL for freeswitch? I am a beginner
I have a logfile with entries like: ... freeswitch.log:2011-09-08 12:21:07.282236 [ERR] ftdm_queue.c:136 Failed to
I have installed FreeSWITCH 1.0.6 on CentOS 5.5. I believe CentOS is blocking the
I am getting this error when trying to build Freeswitch's latest code on git
i'm using zeromq with php bindings to connect to the zmq module in Freeswitch
I am beginner to free switch.I have gone through the configuration file vars.xml in
I have an asp.net web page which interacts with a SQL Server database, grabs
I have a UITableView with cells that contain a UISwitch control. It's similar to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.