powered by Jive Software

Using Fastpath web chat text in smack java code

Hi Team

I am able to connect java smack client with fastpath workgroup (able to send and receive messages from java client to spark agent client ). Below is my program structure.
customer (Smack Java) --> Openfire FastpathWorkgroup --> agent (Spark)

I want to use Fastpath web chat text so that i can give proper message to customers.
for example : Chat Room Greeting, Agent Transfer Message etc.
but i am not able to get these messages in smack java program.

please help how can i use Fastpath web chat text settings.

I’d assume that this is more of a Fastpath support request rather than suited for the Smack category.
Smack is an XMPP client library, so I’d argue that if Fastpath is speaking XMPP, you just have to configure Fastpath correctly.

Thanks Paul for your quick reply.

below is my code, i am able to send and receive message from my java client but not receiving web chat text for greetings and agent transfer.

DomainBareJid serviceName = JidCreate.domainBareFrom(“1054.com”);
EntityBareJid user = JidCreate.entityBareFrom(“manu@1054.com”);
ModularXmppClientToServerConnectionConfiguration.Builder builder = ModularXmppClientToServerConnectionConfiguration.builder();
builder.setXmppAddressAndPassword(user, “password”);
// Set a fallback uri into websocket transport descriptor and add this descriptor into connection builder.
XmppWebSocketTransportModuleDescriptor.Builder websocketBuilder = XmppWebSocketTransportModuleDescriptor.getBuilder(builder);
websocketBuilder.explicitlySetWebSocketEndpointAndDiscovery(new URI(“ws://1054.com:7070/ws/”), false);
ModularXmppClientToServerConnectionConfiguration config = builder.build();
ModularXmppClientToServerConnection connection = new ModularXmppClientToServerConnection(config);
connection.setParsingExceptionCallback(new ExceptionThrowingCallbackWithHint());
connection.addConnectionListener(new ConnectionListenerTest());
//fastpath connection code
StanzaFilter typeFilter = new StanzaTypeFilter(Message.class);
connection.addAsyncStanzaListener(new StanzaListener() {

        public void processStanza(Stanza packet) {
        	if (packet instanceof Message) {
        			Message msg = (Message)packet;
					//Able to get message here from spark agent
					System.out.println("msg.getBody11 "+msg.getBody());
        }}, typeFilter);

System.out.println("fastpath connection code ");
EntityBareJid fastpathWorkgrp = JidCreate.entityBareFrom(“demo@workgroup.1054.com”);
Workgroup workgrp = new Workgroup(fastpathWorkgrp,connection);
System.out.println("isAvailable "+workgrp.isAvailable());
Map<String, String> metadata = new HashMap<String, String>();
metadata.put(“username”, “slave”);
metadata.put(“email”, “master@email.com”);
metadata.put(“question”, “master question”);
metadata.put(“userID”, “manu@1054.com”);
DataForm.Builder form = DataForm.builder();
Iterator iter = metadata.keySet().iterator();
while (iter.hasNext()) {
String name = iter.next();
String value = metadata.get(name).toString();

        TextSingleFormField.Builder field = FormField.builder(name);

workgrp.addInvitationListener(new WorkgroupInvitationListener() {
public void invitationReceived(WorkgroupInvitation arg0) {
// TODO Auto-generated method stub
EntityBareJid mucJid;
try {
mucJid = JidCreate.entityBareFrom(arg0.getGroupChatName());
MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
MultiUserChat muc = manager.getMultiUserChat(mucJid);
//Able to send message to spark
muc.sendMessage(“Hi Everyone!!!”);
} catch ( XmppStringprepException |InterruptedException e) {
// TODO Auto-generated catch block
} catch (NotConnectedException e) {
// TODO Auto-generated catch block
} catch (NotAMucServiceException e) {
// TODO Auto-generated catch block
} catch (NoResponseException e) {
// TODO Auto-generated catch block
} catch (XMPPErrorException e) {
// TODO Auto-generated catch block

please help

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.