[Freeswitch-dev] Create applications in FreeSWITCH
Hi dear group, I would like to start writing plugins (applications) for FreeSWITCH that will be called from dialplan: <action application="my_cool_application"...> Could you please provide me some steps following which I will be able to create "helloworld" C/C++ application that will be called from dialplan? Or some link if this is already described somewhere... I tried to google but did not find that. Then, if I will create something useful, I will contribute it to the community with pleasure... :-) Thank you very much! Vitalie
Hi Look at mod_skel in src/mod/applications Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca On 2010-04-23, at 6:43 AM, Vitalii Colosov wrote:
Hi dear group,
I would like to start writing plugins (applications) for FreeSWITCH that will be called from dialplan:
<action application="my_cool_application"...>
Could you please provide me some steps following which I will be able to create "helloworld" C/C++ application that will be called from dialplan?
Or some link if this is already described somewhere... I tried to google but did not find that.
Then, if I will create something useful, I will contribute it to the community with pleasure... :-)
Thank you very much!
Vitalie _______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Thanks Mathieu, This really helped! I was able to get Hello World string during the module load :-) Moving to the next step, how can I define an application, let say "skel_app" inside this module? In order to be able to execute it from dialplan. I thought the following does this: SWITCH_ADD_API(api_interface, "skel", "Skel API", skel_function, "syntax"); But when I executed "skel" from dialplan, I got error: "Invalid application skel". Could you hint me please? Thank you very much! Vitalie 2010/4/23 Mathieu Rene <mrene_lists@avgs.ca>
Hi
Look at mod_skel in src/mod/applications
Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca
On 2010-04-23, at 6:43 AM, Vitalii Colosov wrote:
Hi dear group,
I would like to start writing plugins (applications) for FreeSWITCH that will be called from dialplan:
<action application="my_cool_application"...>
Could you please provide me some steps following which I will be able to create "helloworld" C/C++ application that will be called from dialplan?
Or some link if this is already described somewhere... I tried to google but did not find that.
Then, if I will create something useful, I will contribute it to the community with pleasure... :-)
Thank you very much!
Vitalie _______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
OK I think I found, need to use: SWITCH_ADD_APP Thank you very much!!! 2010/4/23 Vitalii Colosov <vetali100@gmail.com>
Thanks Mathieu, This really helped! I was able to get Hello World string during the module load :-)
Moving to the next step, how can I define an application, let say "skel_app" inside this module? In order to be able to execute it from dialplan.
I thought the following does this: SWITCH_ADD_API(api_interface, "skel", "Skel API", skel_function, "syntax"); But when I executed "skel" from dialplan, I got error: "Invalid application skel".
Could you hint me please?
Thank you very much!
Vitalie
2010/4/23 Mathieu Rene <mrene_lists@avgs.ca>
Hi
Look at mod_skel in src/mod/applications
Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca
On 2010-04-23, at 6:43 AM, Vitalii Colosov wrote:
Hi dear group,
I would like to start writing plugins (applications) for FreeSWITCH that will be called from dialplan:
<action application="my_cool_application"...>
Could you please provide me some steps following which I will be able to create "helloworld" C/C++ application that will be called from dialplan?
Or some link if this is already described somewhere... I tried to google but did not find that.
Then, if I will create something useful, I will contribute it to the community with pleasure... :-)
Thank you very much!
Vitalie _______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
SWITCH_ADD_APP is indeed for dialplan apps. SWITCH_ADD_API is for adding API commands that are executed from the CLI -MC
Sent from my iPhone On Apr 23, 2010, at 7:19 AM, Vitalii Colosov <vetali100@gmail.com> wrote:
OK I think I found, need to use: SWITCH_ADD_APP
Thank you very much!!!
2010/4/23 Vitalii Colosov <vetali100@gmail.com> Thanks Mathieu, This really helped! I was able to get Hello World string during the module load :-)
Moving to the next step, how can I define an application, let say "skel_app" inside this module? In order to be able to execute it from dialplan.
I thought the following does this: SWITCH_ADD_API(api_interface, "skel", "Skel API", skel_function, "syntax"); But when I executed "skel" from dialplan, I got error: "Invalid application skel".
Could you hint me please?
Thank you very much!
Vitalie
2010/4/23 Mathieu Rene <mrene_lists@avgs.ca>
Hi
Look at mod_skel in src/mod/applications
Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca
On 2010-04-23, at 6:43 AM, Vitalii Colosov wrote:
Hi dear group,
I would like to start writing plugins (applications) for FreeSWITCH that will be called from dialplan:
<action application="my_cool_application"...>
Could you please provide me some steps following which I will be able to create "helloworld" C/C++ application that will be called from dialplan?
Or some link if this is already described somewhere... I tried to google but did not find that.
Then, if I will create something useful, I will contribute it to the community with pleasure... :-)
Thank you very much!
Vitalie _______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch- dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
If you're looking for help on writing new applications then of course everything under src/mod/applications/*/ provide good examples. There's also some documentation online of the APIs available to you within FreeSWITCH: http://docs.freeswitch.org/ In particular I recommend you look at the following sections Modules -> Brought To You By APR Modules -> Core Library Core Library will tell you the APIs for interacting with sessions/channels (calls) and provide you with useful interfaces for doing may useful things like DB access, hash tables, file access etc, while APR gives you a platform independant way of doing things like like memory allocation, network access, threading etc. Using them will save you much of the work and keeps the program style nicely consistent across FreeSWITCH. Done right your module should also work on any platform FS runs on without any changes needed (unless you app depends on something that really is platform-specific such as loading a DLL file on Windows). -Steve On 23 April 2010 15:19, Vitalii Colosov <vetali100@gmail.com> wrote:
OK I think I found, need to use: SWITCH_ADD_APP Thank you very much!!!
2010/4/23 Vitalii Colosov <vetali100@gmail.com>
Thanks Mathieu, This really helped! I was able to get Hello World string during the module load :-) Moving to the next step, how can I define an application, let say "skel_app" inside this module? In order to be able to execute it from dialplan. I thought the following does this: SWITCH_ADD_API(api_interface, "skel", "Skel API", skel_function, "syntax"); But when I executed "skel" from dialplan, I got error: "Invalid application skel". Could you hint me please? Thank you very much! Vitalie
2010/4/23 Mathieu Rene <mrene_lists@avgs.ca>
Hi
Look at mod_skel in src/mod/applications
Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca
On 2010-04-23, at 6:43 AM, Vitalii Colosov wrote:
Hi dear group,
I would like to start writing plugins (applications) for FreeSWITCH that will be called from dialplan:
<action application="my_cool_application"...>
Could you please provide me some steps following which I will be able to create "helloworld" C/C++ application that will be called from dialplan?
Or some link if this is already described somewhere... I tried to google but did not find that.
Then, if I will create something useful, I will contribute it to the community with pleasure... :-)
Thank you very much!
Vitalie _______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Thanks for the advice, Steven! I would like to thank all the responders, I managed to create an application that uses core ODBC and is accessing MySQL table to get the needed information. It took less then 3 hours... Taking into consideration that I did not have any idea from the beginning, looks like the learning curve here is just perfectly optimized for the newbies... :-) FreeSWITCH really rocks! Will keep learning. Regards, Vitalie 2010/4/23 Steven Ayre <steveayre@gmail.com>
If you're looking for help on writing new applications then of course everything under src/mod/applications/*/ provide good examples.
There's also some documentation online of the APIs available to you within FreeSWITCH: http://docs.freeswitch.org/
In particular I recommend you look at the following sections Modules -> Brought To You By APR Modules -> Core Library
Core Library will tell you the APIs for interacting with sessions/channels (calls) and provide you with useful interfaces for doing may useful things like DB access, hash tables, file access etc, while APR gives you a platform independant way of doing things like like memory allocation, network access, threading etc. Using them will save you much of the work and keeps the program style nicely consistent across FreeSWITCH. Done right your module should also work on any platform FS runs on without any changes needed (unless you app depends on something that really is platform-specific such as loading a DLL file on Windows).
-Steve
On 23 April 2010 15:19, Vitalii Colosov <vetali100@gmail.com> wrote:
OK I think I found, need to use: SWITCH_ADD_APP Thank you very much!!!
2010/4/23 Vitalii Colosov <vetali100@gmail.com>
Thanks Mathieu, This really helped! I was able to get Hello World string during the module load :-) Moving to the next step, how can I define an application, let say "skel_app" inside this module? In order to be able to execute it from dialplan. I thought the following does this: SWITCH_ADD_API(api_interface, "skel", "Skel API", skel_function, "syntax"); But when I executed "skel" from dialplan, I got error: "Invalid application skel". Could you hint me please? Thank you very much! Vitalie
2010/4/23 Mathieu Rene <mrene_lists@avgs.ca>
Hi
Look at mod_skel in src/mod/applications
Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca
On 2010-04-23, at 6:43 AM, Vitalii Colosov wrote:
Hi dear group,
I would like to start writing plugins (applications) for FreeSWITCH that will be called from dialplan:
<action application="my_cool_application"...>
Could you please provide me some steps following which I will be able to create "helloworld" C/C++ application that will be called from
dialplan?
Or some link if this is already described somewhere... I tried to google but did not find that.
Then, if I will create something useful, I will contribute it to the community with pleasure... :-)
Thank you very much!
Vitalie _______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:
http://lists.freeswitch.org/mailman/options/freeswitch-dev
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
On Fri, Apr 23, 2010 at 11:54 AM, Vitalii Colosov <vetali100@gmail.com>wrote:
Thanks for the advice, Steven!
I would like to thank all the responders, I managed to create an application that uses core ODBC and is accessing MySQL table to get the needed information.
This community is awesome! Welcome to the club...
It took less then 3 hours...
Nice!
Taking into consideration that I did not have any idea from the beginning, looks like the learning curve here is just perfectly optimized for the newbies... :-)
I think we need to frame this quote. :) In reality there's no way you can build an app in 3 hours and call yourself a newbie. Still, you've probably seen that the code is self-documenting and elegant, which means you can copy code and ideas from other files and learn a lot about how everything works.
FreeSWITCH really rocks!
Agreed!
Will keep learning.
Welcome to the community! -MC
And please share your cool applications! François. On Fri, 2010-04-23 at 08:29 -0400, Mathieu Rene wrote:
Hi
Look at mod_skel in src/mod/applications
Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca
On 2010-04-23, at 6:43 AM, Vitalii Colosov wrote:
Hi dear group,
I would like to start writing plugins (applications) for FreeSWITCH that will be called from dialplan:
<action application="my_cool_application"...>
Could you please provide me some steps following which I will be able to create "helloworld" C/C++ application that will be called from dialplan?
Or some link if this is already described somewhere... I tried to google but did not find that.
Then, if I will create something useful, I will contribute it to the community with pleasure... :-)
Thank you very much!
Vitalie _______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
participants (6)
-
François Delawarde
-
Mathieu Rene
-
Michael Collins
-
Michael S Collins
-
Steven Ayre
-
Vitalii Colosov