summaryrefslogtreecommitdiffstats
path: root/tinyDEMO/sample.sn
blob: 1c494bf2836f6d1a92527ea4b308b4871afc6e63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
## For more information about scenarios, please refer to the Programmer's Guide

# user's parameters (like ANSI-C #define)
%%domain ericsson.com
%%user mamadou
%%pwd mamadou
%%proxy_ip 192.168.0.13 # IP address or FQDN
%%proxy_port 5081
%%proxy_trans tcp # udp, tcp, tls or sctp
%%expires 100 # expires used by all dialogs
%%sleep-sec 1.0 # number of seconds to wait before sending next sip message

%%reg-sid
%%sub-reg-sid
%%sub-pres-sid

# Configure the stack
# Realm, IMPI and IMPU are mandatory
++cst --realm $$(domain) --impi $$(user)@$$(domain) --impu sip:$$(user)@$$(domain) --pwd $$(pwd) \
	--pcscf-ip $$(proxy_ip) --pcscf-port $$(proxy_port) --pcscf-trans $$(proxy_trans)\
	--header Privacy=header;id --header Allow=INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER \
	--header P-Access-Network-Info=ADSL;utran-cell-id-3gpp=00000000 \
	--header User-Agent=IM-client/OMA1.0 doubango/v1.0.0 # last should not have backslash
	
# Run the engine
++r

# REGISTER
++reg --xp $$(expires) >>(reg-sid) \
	--header Myheader-name=Myheader-value \

# sleep
++sleep --sec $$(sleep-sec)

# subscribe to reg event package
++sub --to sip:$$(user)@$$(domain) --xp $$(expires) --header Event=reg --header Accept=application/reginfo+xml \
	--header Allow-Events=refer, presence, presence.winfo, xcap-diff, conference >>(sub-reg-sid)

#subscribe to presence event package (alice)
++sub --to sip:alice@$$(domain) --xp $$(expires) --header Event=presence --header Supported=eventlist\
	--header Accept=multipart/related, application/rlmi+xml, application/pidf+xml, application/rpid+xml, application/xcap-diff+xml, message/external-body \
	--header Allow-Events=refer, presence, presence.winfo, xcap-diff, conference >>(sub-pres-sid)

# sleep
++sleep --sec $$(sleep-sec)

# unsunscribe (reg and pres)
++hu --sid $$(sub-reg-sid)
++hu --sid $$(sub-pres-sid)

# sleep
++sleep --sec $$(sleep-sec)

# unregister
++hu --sid $$(reg-sid)

# sleep
++sleep --sec $$(sleep-sec)

# Exit the application
++e
OpenPOWER on IntegriCloud