在使用sipp脚本对sipserver和AS进行相关业务测试时,转接业务是较为复杂的业务流程类型,尤其是其中UE2涉及到两方呼叫流程的交互作用,对于构造sipp脚本而言更加繁琐。如下是我在日常工作中调试通过的sipp脚本内容,能够较好地模拟出盲转业务流程,可供大家参考。脚本未经过梳理,里面存在较多调试过程所涉及到的变量,请注意。
1.盲转业务流程图
2.UE1的脚本内容:
INVITE sip:[field3]@[remote_ip] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: "[field2]" ;tag=[call_number]zhg8
To: "[field3]"
Call-ID: [call_id]
CSeq: 1 INVITE
Contact:
User-Agent: SIPp client mode version [sipp_version]
Allow: INVITE,PRACK,ACK,UPDATE,CANCEL,BYE,OPTIONS,INFO,SUBSCRIBE,REFER,NOTIFY
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: [len]
v=0
o=SIPp [pid][call_number] 8[pid][call_number]8 IN IP[local_ip_type] [local_ip]
s=SIPp Normal Call Test
t=0 0
m=audio [media_port] RTP/AVP 0 101
c=IN IP[media_ip_type] [media_ip]
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=sendrecv
]]>
ACK sip:[field3]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: "[field2]" ;tag=[call_number]zhg8
To: "[field3]"[peer_tag_param]
Call-ID: [call_id]
CSeq: 1 ACK
Contact:
Max-Forwards: 70
Subject: normal call scenario by wangwei
user-agent: SIPp client mode version [sipp_version]
Content-Length: 0
]]>
SIP/2.0 200 OK
[last_From: ]
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Content-Length: 0
Supported: 100rel,replaces,timer
Contact:
Allow:REGISTER,INVITE,ACK,PRACK,CANCEL,OPTIONS,BYE,INFO,UPDATE,REFER,NOTIFY,MESSAGE
Content-Type: application/sdp
Content-Length: [len]
v=0
o=SIPp [pid][call_number] 8[pid][call_number]8 IN IP[local_ip_type] [local_ip]
s=SIPp Normal Call Test
t=0 0
m=audio [media_port] RTP/AVP 0
c=IN IP[media_ip_type] [media_ip]
a=rtpmap:0 PCMU/8000
a=ptime:20
]]>
SIP/2.0 200 OK
[last_From: ]
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Content-Length: 0
Supported: 100rel,replaces,timer
Contact:
Allow:REGISTER,INVITE,ACK,PRACK,CANCEL,OPTIONS,BYE,INFO,UPDATE,REFER,NOTIFY,MESSAGE
Content-Type: application/sdp
Content-Length: [len]
v=0
o=SIPp [pid][call_number] 8[pid][call_number]8 IN IP[local_ip_type] [local_ip]
s=SIPp Normal Call Test
t=0 0
m=audio [media_port] RTP/AVP 0
c=IN IP[media_ip_type] [media_ip]
a=rtpmap:0 PCMU/8000
a=ptime:20
]]>
BYE sip:[field3]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: "[field2]" ;tag=[call_number]zhg8
To: "[field3]"[peer_tag_param]
Call-ID: [call_id]
CSeq: 2 BYE
Max-Forwards: 70
Subject: normal call scenario by wangwei
Content-Length: 0
]]>
3.UE2的脚本内容:
search_in="hdr"
header="From: "
check_it="true"
assign_to="junk,ue1,ue1_ip,ue1_tag" />
search_in="hdr"
header="To: "
check_it="true"
assign_to="junk,callee" />
SIP/2.0 100 Trying
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Contact:
Content-Length: 0
]]>
SIP/2.0 180 Ringing
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact:
Content-Length: 0
]]>
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]zhg8
[last_Call-ID:]
[last_CSeq:]
Contact:
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=ptime: 20
]]>
INVITE sip:[$ue1]@[$ue1_ip] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: ;tag=[call_number]zhg8
To: ;[$ue1_tag]
Call-ID: [call_id]
CSeq: 1 INVITE
Contact:
User-Agent: SIPp client mode version [sipp_version]
Allow: INVITE,PRACK,ACK,UPDATE,CANCEL,BYE,OPTIONS,INFO,SUBSCRIBE,REFER,NOTIFY
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: [len]
v=0
o=SIPp [pid][call_number] 8[pid][call_number]8 IN IP[local_ip_type] [local_ip]
s=SIPp Normal Call Test
t=0 0
m=audio [media_port] RTP/AVP 8
c=IN IP[media_ip_type] [media_ip]
a=rtpmap:8 PCMA/8000
a=ptime:20
a=sendonly
]]>
ACK sip:[$ue1]@[$ue1_ip] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
[last_From:]
[last_To:]
[last_Call-ID:]
CSeq: 1 ACK
Contact:
Max-Forwards: 70
Subject: normal call scenario by wangwei
user-agent: SIPp client mode version [sipp_version]
Content-Length: 0
]]>
REFER sip:[$ue1]@[$ue1_ip] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
[last_From:]
[last_To:]
[last_Call-ID:]
CSeq: 2 REFER
Contact:
Refer-To:
Referred-By:
Max-Forwards: 70
Subject: normal call scenario by wangwei
Content-Length: 0
]]>
search_in="hdr"
header="From: "
check_it="true"
assign_to="header_from" />
search_in="hdr"
header="To: "
check_it="true"
assign_to="header_to" />
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Content-Length: 0
]]>
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Content-Length: 0
]]>
4.UE3的脚本内容:
search_in="hdr"
header="To: "
check_it="true"
assign_to="junk,callee" />
search_in="hdr"
header="CSeq:"
check_it="true"
assign_to="invite_cseq" />
SIP/2.0 100 Trying
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
X-Test-Info: line="[$line]" var_tmp="[$tmp]" result1="[$result1]" result2="[$result2]" result3="[$result3]" result4="[$result4]"
Content-Length: 0
]]>
SIP/2.0 180 Ringing
[last_Via:]
[last_From:]
[last_To:];tag=zgh8.[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact:
Content-Length: 0
]]>
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=zgh8.[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact:
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=ptime: 20
]]>
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Contact:
Content-Length: 0
]]>
SIP/2.0 486 Busy Here
[last_Via:]
[last_From:]
[last_To];tag=ztesip20DWpDH4V9*1-1-20481*chci.1[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact:
Content-Length: 0
]]>
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Contact:
Content-Length: 0
]]>
SIP/2.0 487 Request Terminated
[last_Via:]
[last_From:]
[last_To];tag=ztesip20DWpDH4V9*1-1-20481*chci.1[call_number]
[last_Call-ID:]
CSeq: [$invite_cseq]
Contact:
Content-Length: 0
]]>