[Freeswitch-users] Caller ID in Java

damjan at ecntelecoms.com damjan at ecntelecoms.com
Fri Jun 27 04:22:58 PDT 2008


X-ECN Telecoms-MailScanner-Information: Contact ECN Telecoms
X-ECN Telecoms-MailScanner: Found to be clean
X-ECN Telecoms-MailScanner-SpamCheck: not spam, SpamAssassin (not cached,
	score=-101.824, required 6, autolearn=not spam, AWL 0.78,
	BAYES_00 -2.60, NO_RELAYS -0.00, USER_IN_WHITELIST -100.00)
X-ECN Telecoms-MailScanner-From: damjan at ecntelecoms.com
X-Spam-Status: No

> Hi,
>
> i got two questions:
>
> 1) How can i get the caller ID in Java? In javascript this is accessible
> through session.caller_id_num.

Not sure - check whether it's some kind of channel variable in freeswitch.

> 2) Considere the following application declaration:
>
> <action application="java" data="org.delta.MyApp"/>
>
> I noticed that the class MyApp will be instantiated for each incoming
> call. Is there anyway to tell FS to reuse the same object? Or alternately
> is there a way to store an object (e.g. database connections) at the FS or
> VM level and reuse it accross different instances of MyApp?

A different URLClassLoader loads the class on each call, so there is no
sharing of classes between the different invocations. You'd have to modify
the mod_java code to reuse the same URLClassLoader, but then you would
lose the ability to hot swap a class while Freeswitch is running.

The only other way I can think of to share anything is to load it with its
own class loader and/or create a thread that holds a reference to what you
want to share, but those are real hacks...

> Thanks,
>
> Klaus L'Imbecile.
>

Bye
Damjan





More information about the FreeSWITCH-users mailing list