Browse code

initial version of FIFO/uac-based click-to-dial based on REFER

Jiri Kuthan authored on 29/01/2003 23:34:33
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,85 @@
1
+#!/bin/sh 
2
+
3
+# 
4
+# click-to-dial example using REFER
5
+#----------------------------------
6
+#
7
+# it half-way works using FIFO/uac; I tested it with
8
+# Cisco 7960 reaching Mitel 5055
9
+#
10
+# bugs: 
11
+# -----
12
+# - to-tag in REFER not ok -- should be gained from initial 
13
+#   conversation (need to take fifo processing from sc)
14
+# - it would be cleaner to send "hold" in initial invite
15
+# - in my test setup, initial ACK is for some bizzar reason
16
+#   not forwarded statelessly by outbound proxy
17
+
18
+#URI="sip:113311@192.168.2.16"
19
+# address of user wishing to initiate conversation
20
+TARGET="sip:23@192.168.2.16"
21
+FIFO="/tmp/ser_fifo"
22
+# address of controller
23
+FROM="<sip:caller@foo.bar>"
24
+# address of the final destination to which we want to transfer
25
+URI="sip:113311@192.168.2.16"
26
+# initial CSeq and CallId
27
+CSEQ="1"
28
+CALLIDNR=`date '+%s'`$$
29
+
30
+#----------------------------------
31
+
32
+CALLID="${CALLIDNR}.fifouacctd"
33
+
34
+cat > $FIFO <<EOF
35
+
36
+
37
+:t_uac_dlg:qqq
38
+INVITE 
39
+$URI
40
+.
41
+From: $FROM;tag=$CALLIDNR
42
+To: <$URI>
43
+Call-ID: $CALLID
44
+CSeq: $CSEQ INVITE
45
+Contact: <sip:caller@!!>
46
+Content-Type: application/sdp
47
+.
48
+v=0
49
+o=jku2 0 0 IN IP4 213.20.128.35
50
+s=session
51
+c=IN IP4 213.20.128.35
52
+b=CT:1000
53
+t=0 0
54
+m=audio 54742 RTP/AVP 97 111 112 6 0
55
+a=rtpmap:97 red/8000
56
+a=rtpmap:111 SIREN/16000
57
+a=fmtp:111 bitrate=16000
58
+a=rtpmap:112 G7221/16000
59
+a=fmtp:112 bitrate=24000
60
+a=rtpmap:6 DVI4/16000
61
+a=rtpmap:0 PCMU/8000
62
+.
63
+EOF
64
+
65
+read -p "press any key to initiate transfer: "
66
+
67
+CSEQ=`expr $CSEQ + 1`
68
+
69
+cat > $FIFO <<EOF
70
+
71
+
72
+:t_uac_dlg:qqq
73
+REFER
74
+$URI
75
+.
76
+From: $FROM;tag=$CALLIDNR
77
+To: <$URI>
78
+Call-ID: $CALLID
79
+CSeq: $CSEQ REFER
80
+Contact: <sip:caller@!!>
81
+Referred-By: $FROM
82
+Refer-To: $TARGET
83
+.
84
+.
85
+EOF