﻿# XMPP

_Updated April 2020_

**xcall XMPP, opcode, status, fromid, pw, server, port, toid, msg, msgid, flags \{, timeout \{, rcvfile\}\}**

(Linux only) XMPP enables the sending of instant messages using the XMPP protocol (Extensible Message and Presence Protocol, aka Jabber) to third party instant messaging systems implementing that protocol. Compatible examples include the OpenFire messaging server and Pidgin client.

**Parameters**

_op_  ([Num](num.md))  \[in\]

Operation code:

| **Value** | **Meaning** |
|------|------|
| 1 | connect, send message, disconnect |
| 2 | connect, receive message(s), disconnect |
| 3 | connect, send message, receive message(s), disconnect |




_status_  (signed [Num](num.md))  \[out\]

Return code:

| **Value** | **Meaning** |
|------|------|
| 0 :  | ok (for op 1) |
| \>0 :  | \# messages received (ops 2 and 3) |
| \-1 :  | routine abort during startup |
| \-2 :  | error opening the xmpp.log file (when debug flags set) |
| \-3 :  | failure to create a connection context |
| \-4 :  | error during configuration of connection options |
| \-5 :  | failure to connect |
| \-6 :  | failure to disconnect |




_fromid_  ([String](string.md))  \[in\] 

JID (Jabber ID) of sender, using syntax name@domain. Must be recognized by server for authentication.

_pw  _([String](string.md))  \[in\]

Authentication password for sender. Plain text, or may be optionally encrypted using MX\_PWCRYPT. Modes 1-3 are supported; in the case of mode 3, use the FROMID as the encryption seed and omit the key parameter, to use the internal A-Shell generated key. 

_server  _([String](string.md))  \[in\]

Hostname or IP address of messaging server

_port_  ([Num](num.md))  \[in\] 

Port to connect to server on (0 = default: 5222)

_toid_  ([String](string.md))  \[in\]

JID of the receipient (individual or group), e.g. name@domain

_msg _ ([String](string.md))  \[in\]

Text of message. There is no inherent limit to the length; dynamic strings (S,0) supported.

_msgid  _([String](string.md))  \[in\]

Short string to identify message, preferably unique. Mainly of use for tracking messages within the server.

_flags  _([Num](num.md))  \[in\]

Option flags (zero or more of the following):

| **Value** | **** | **Meaning** |
|------|------|------|
| AXMPPF\_LOG | \&h0001 | output traces to ashmpp.log |
| AXMPPF\_TRUST\_TLS | \&h0002 | trust all TLS certs |
| AXMPPF\_DISABLE\_TLS | \&h0004 | disable TLS; use insecure connect |
| AXMPPF\_DEBUG | \&h0008 | low level tracing to xmpp.log |




_timeout_  ([Num](num.md))  \[in\]

Number of seconds to wait for messages to be received.

_rcvfile  _([String](string.md))  \[in\]

File specification (A-Shell or native) of file to receive messages in. If not specified, default is ashxmpp.xml.

**History**

2020 April, A-Shell 6.5.1678:  Added _opcode_ 2 and 3, revised status meanings, added new parameters _timeout_ and _rcvfile_. Requires the libashxmpp.so.1 library to be upgraded to version 1.0.102+.

2020 February, A-Shell 6.5.1676:  Routine added to A-Shell.