How can i confige the asterisk in spark, waiting online!

in the “Asterisk-IM Plugin Readme” says:

Client API

The client API first requires that the Asterisk-IM server plugin is installed. To initialize the client do the following:

XMPPConnection conn = new XMPPConnection(“”, “user”, “password”);

PhoneClient client = new PhoneClient(conn);

Note that the XMPPConnection passed in must be authenticated. If an unauthenticated connection is passed in an exception will be thrown.

To listen for events, register an event listener with PhoneClient.addEventListener(…) method:

PhoneClient client = new PhoneClient(conn);

client.addEventListener(new BasePhoneEventListener() {

// Override the handleRing event to see when we are receiving a call

public void handleRing(RingEvent event) {"receiving a call from " + event.getCallerID());



so where should i add these codes to? help me?

in wihch files of spark?


Spark has the Asterisk code included, so you just need to start it. If it detects a Wildfire server with an Asterisk plugin it will activate the relevant code.


thanks very much!