Wiki

Clone wiki

libsipc / send-msg

SEND MESSAGE IN BRIEF

Send Message In Dialog Mode

If your contact move you into his blacklist, you still get SUCCESS/200 OK likes you in whitelist, however, your contact never show your message.

Step 1, send SERVICE + StartChat via register sock

header

S fetion.com.cn SIP-C/4.0
F: 333344445
I: 8 
Q: 1 S
N: StartChat

response

header

SIP-C/4.0 200 OK
I: 8
Q: 1 S
A: CS address="58.68.229.49:8080;58.68.229.49:443;221.176.31.10:8080;221.176.31.10:443",credential="1799089674.1467425480"

Create a new TCP connection by value of field 'A:', following uses the term dialog sock to refer to this socket.

Step 2, send REGISTER to CS (communication server?) via dialog sock

header

R fetion.com.cn SIP-C/4.0
F: 333344445
I: 8 
Q: 2 R
A: TICKS auth="1799089674.1467425480"
K: text/html-fragment
K: multiparty
K: nudge
K: share-background
K: fetion-show
K: ExModulesApp
K: FileTransferV4

response

header

SIP-C/4.0 200 OK
I: 8
Q: 2 R
XI: 88c9bd8b93d24a9ea8d65fe766ef6a03
X: 1200
K: text/plain
K: text/html-fragment
K: multiparty
K: nudge
K: share-background
K: fetion-show
K: ExModulesApp
K: FileTransferV4

Step 3. send SERVER + InviteBuddy via dialog sock

header

S fetion.com.cn SIP-C/4.0
F: 333344445
I: 8 
Q: 3 S
N: InviteBuddy
L: 87

body

<args>
    <contacts>
        <contact uri="sip:111122223@fetion.com.cn;p=16107" />
    </contacts>
</args>

response

header

SIP-C/4.0 200 OK
I: 8
Q: 3 S

Step 4. Receive OPTION request via dialog sock

"which MIME supported in this dialog"

header

O 333344445 SIP-C/4.0
I: 33
Q: 2 O
K: text/plain
K: text/html-fragment
K: multiparty
K: nudge

Step 5. Receive BN request via dialog sock

header

BN 333344445 SIP-C/4.0
I: 33
Q: 3 BN
N: Conversation
L: 178

body

<events>
    <event type="Support">text/plain;text/html-fragment;multiparty;nudge</event>
    <event type="UserEntered">
        <member uri="sip:111122223@fetion.com.cn;p=16107"/>
    </event>
</events>

Step 6. send message via dialog sock

header

M fetion.com.cn SIP-C/4.0
F: 333344445
I: 33 
Q: 4 M
XI: 8429d7b0-f2cb-42fc-8fc1-1b083235f3a1
C: text/html-fragment
K: SaveHistory
L: 56

body

<Font Face='' Color='-16777216' Size='10'>a</Font>

response

header

SIP-C/4.0 200 OK
I: 33
Q: 4 M
D: Sun, 06 Mar 2011 03:39:02 GMT
XI: 616A9D549627FD39C5BBDF8CEA1EF1A7

send a message to a contact that has shutdown fetion service, the response will be

SIP-C/4.0 404 Not Found
T: sip:711531864@fetion.com.cn;p=7089
I: 6
Q: 4 M
D: Tue, 29 Nov 2011 11:53:35 GMT
XI: 9AB9CA7F60AC085C0FD75F9843B7DF36

Send message in non-dialog mode

Send SMS

See also: SIPC Method MESSAGE - send SMS

Send message

See also: SIPC Method MESSAGE - send message

Updated