Wiki

Clone wiki

libsipc / method-benotify

SIP-C Method BENotify

About BENotify

BN -- Best Effort NOTIFY (BENOTIFY) Extension

Session Initiation Protocol Extensions introduces a variant of the regular NOTIFYrequest that is known as Best Effort NOTIFY (BENOTIFY). The only difference between a BENOTIFY request and a NOTIFY request is that a BENOTIFY request is never responded to: the client never sends a SIP response to a BENOTIFY request, and the server ignores any response to a BENOTIFY request. The advantage of this approach is that it removes unneeded responses from the wire. The disadvantage is that information about the client request is subsequently unavailable.

Note: This extension can be enabled independently or together with the batched SUBSCRIBE mechanism. This extension is optional. An implementation MAY support it.

External links

sync user info - quotas

You will receive BN sync user info request after registration.

header

BN 333344445 SIP-C/4.0
N: SyncUserInfoV4
L: 143
I: 2
Q: 1 BN

body

<events>
    <event type="SyncUserInfo">
        <user-info>
            <quotas>
                <quota-sendsms>
                    <sendsms count="0"/>
                </quota-sendsms>
            </quotas>
        </user-info>
    </event>
</events>

sync user info - score

header

BN 333344445 SIP-C/4.0
N: SyncUserInfoV4
I: 2
Q: 4 BN
L: 123

body

<events>
    <event type="SyncUserInfo">
        <user-info>
            <score value="260" level="1" level-score="197"/>
        </user-info>
    </event>
</events>

sync user info - contact list - contact delete me

BN 333344445 SIP-C/4.0
N: SyncUserInfoV4
I: 2
Q: 10 BN
L: 188

body

<events>
    <event type="SyncUserInfo">
        <user-info>
            <contact-list version="373395854">
                <buddies>
                    <buddy action="remove" user-id="888899990" />
                </buddies>
            </contact-list>
        </user-info>
    </event>
</events>

sync user info - contact list - contact add me

update settings, 'anyone could add me as buddy without approving'

header

BN 333344445 SIP-C/4.0
N: SyncUserInfoV4
I: 2
Q: 8 BN
L: 358

body

<events>
    <event type="SyncUserInfo">
        <user-info>
            <contact-list version="373578176">
                <buddies>
                    <buddy action="remove" user-id="123456789"/>
                    <buddy action="add" user-id="123456789"
                           uri="sip:111122223@fetion.com.cn;p=6089"
                           relation-status="1" local-name="" buddy-lists=""
                           online-notify="0" permission-values=""/>
                </buddies>
            </contact-list>
        </user-info>
    </event>
</events>

system notify - abnormal behavior

SIP-C proxy server send BN system notify request after user send REGISTER request.

Example I:

header

BN 333344445 SIP-C/4.0
N: SystemNotifyV4
I: 2
L: 549
Q: 4 BN

body

<events>
    <event type="AbnormalBehavior">
        <content>
            <tips>
                <title>异常通知</title>
                <des>您的帐号存在异常使用情况。</des>
                <button>查看详情</button>
            </tips>
        </content>
    </event>
</events>

Example II:

header

BN 333344445 SIP-C/4.0
N: SystemNotifyV4
I: 2
L: 549
Q: 3 BN

body

<events>
    <event type="AbnormalBehavior">
        <content>
            <tips>
                <title>异常通知</title>
                <des>您的帐号存在异常使用情况。</des>
                <button>查看详情</button>
            </tips>
            <detail>
                <title>异常通知</title>
                <des1>飞信安全中心发现您的帐号存在以下异常:</des1>
                <htmlcontent><![CDATA[1、2011年11月02日 17:20 您的帐号在不常用电脑上有登录。
    ]]></htmlcontent>
                <des2>出现以上异常如不是本人行为,说明您的帐号存在不安全因素,建议您立即修改密码。</des2>
            </detail>
        </content>
    </event>
</events>

Example III:

header

BN 111122223 SIP-C/4.0
N: SystemNotifyV4
I: 2
L: 774
Q: 6 BN

body

<events><event type="AbnormalBehavior"><content><tips><title>异常通知</title><des>您的帐号存在异常使用情况。</des><button>查看详情</button></tips><detail><title>异常通知</title><des1>飞信安全中心发现您的帐号存在以下异常:</des1><htmlcontent><![CDATA[1、2011年11月02日 20:13 您的帐号在不常用电脑上有登录。
2、2011年11月02日 20:11 您的帐号在不常用电脑上有登录。
3、2011年11月02日 20:10 您的帐号在不常用电脑上有登录。
4、2011年11月02日 20:07 您的帐号在不常用电脑上有登录。
]]></htmlcontent><des2>出现以上异常如不是本人行为,说明您的帐号存在不安全因素,建议您立即修改密码。</des2></detail></content></event></events>

system notify - mail box changed

header

BN 111122223 SIP-C/4.0
N: SystemNotifyV4
L: 84
I: 4
Q: 6 BN

body

<events><event type="MobileMailBoxChanged"><mail unread-count="2"/></event></events>

system notify add buddy refused

contact response user's add buddy request

header

BN 333344445 SIP-C/4.0
N: SystemNotifyV4
I: 1
Q: 7 BN
L: 158

body

<events>
    <event type="AddBuddyRefused">
        <application user-id="111100000" uri="sip:55550000@fetion.com.cn;p=9900" reason="因为你是猪头"/>
    </event>
</events>

sync user info benotify also follows system notify

header

BN 333344445 SIP-C/4.0
N: SyncUserInfoV4
I: 1
Q: 6 BN
L: 423

body

<events>
    <event type="SyncUserInfo">
        <user-info>
            <contact-list version="377817318">
                <buddies>
                    <buddy action="remove" user-id="123456789"/>
                    <buddy action="add" user-id="123456789"
                           uri="sip:111122223@fetion.com.cn;p=6089"
                           relation-status="2" local-name="" buddy-lists="1"
                           online-notify="0" permission-values=""/>
                    <buddy action="update" user-id="123456789"
                           relation-status="2"/>
                </buddies>
            </contact-list>
        </user-info>
    </event>
</events>

de-registration

You will receive BN registration request after another client send method register request SIPC proxy server and get successful response.

header

BN 333344445 SIP-C/4.0
N: registration
L: 45
I: 2
Q: 8 BN

body

<events><event type="deregistered"/></events>

contact presence has changed

contact's or user's presence changed notify

header

BN 333344445 SIP-C/4.0
N: PresenceV4
I: 2
L: 166
Q: 13 BN

body

<events>
    <event type="PresenceChanged">
        <contacts>
            <c id="888899990">
                <pr di="WEBB020027090563" b="400" d="在线" dt="WEB" dc="463"></pr>
            </c>
        </contacts>
    </event>
</events>

|| XPath || desc || | /events/event/contacts/c@id | user ID |

XPath: /events/event/contacts/c/pr

|| node attribute name || desc || | di | device identification? | | b | presence basic value | | d | presence description | | dt | device type, "PC", "WEB", "J2ME", "Symbian" | | dc | _ |

sometimes, body look likes:

<events>
    <event type="PresenceChanged">
        <contacts>
            <c id="888899990">
                <p v="0" sid="111122223"
                   su="sip:111122223@fetion.com.cn;p=16107" m="" c="" cs="1"
                   s="1" l="1" svc="99" n="buffer" i="" p="116589443"
                   sms="365.0:0:0" sp="351654489" sh="1">
                    <pr di="PCCL040532375482" b="400" d="" dt="PC" dc="3f9fff">
                    </pr>
                </p>
            </c>
        </contacts>
    </event>
</events>

sometimes, body look likes:

<events>
    <event type="PresenceChanged">
        <contacts>
            <c id="123456789">
                <p v="0" sid="111122223"
                   su="sip:111122223@fetion.com.cn;p=6089" m="" c="CMCC" cs="0"
                   s="1" l="6" svc="99" n="Lee" i="" p="1644765971"
                   sms="0.0:0:0" sp="373739849" sh="0"/>
                <pr di="PCCL040651385538" b="100" d="" dt="PC"
                    dc="bf9fff"></pr>
            </c>
        </contacts>
    </event>
</events>

XPath: /events/event/contacts/c/p

|| node attribute name || desc || | v | _ | | sid | SID | | su | URI | | m | mobile No. | | c | carrier | | cs | _ | | s | s means service status ?
Value 0: means user has shutdown fetion service, 1: means normal ? | | l | score level, deprecated in iBlah | | svc | _ | | n | nickname, READONLY | | i | 'impresa', impression | | p | _ | | sms | _ | | sp | _ | | sh | _ |

|| node in XPath || desc || | /events/event/contacts/c/pr/* | _ |

User entered a conversation in dialog mode

See also: Receive Message In Dialog In Brief

User left from a conversation in dialog mode

See also: Receive Message In Dialog In Brief

receive add buddy application

header

BN 333344445 SIP-C/4.0
N: contact
I: 2
Q: 8 BN
L: 209

body

<events>
    <event type="AddBuddyApplication">
        <application uri="sip:111122223@fetion.com.cn;p=16107" 
        desc="buffer" type="0" time="2011-10-31 09:30:17" addbuddy-phrase-id="0"  user-id="888899990"/>
    </event>
</events>

XPath: /events/event/application

|| node in XPath || desc || | uri | _ | | desc | a short phrase to identify from who, max length is 20 characters | | type | _ | | time | request local timestamp | | addbuddy-phrase-id | See also: Get system configuration, XPath: "/config/hints/addbuddy-phrases/phrases" | | user-id | _ |

See also: SIPC Method Service - response add buddy application

Updated