IRC /TOPIC command trimming issue in iOS - ios

I am using Cocoa async socket library in my iOS application to make connection with an IRC server via Tcp sockets. All the IRC commands are working perfectly except /TOPIC command.
When I send a topic command it always trim the first two characters in the response. Please check the example wireshark report below.
It works on other IRC clients (mIRC). How can I identify the root cause of the issue?

If you send your own IRC commands (most IRC clients let you easily inject arbitrary commands with /command here), you have to format it correctly, with a : before the final parameter if it contains spaces:
TOPIC #abcdereh :My name is Clement
Most IRC clients have an alias for /TOPIC that does that stuff for you.
If you are writing your own client, make sure that you handle the following cases:
/TOPIC: send TOPIC #currentchannel
/TOPIC #somechannel send TOPIC #somechannel
/TOPIC Not a channel send TOPIC #currentchannel :Not a channel
/TOPIC #somechannel New Topic send TOPIC #somechannel :New Topic

Related

How to get notification content with rabbitmq_event_exchange or something else like subscribe system topic

Each event has various properties associated with it. These are translated into AMQP 0-9-1 data encoding and inserted in the message headers. The message body is always blank.link
I use the python library paho-mqtt, and there are no headers on the on_message callback and the payload is of course blank. My question is how can I know which client/queue/exchange produce the event I receive?
If this plugin can't provide the feature that I want, is there any replacement solution exists? Such as a system topic, which can provide more details about concerned event.
Update:
Sorry for my confusing question.
Since I just want to get notification when a MQTT client changes online/offline status. Now I find the interface of MQTT Client "will_set" which meets my need.
I will remove the tag "rebbitmq".
You should be using an AMQP client like Pika. There's no need to use MQTT.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

how to sanitize mqtt message payload in server side?

I made an instant messaging app using MQTT protocol.
I want to add some extra data about messages in payload like sent time ( server time not client time ) and also provide kind of server side payload sanitizing.
Is it a good idea to add a third party client with superuser privileges between message sender and message receiver on broker's local machine to do this job ?
or is there any better idea ?
by the way I'm using EMQTT as message broker.
From a pure security view having direct peer to peer traffic (without filtering and sanitising) sounds like a dangerous idea. (At least in the Internet-of-things domain I would clearly object against it.)
Why? Because the clients are outside of your control (i.e. a hacker can re-engineer) and inject any traffic to exploit security holes on the receiving side of other clients.
So sanitising on the server side sounds like a very good idea.
I would suggest two topics: One (inbound) topic the clients use to publish messages, and another (outbound) topic used by clients to subscribe to messages. A server side component would then read the messages from inbound topic, sanitize it and publish to the outbound topic.
This de-coupeling makes it also easier to introduce MQTT payload changed: If you update the payload in a non-compatible way, introduce a new inbound topic and keep the old inbound topic too. This allows you to support old and new clients during the transition phase.

HL7 Error: MSA|AE|0000000|Field [AccessionNo] is required;

I'm using HL7Soup as my HL7 Client to add a new patient record to no avail. Can anyone help me fix an error I received? I have checked HL7 manual on the net, it didn't help as it is very unreliable.
I sent the following message using the client:
MSH|^~\&|HL7Soup|Instance1|HL7Soup|Instance2|20160928142250|1|ADT^A28|0000000|D|2.5.1|1|2|||||||2
EVN|NW|20160928154802|20160928154805|O|1|20160928154821|1
PID|1984|1984|1984|1-1984|Rey Allan|||||||||||||12345x|||||||5||||||||||||||
PV1|1984|R|||||||||||||||||0||||||||||||||||||||||||||||||00001|ACSN||
And got the following response:
MSH|^~\&|HL7Soup|Instance2|HL7Soup|Instance1|20160928163118|1|ORR^O02|0000000|D|2.5.1|1|2
MSA|AE|0000000|Field [AccessionNo] is required;
I don't know which field it's trying to refer to. I checked the manual it suggests 'Visit Number', I changed it, but still had the error. Help Pls.
Thanks in advance.
I think you try to send an ADT message to a system that is configured to receive order (ORM) messages.
The answer you get is an ORR^O02 (a reply to an order message).
The answer requests an accession number. Those are typically used in order entry not in ADT.
You did provide a visit number (PV1-19): 0
Maybe you use the wrong system or the wrong port?
To connect to a remote system I would recommend that you use a library like HAPI (http://hl7api.sourceforge.net) or something like Apache Camel (http://camel.apache.org/hl7) or Mirth Connect. There are many pitfalls in MLLP (the protocol usually used).

Cannot make outbound & inbound calls using asterisk 13 (FreePBX) and Twilio

I have had trouble configuring inbound and outbound calls using FreePBX with SIP provider TWilio.
As it stands I cannot make external calls or receive calls from Twilio.
I have monitored TCP port 5060 and can see traffic routed to my address when I engage a call using my number provided through Twilio but from the FreePBX cli I observe the following when I see incoming traffic.
[#DATE] NOTICE[18449]: res_pjsip/pjsip_distributor.c:368
log_unidentified_request: Request from '' failed for '54.252.254.64:5060' (callid: 41822dbe439f067b0ef90f596b3998d2#0.0.0.0) - No matching endpoint found
I have searched the web already for similar issues but have yet to come across anything of use. As this is early testing I have put the system on a DMZ to avoid the NAT firewall.
Note: This is my first post to stack overflow so I may not be correctly following the layout for posting, I apologize in advance. Suggestions are welcome.
Thanks
This is likely a configuration error.
Check the setup guide. But also, I found from another user with the same error that they changed the following:
pj_sip was set to port 5060 instead of chan_sip
Let me know if this helps at all!

Mqtt Brigde: Displaying MQTT messages in a browser

I am new to mqtt, so any answer is appreciated.
My objective is to display real time Mqtt messages on a html page. It seems easy but not for me.
I am not sure on how to create a bridge between my mosquitto broker(it is running on my Rasberry Pi) and HiveMQ(at the moment running on a laptop).
And how do I link my html page to display the mqtt messages ?
I don't what to use java or other complicated plugins.
thanks.
You are using HiveMQ, which has builtin support for Websockets. What you'll then want, is to use the Paho MQTT JavaScript in your Web page; that connects to the Websocket server (HiveMQ) on the TCP port you've configured there, and handles the communication between your Web app and the MQTT broker (HiveMQ).
There's a full-featured Websocket client which does that which you can use as a starting point for your own code.
I see jpmens has covered the Broker to HTML (Websockets) bit.
To bridge you should be able to do it from either the mosquitto side or the HiveMQ side.
For mosquitto you need to add a short section to your mosquitto.conf file
Assuming your HiveMQ broker is running on IP address 10.0.0.5 then something like the following is needed:
connection hiveMQ
address 10.0.0.5
topic # out
The first line just names the connection, the second gives the location of the remote broker. The third is a bit more complex, it controls what gets sent across the bride. This example sends everything (# wildcard topic match) from mosquitto to hivemq (out), but nothing will come back the other way.
Getting the topic line right can be complicated if you want to things to go in both directions. Full details can be found in the mosquitto.conf man page

Resources