SIP 路由

SIP

##SIP 路由
路由有关的SIP消息头的简单小结

<scenario name="Basic Sipstone UAS">
  <recv request="SUBSCRIBE" rrs="true">
    <action>
      <ereg regexp="sip[!-=?-}]*" search_in="hdr" header="Contact: " assign_to="12"/>
      <ereg regexp=".*" search_in="hdr" header="From: " assign_to="22"/>
      <ereg regexp=".*" search_in="hdr" header="To: " assign_to="23"/>
      <ereg regexp=".*" search_in="hdr" header="Record-Route: " assign_to="13"/>
    </action>
  </recv>

  <send>
    <![CDATA[
      SIP/2.0 200 OK
      [last_Via:]
      [last_From:]
      [last_To:];tag=cscf-[call_number]
      [last_Call-ID:]
      [last_CSeq:]
      Expires: 3600
      Contact: <sip:[local_ip]:[local_port]>
      P-Charging-Vector: icid-value=255.307.1073741823-1362455302.18;term-ioi=12345
      Content-Length:0
    ]]>
  </send>
  <send>
    <![CDATA[
      NOTIFY [$12] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]   
      Max-Forwards: 70
      Route: [$13]                                                                       
      From: [$23];tag=cscf-[call_number]                                                             
      To: [$22] 
      [last_Call-ID:]
      CSeq: 1001 NOTIFY
      Event: reg
      Subscription-State: active;expires=3600
      Contact: <sip:[local_ip]:[local_port]>
      Content-Type: application/reginfo+xml
      Content-Length: [len]
      Content-Disposition: session

      <?xml version="1.0" encoding="UTF-8"?>
      <reginfo xmlns="urn:ietf:params:xml:ns:reginfo" xmlns:gr="urn:ietf:params:xml:ns:gruuinfo" version="0" state="full">
       <registration aor="sip:12345678@abc.com" id="1232409" state="active">
         <contact state="active" event="registered" expires="3600" id="602210">
           <uri>sip:12345678@abc.com</uri>      
         </contact>   
       </registration> 
      </reginfo>
    ]]>
  </send>

Recorde-Route:
如果SUBSCRIBE里面带了Record-Route头,sipp需要保存下来,给后续的NOTIFY使用,如本例中的

 <ereg regexp=".*" search_in="hdr" header="Record-Route: " assign_to="13"/>

后续的NOTIFY里面用Route头把存下来的Record-Route带上,不然的话可能会给NOTIFY回复
SIP/2.0 481 Call Leg/Transaction Does Not Exist

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值