Procházet zdrojové kódy

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

Jiri Kuthan před 22 roky
rodič
revize
fcf1e6dc43
1 změnil soubory, kde provedl 85 přidání a 0 odebrání
  1. 85 0
      examples/ctd.sh

+ 85 - 0
examples/ctd.sh

@@ -0,0 +1,85 @@
+#!/bin/sh 
+
+# 
+# click-to-dial example using REFER
+#----------------------------------
+#
+# it half-way works using FIFO/uac; I tested it with
+# Cisco 7960 reaching Mitel 5055
+#
+# bugs: 
+# -----
+# - to-tag in REFER not ok -- should be gained from initial 
+#   conversation (need to take fifo processing from sc)
+# - it would be cleaner to send "hold" in initial invite
+# - in my test setup, initial ACK is for some bizzar reason
+#   not forwarded statelessly by outbound proxy
+
+#URI="sip:[email protected]"
+# address of user wishing to initiate conversation
+TARGET="sip:[email protected]"
+FIFO="/tmp/ser_fifo"
+# address of controller
+FROM="<sip:[email protected]>"
+# address of the final destination to which we want to transfer
+URI="sip:[email protected]"
+# initial CSeq and CallId
+CSEQ="1"
+CALLIDNR=`date '+%s'`$$
+
+#----------------------------------
+
+CALLID="${CALLIDNR}.fifouacctd"
+
+cat > $FIFO <<EOF
+
+
+:t_uac_dlg:qqq
+INVITE 
+$URI
+.
+From: $FROM;tag=$CALLIDNR
+To: <$URI>
+Call-ID: $CALLID
+CSeq: $CSEQ INVITE
+Contact: <sip:caller@!!>
+Content-Type: application/sdp
+.
+v=0
+o=jku2 0 0 IN IP4 213.20.128.35
+s=session
+c=IN IP4 213.20.128.35
+b=CT:1000
+t=0 0
+m=audio 54742 RTP/AVP 97 111 112 6 0
+a=rtpmap:97 red/8000
+a=rtpmap:111 SIREN/16000
+a=fmtp:111 bitrate=16000
+a=rtpmap:112 G7221/16000
+a=fmtp:112 bitrate=24000
+a=rtpmap:6 DVI4/16000
+a=rtpmap:0 PCMU/8000
+.
+EOF
+
+read -p "press any key to initiate transfer: "
+
+CSEQ=`expr $CSEQ + 1`
+
+cat > $FIFO <<EOF
+
+
+:t_uac_dlg:qqq
+REFER
+$URI
+.
+From: $FROM;tag=$CALLIDNR
+To: <$URI>
+Call-ID: $CALLID
+CSeq: $CSEQ REFER
+Contact: <sip:caller@!!>
+Referred-By: $FROM
+Refer-To: $TARGET
+.
+.
+EOF