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.

Blockquote
DomainBareJid serviceName = JidCreate.domainBareFrom(“1054.com”);
EntityBareJid user = JidCreate.entityBareFrom(“manu@1054.com”);
ModularXmppClientToServerConnectionConfiguration.Builder builder = ModularXmppClientToServerConnectionConfiguration.builder();
builder.removeAllModules().setXmppDomain(serviceName)
.setSendPresence(true)
.setHost(“1054.com”)
.setSecurityMode(SecurityMode.disabled)
;
builder.setXmppAddressAndPassword(user, “password”);
//handshakeHttps();
// 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);
builder.addModule(websocketBuilder.build());
ModularXmppClientToServerConnectionConfiguration config = builder.build();
ModularXmppClientToServerConnection connection = new ModularXmppClientToServerConnection(config);
connection.setParsingExceptionCallback(new ExceptionThrowingCallbackWithHint());
connection.addConnectionListener(new ConnectionListenerTest());
connection.connect();
connection.login();
//fastpath connection code
StanzaFilter typeFilter = new StanzaTypeFilter(Message.class);
connection.addAsyncStanzaListener(new StanzaListener() {

        @Override
        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);

Blockquote
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);
        field.setValue(value);
        form.addField(field.build());}

Blockquote
workgrp.addInvitationListener(new WorkgroupInvitationListener() {
@Override
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);
muc.join(Resourcepart.from(“slave”));
//Able to send message to spark
muc.sendMessage(“Hi Everyone!!!”);
} catch ( XmppStringprepException |InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NotConnectedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NotAMucServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoResponseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XMPPErrorException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
workgrp.joinQueue(form.build(),user);

please help