This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 31st, 2011  |  syntax: None  |  size: 1.37 KB  |  views: 104  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. (def call-test '(sip-test [caller ["6001" "192.168.56.1" 42001 "192.168.56.101" 5060]
  2.                            called ["6002" "192.168.56.1" 42002 "192.168.56.101" 5060]]
  3.                           (test-comment "Registering client A.")
  4.                           (send-request     caller  {:type :register})
  5.                           (receive-event caller  [:response :code] :ok [_]
  6.                                          (clear-results caller)
  7.                                          (send-request     called  {:type :register}))
  8.                           (test-comment "Registering client B.")                         
  9.                           (receive-event called  [:response :code] :ok [_]
  10.                                          (clear-results called)
  11.                                          (send-request caller {:type :invite :header {:to {:user "6002"}}}))
  12.                           (test-comment "Sending INVITE from client A to B.")
  13.                           (receive-event caller  [:response :code] :trying [_]
  14.                                          (clear-results caller))
  15.                           (test-comment "Replying with RINGING from client B to A.")
  16.                           (receive-event called  [:request] :invite [e]
  17.                                          (clear-results caller)
  18.                                          (send-response called e {:value :ringing}))
  19.                           (receive-event caller  [:response :code] :ringing [_]
  20.                                          (clear-results caller))
  21.                           (test-comment "Replying with OK from client B to A.")
  22.                           (receive-event called  [:request] :invite [e]
  23.                                          (send-response called e {:value :ok})
  24.                                          (clear-results called))
  25.                           (receive-event caller  [:response :code] :ok [e]
  26.                                          (clear-results caller))
  27.                           (receive-event called  [:request] :ack [_]
  28.                                          (clear-results called))
  29.                           (timeout 5)))
clone this paste RAW Paste Data