[Freeswitch-dev] How do I issue a "load mod_sofia" from Erlang?
I need to automatically load mod_sofia after our Erlang synchronization process is complete. I tried the following, but it doesn't seem to work (no debug output and when I go into fs_cli I can still do a "load mod_sofia" without getting the "already loaded" errors.) freeswitch:bgapi( State#state.node, load, [mod_sofia] ) -- Mark Sobkow Senior Developer MarkeTel Multi-Line Dialing Systems LTD. 428 Victoria Ave Regina, SK S4N-0P6 Toll-Free: 800-289-8616-X533 Local: 306-359-6893-X533 Fax: 306-359-6879 Email: m.sobkow@marketelsystems.com Web: http://www.marketelsystems.com
Mark Sobkow wrote:
I need to automatically load mod_sofia after our Erlang synchronization process is complete. I tried the following, but it doesn't seem to work (no debug output and when I go into fs_cli I can still do a "load mod_sofia" without getting the "already loaded" errors.)
freeswitch:bgapi( State#state.node, load, [mod_sofia] )
Turns out that the second argument is an array, but a char array, as in: freeswitch:bgapi( State#state.node, load, "mod_sofia" ) Works beauty, eh? -- Mark Sobkow Senior Developer MarkeTel Multi-Line Dialing Systems LTD. 428 Victoria Ave Regina, SK S4N-0P6 Toll-Free: 800-289-8616-X533 Local: 306-359-6893-X533 Fax: 306-359-6879 Email: m.sobkow@marketelsystems.com Web: http://www.marketelsystems.com
On Thu, Nov 19, 2009 at 10:31:21AM -0600, Mark Sobkow wrote:
I need to automatically load mod_sofia after our Erlang synchronization process is complete. I tried the following, but it doesn't seem to work (no debug output and when I go into fs_cli I can still do a "load mod_sofia" without getting the "already loaded" errors.)
freeswitch:bgapi( State#state.node, load, [mod_sofia] )
Try something like this: (cpx@DEV-CS1)24> freeswitch:api('freeswitch@DEV-CS1', unload, "mod_sofia"). {ok,"+OK\n"} (cpx@DEV-CS1)25> flush(). ok (cpx@DEV-CS1)26> freeswitch:api('freeswitch@DEV-CS1', load, "mod_sofia"). timeout (cpx@DEV-CS1)27> flush(). Shell got {ok,"+OK\n"} ok (cpx@DEV-CS1)28> I'm sorry that the module is a little schizophrenic about commmands as atoms and arguments as strings. Andrew
participants (2)
-
Andrew Thompson
-
Mark Sobkow