<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">so your app names are lnp_getprefix lbs_getpublicphone cps_verifyphone and lookup_service_destination<div><br></div><div>Mike</div><div><br><div><div>On Oct 3, 2009, at 7:45 PM, Tihomir Culjaga wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">this is how i do it:<br><br><br>SWITCH_MODULE_LOAD_FUNCTION(mod_optimaload)<br>{<br> switch_application_interface_t *app_interface;<br><br> *module_interface = switch_loadable_module_create_module_interface(pool,<br>
modname);<br> SWITCH_ADD_APP(app_interface, "lnp_getprefix", NULL, NULL, lnp_getprefix_function, "in <recipient_data>, out <varname>", SAF_SUPPORT_NOMEDIA);<br> SWITCH_ADD_APP(app_interface, "lbs_getpublicphone", NULL, NULL, lbs_getpublicphone_function, "in <inviter_data>, in <recipient_data>, out <varname>", SAF_SUPPORT_NOMEDIA);<br>
SWITCH_ADD_APP(app_interface, "cps_verifyphone", NULL, NULL, cps_verifyphone_function, "in <recipient_data>, out <varname>", SAF_SUPPORT_NOMEDIA);<br> SWITCH_ADD_APP(app_interface, "lookup_service_destination", NULL, NULL, lookup_service_destination_params_function, "in <inviter_phone>, in <inviter_prefix>, in <recipient_phone>, in <recipient_prefix>, in <redirect_gw_address>, out <contacts>, out <radius_auth_result>", SAF_SUPPORT_NOMEDIA);<br>
<br><br> config_optima();<br> config_otidka();<br><br> unit_tests();<br><br> switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE,<br> "mod optima services is loaded.\n");<br>
<br> return SWITCH_STATUS_SUCCESS;<br>}<br><br><br><br><br>later in the DP you just do this:<br><br> <extension name="LNP"><br> <condition field="destination_number" expression="(^300000)(.*)"><br>
<action application="lnp_getprefix" data="in $2, out reroutingalias"/><br> <action application="redirect" data="sip:${<a href="http://reroutingalias}@10.4.13.11:5060">reroutingalias}@10.4.13.11:5060</a>"/><br>
</condition><br> </extension><br><br><br><br>T.<br><br><br><div class="gmail_quote">On Sat, Oct 3, 2009 at 5:56 PM, Michael Jerris <span dir="ltr"><<a href="mailto:mike@jerris.com">mike@jerris.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-left: 1ex; position: static; z-index: auto; "><div style="word-wrap: break-word;">You are wanting to execute a dialplan application. Take a look at mod_skel, or a simple module in src/mod/applications such as mod_rss for an example of how to write the code. In your module you set the name of the application you are registering and then you use that name in the dialplan.<div>
<br></div><div>Mike</div><div class="im"><div><br><div><br><div><div>On Oct 3, 2009, at 11:45 AM, Francisco Scaramanga wrote:</div><br><blockquote type="cite"><span style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="font-size: 10pt; font-family: Verdana;">
I want to create my own freeswitch module which should simply answer a call and write the audiostream into a file.<span> </span><br>Here is the dialplan:<br> <br> <extension name="my new module"><br> <condition field="destination_number" expression="^54321$"><br>
<action application="mod_myModul" data=""/><br> </condition><br> </extension><span> </span><br> <br> The question is how the dialplan entry (application="mod_myModule") gets associated with mod_myModul so that the dialplan actually executes mod_myModul? I need to understand the mechanism in general but I can't find useful documentation for that.<span> </span><br>
</div></span></blockquote></div></div></div></div></div></blockquote></div></blockquote></div><br></div></body></html>