Wiki

Clone wiki

libsipc / method-message

SIP-C Method Message

receive system message

header

M 333344445 SIP-C/4.0
F: sip:10000@fetion.com.cn;p=100
I: -2
Q: 3 M
C: text/xml
N: system-message
D: Sun, 16 Oct 2011 15:17:15 GMT
L: 365

body

<msg id="2825" type="0" show-once="0">
    <validity begin="2010-12-25 16:00:00.000" end="2015-10-26 15:59:59.000" /> 
    <content type="text/plain">尊敬的用户,您的手机已停机,这将影响您使用飞信的部分功能。为了您的正常使用,请尽快充值。</content>
    <url style="auto:0;">http://space.fetion.com.cn/redirection/count/203</url>
</msg>

receive contact's offline message in non-dialog mode I

plain text message

header

M 333344445 SIP-C/4.0
F: sip:111122223@fetion.com.cn;p=6089
Q: 7 M
I: -6
L: 5
D: Sun, 16 Oct 2011 16:49:59 GMT
XI: 64EAC0D4F963D3F9C0D1E3A4686488B0

body

hello

You should response a ACK

header

SIP-C/4.0 200 OK
I: -6
Q: 7 M
F: sip:123456789@fetion.com.cn;p=16108

|| field name || desc || | I | call ID | | Q | CSeq | | F | user's URI |

receive contact's offline message in non-dialog mode II

rich text message

header

M 333344445 SIP-C/4.0
I: -9
Q: 8 M
F: sip:111122223@fetion.com.cn;p=16107
K: SaveHistory
K: NewEmotion
C: text/html-fragment
L: 141
D: Sun, 30 Oct 2011 17:12:32 GMT
XI: B6BC1038F1E92007CE12E74518F7E738

body

<Font Face='宋体' Color='-16777216' Size='10'>
    <OBJECT TYPE="CE" NAME="失望" ID="FA96FB330E944774C12EC44C888500B7">/失望</OBJECT>
</Font>

|| field name || desc || | K | NewEmotion (飞信表情?) |

You should responses a ACK

SIP-C/4.0 200 OK
I: -9
Q: 8 M
F: sip:123456789@fetion.com.cn;p=16108

|| field name || desc || | I | call ID | | Q | CSeq | | F | user's URI |

receive message from ChatFriend

header

M 333344445 SIP-C/4.0
F: sip:111122223@fetion.com.cn;p=6089
I: -10
Q: 11 M
K: SaveHistory
K: NewEmotion
C: text/plain
L: 2
D: Wed, 21 Dec 2011 13:38:21 GMT
XI: 334A2D3932E81A878DBC530D290C1734
AL: buddy

body

hi

send message to offline contact in non-dialog mode

header

M fetion.com.cn SIP-C/4.0
F: 111122223
I: 96 
Q: 4 M
T: sip:555566660@fetion.com.cn;p=7134
XI: 9de80442-e65e-4440-b899-70afbc4f55d4
K: SaveHistory
K: NewEmotion
N: ForceOfflineMsg
C: text/plain
L: 7

body

hello ~

response

header

SIP-C/4.0 200 OK
T: sip:555566660@fetion.com.cn;p=7134
I: 96
Q: 4 M
D: Fri, 04 Nov 2011 09:19:09 GMT
XI: 62B5B6B9F6B0D4F2F07E5C7504D482B1

send SMS to offline contact's mobile

header

M fetion.com.cn SIP-C/4.0
F: 111122223
I: 96 
Q: 1 M
T: sip:555566660@fetion.com.cn;p=7134
XI: 758d6cce-3089-4892-a117-e8097f78413f
K: SaveHistory
K: NewEmotion
N: CatMsg
C: text/plain
L: 5

body

hello

successfully response

header

SIP-C/4.0 280 Send SMS OK
T: sip:555566660@fetion.com.cn;p=7134
I: 96
Q: 1 M
L: 114
D: Fri, 04 Nov 2011 08:59:12 GMT
XI: 20D6B9C5D3E28B64300090C3769DD1C9

body

<results>
    <quota-frequency>
        <frequency name="send-sms" day-count="1" month-count="5"/>
    </quota-frequency>
</results>

failed response

Server will response 400 Bad Requst if you specify a invalid mobile No.

header

SIP-C/4.0 400 Bad Request
T: tel:13812138111
I: 2
Q: 1 M
L: 38
D: Thu, 08 Dec 2011 13:24:29 GMT
XI: 7E4C2F59F06A59C3E86BB75732C80979

body

CompactUri Parse Failed:tel:13812138111

If user has not bindings mobile No., server will also responses 200 OK,
target contact will receives the offline message at next time he sign in.

header

SIP-C/4.0 200 OK
T: tel:15099988888
I: 2
Q: 1 M
D: Thu, 08 Dec 2011 13:05:43 GMT
XI: F5DFF9FACF5B25E9E3845FEE495F6CA2

If you send SMS to 13800138000, server will also response 200 OK...

header

SIP-C/4.0 200 OK
T: tel:13800138000
I: 2
Q: 1 M
D: Thu, 08 Dec 2011 13:23:41 GMT
XI: 9DD30B118B7ECA28CC4B5AFC9DF91C4D

send SMS to my mobile

SID 55550000 send SMS to hers phone

header

M fetion.com.cn SIP-C/4.0
F: 55550000
I: 3
L: 12
N: SendCatSMS
Q: 1 M
T: sip:55550000@fetion.com.cn;p=9900

body

测试中文

resposne header

SIP-C/4.0 280 Send SMS OK
T: sip:55550000@fetion.com.cn;p=9900
I: 3
Q: 1 M
L: 114
D: Wed, 07 Dec 2011 05:22:57 GMT
XI: 0FD510CB4827EE23D9B6449551DC94F7

body

<results>
    <quota-frequency>
        <frequency name="send-sms" day-count="2" month-count="4"/>
    </quota-frequency>
</results>

Send SMS to myself via SIPC event CatMsg, is there bug ?

header

M fetion.com.cn SIP-C/4.0
C: text/plain
XI: 328b225e-3f8a-44ac-b69f-1781db33b570
F: 55550000
I: 3
K: SaveHistory
K: NewEmotion
L: 5
N: CatMsg
Q: 1 M
T: sip:55550000@fetion.com.cn;p=9900

body

dump~

receive following on desktop

header

M 55550000 SIP-C/4.0
F: tel:15099988888
N: SMS2Fetion
I: -44
Q: 45 M
D: Wed, 07 Dec 2011 05:00:11 GMT
L: 5

body

dump~

header

SIP-C/4.0 200 OK
I: -44
Q: 45 M
F: tel:15099988888

Updated