Permalink
Browse files

update to 0.6.0-Alpha1

  • Loading branch information...
1 parent 458f919 commit 67d91afc12093611a07c1b50211c596cd30a2835 @Ruiyun committed May 14, 2013
Showing with 59 additions and 76 deletions.
  1. +28 −16 cljain.dum.html
  2. +2 −3 cljain.sip.address.html
  3. +1 −1 cljain.sip.core.html
  4. +5 −7 cljain.sip.header.html
  5. +4 −36 cljain.sip.message.html
  6. +19 −13 index.html
View
@@ -1,42 +1,54 @@
<!DOCTYPE html>
-<html><head><link href="css/default.css" rel="stylesheet" type="text/css"><script src="js/jquery.min.js" type="text/javascript"></script><script src="js/page_effects.js" type="text/javascript"></script><title>cljain.dum documentation</title></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html">Cljain 0.5.0-RC2 API documentation</a></h1></div><div class="sidebar" id="namespaces"><h3><span>Namespaces</span></h3><ul><li class="current"><a href="cljain.dum.html"><span>cljain.dum</span></a></li><li><a href="cljain.sip.address.html"><span>cljain.sip.address</span></a></li><li><a href="cljain.sip.core.html"><span>cljain.sip.core</span></a></li><li><a href="cljain.sip.dialog.html"><span>cljain.sip.dialog</span></a></li><li><a href="cljain.sip.header.html"><span>cljain.sip.header</span></a></li><li><a href="cljain.sip.message.html"><span>cljain.sip.message</span></a></li><li><a href="cljain.sip.transaction.html"><span>cljain.sip.transaction</span></a></li></ul></div><div class="sidebar" id="vars"><h3>Public Vars</h3><ul><li><a href="cljain.dum.html#var-*current-account*"><span>*current-account*</span></a></li><li><a href="cljain.dum.html#var--%3EAccountManagerImpl"><span>-&gt;AccountManagerImpl</span></a></li><li><a href="cljain.dum.html#var-dum-listener"><span>dum-listener</span></a></li><li><a href="cljain.dum.html#var-global-set-account"><span>global-set-account</span></a></li><li><a href="cljain.dum.html#var-legal-content%3F"><span>legal-content?</span></a></li><li><a href="cljain.dum.html#var-map-%3EAccountManagerImpl"><span>map-&gt;AccountManagerImpl</span></a></li><li><a href="cljain.dum.html#var-register-to%21"><span>register-to!</span></a></li><li><a href="cljain.dum.html#var-send-request%21"><span>send-request!</span></a></li><li><a href="cljain.dum.html#var-send-response%21"><span>send-response!</span></a></li><li><a href="cljain.dum.html#var-unregister-to%21"><span>unregister-to!</span></a></li></ul></div><div class="namespace-docs" id="content"><h2>cljain.dum documentation</h2><pre class="doc">The SIP DSL by Clojure.
-Here is a simplest example show how to use it:
+<html><head><link href="css/default.css" rel="stylesheet" type="text/css"><script src="js/jquery.min.js" type="text/javascript"></script><script src="js/page_effects.js" type="text/javascript"></script><title>cljain.dum documentation</title></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html">Cljain 0.6.0-Alpha1 API documentation</a></h1></div><div class="sidebar" id="namespaces"><h3><span>Namespaces</span></h3><ul><li class="current"><a href="cljain.dum.html"><span>cljain.dum</span></a></li><li><a href="cljain.sip.address.html"><span>cljain.sip.address</span></a></li><li><a href="cljain.sip.core.html"><span>cljain.sip.core</span></a></li><li><a href="cljain.sip.header.html"><span>cljain.sip.header</span></a></li><li><a href="cljain.sip.message.html"><span>cljain.sip.message</span></a></li></ul></div><div class="sidebar" id="vars"><h3>Public Vars</h3><ul><li><a href="cljain.dum.html#var-*current-account*"><span>*current-account*</span></a></li><li><a href="cljain.dum.html#var--%3EAccountManagerImpl"><span>-&gt;AccountManagerImpl</span></a></li><li><a href="cljain.dum.html#var-dum-listener"><span>dum-listener</span></a></li><li><a href="cljain.dum.html#var-global-set-account"><span>global-set-account</span></a></li><li><a href="cljain.dum.html#var-legal-content%3F"><span>legal-content?</span></a></li><li><a href="cljain.dum.html#var-map-%3EAccountManagerImpl"><span>map-&gt;AccountManagerImpl</span></a></li><li><a href="cljain.dum.html#var-register-to%21"><span>register-to!</span></a></li><li><a href="cljain.dum.html#var-send-request%21"><span>send-request!</span></a></li><li><a href="cljain.dum.html#var-send-response%21"><span>send-response!</span></a></li><li><a href="cljain.dum.html#var-unregister-to%21"><span>unregister-to!</span></a></li></ul></div><div class="namespace-docs" id="content"><h2>cljain.dum documentation</h2><pre class="doc">Here is a simplest example show how to use it:
(use 'cljain.dum)
(require '[cljain.sip.core :as sip]
- '[cljain.sip.address :as addr])
+ '[cljain.sip.address :as addr])
(defmethod handle-request :MESSAGE [request transaction _]
(println &quot;Received: &quot; (.getContent request))
(send-response! 200 :in transaction :pack &quot;I receive the message from myself.&quot;))
- (global-set-account :user &quot;bob&quot; :domain &quot;localhost&quot; :display-name &quot;Bob&quot; :password &quot;thepwd&quot;)
+ (global-set-account {:user &quot;bob&quot; :domain &quot;localhost&quot; :display-name &quot;Bob&quot; :password &quot;thepwd&quot;})
(sip/global-bind-sip-provider! (sip/sip-provider! &quot;my-app&quot; &quot;localhost&quot; 5060 &quot;udp&quot;))
(sip/set-listener! (dum-listener))
(sip/start!)
(send-request! :MESSAGE :to (addr/address &quot;sip:bob@localhost&quot;) :pack &quot;Hello, Bob.&quot;
- :on-success (fn [&amp; {:keys [response]}] (println &quot;Fine! response: &quot; (.getContent response)))
- :on-failure (fn [&amp; {:keys [response]}] (println &quot;Oops!&quot; (.getStatusCode response)))
- :on-timeout (fn [_] (println &quot;Timeout, try it later.&quot;)))
+ :on-success (fn [&amp; {:keys [response]}]
+ (println &quot;Fine! response: &quot; (.getContent response)))
+ :on-failure (fn [&amp; {:keys [response]}]
+ (println &quot;Oops!&quot; (.getStatusCode response)))
+ :on-timeout (fn [&amp; _]
+ (println &quot;Timeout, try it later.&quot;)))
-Remember, if you want send REGISTER to sip registry, please use the 'register-to!' function, that will
+Remember, if you want to send REGISTER request, prefer to use the 'register-to!' function, it will
help you to deal the automatic rigister refresh:
(register-to! (addr/address &quot;sip:the-registry&quot;) 3600
- :on-success #(prn &quot;Register success.&quot;)
- :on-failure #(prn &quot;Register failed.&quot;)
- :on-refreshed #(prn &quot;Refreshed fine.&quot;)
- :on-refresh-failed #(prn &quot;Refresh failed.&quot;))
+ :on-success (fn [response]
+ (prn &quot;Register success.&quot;))
+ :on-failure (fn [response]
+ (prn &quot;Register failed.&quot;))
+ :on-refreshed (fn [response]
+ (prn &quot;Refreshed fine.&quot;))
+ :on-refresh-failed (fn [response]
+ (prn &quot;Refresh failed.&quot;)))
This version cljain.dum has some limitation that if you want auto-refresh work correctly, you must use
'global-set-account' to give a root binding with *current-account* like previous.</pre><div class="public" id="var-*current-account*"><h3>*current-account*</h3><div class="usage"></div><pre class="doc">A map contain these four fields: :user, :domain, :password and :display-name.
</pre></div><div class="public" id="var--%3EAccountManagerImpl"><h3>-&gt;AccountManagerImpl</h3><div class="usage"><code>(-&gt;AccountManagerImpl)</code></div><pre class="doc">Positional factory function for class cljain.dum.AccountManagerImpl.
</pre></div><div class="public" id="var-dum-listener"><h3>dum-listener</h3><div class="usage"><code>(dum-listener)</code></div><pre class="doc">Create a dum default event listener.
-You can use it for 'cljain.sip.core/set-listener!' function.</pre></div><div class="public" id="var-global-set-account"><h3>global-set-account</h3><div class="usage"><code>(global-set-account &amp; {:keys [user domain password display-name], :as account})</code></div><pre class="doc">Give the *current-account* a root binding.
+You can use it for 'cljain.sip.core/set-listener!' function.</pre></div><div class="public" id="var-global-set-account"><h3>global-set-account</h3><div class="usage"><code>(global-set-account account)</code></div><pre class="doc">Give the *current-account* a root binding.
Although you can use the clojure dynamic binding form, but use this function in this version
-cljian.dum is more recommended.</pre></div><div class="public" id="var-legal-content%3F"><h3>legal-content?</h3><div class="usage"><code>(legal-content? content)</code></div><pre class="doc">Check the content is a string or a map with :type, :sub-type, :length and :content keys.
-</pre></div><div class="public" id="var-map-%3EAccountManagerImpl"><h3>map-&gt;AccountManagerImpl</h3><div class="usage"><code>(map-&gt;AccountManagerImpl m__5665__auto__)</code></div><pre class="doc">Factory function for class cljain.dum.AccountManagerImpl, taking a map of keywords to field values.
+cljian.dum is more recommended.
+
+account has follow keys:
+ :user
+ :domain
+ :password
+ :display-name</pre></div><div class="public" id="var-legal-content%3F"><h3>legal-content?</h3><div class="usage"><code>(legal-content? content)</code></div><pre class="doc">Check the content is a string or a map with :type, :sub-type, :length and :content keys.
+</pre></div><div class="public" id="var-map-%3EAccountManagerImpl"><h3>map-&gt;AccountManagerImpl</h3><div class="usage"><code>(map-&gt;AccountManagerImpl m__5818__auto__)</code></div><pre class="doc">Factory function for class cljain.dum.AccountManagerImpl, taking a map of keywords to field values.
</pre></div><div class="public" id="var-register-to%21"><h3>register-to!</h3><div class="usage"><code>(register-to! registry-address expires-seconds &amp; {:keys [on-success on-failure on-refreshed on-refresh-failed]})</code></div><pre class="doc">Send REGISTER sip message to target registry server, and auto refresh register before
expired.
@@ -51,7 +63,7 @@
More complicate example:
(send-request! &quot;MESSAGE&quot; :pack &quot;Welcome&quot; :to (sip-address &quot;192.168.1.128&quot; :user &quot;bob&quot;) :use &quot;UDP&quot;
- :on-success #(prn %1 %2 %3) :on-failure #(prn %1 %2 %3) :on-timeout #(prn %))
+ :on-success #(prn %) :on-failure #(prn %) :on-timeout #(prn %))
If the pack content is not just a trivial string, provide a well named funciont
to return a content map like this is recommended:
View
@@ -1,12 +1,11 @@
<!DOCTYPE html>
-<html><head><link href="css/default.css" rel="stylesheet" type="text/css"><script src="js/jquery.min.js" type="text/javascript"></script><script src="js/page_effects.js" type="text/javascript"></script><title>cljain.sip.address documentation</title></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html">Cljain 0.5.0-RC2 API documentation</a></h1></div><div class="sidebar" id="namespaces"><h3><span>Namespaces</span></h3><ul><li><a href="cljain.dum.html"><span>cljain.dum</span></a></li><li class="current"><a href="cljain.sip.address.html"><span>cljain.sip.address</span></a></li><li><a href="cljain.sip.core.html"><span>cljain.sip.core</span></a></li><li><a href="cljain.sip.dialog.html"><span>cljain.sip.dialog</span></a></li><li><a href="cljain.sip.header.html"><span>cljain.sip.header</span></a></li><li><a href="cljain.sip.message.html"><span>cljain.sip.message</span></a></li><li><a href="cljain.sip.transaction.html"><span>cljain.sip.transaction</span></a></li></ul></div><div class="sidebar" id="vars"><h3>Public Vars</h3><ul><li><a href="cljain.sip.address.html#var-address"><span>address</span></a></li><li><a href="cljain.sip.address.html#var-address%3F"><span>address?</span></a></li><li><a href="cljain.sip.address.html#var-sip-address"><span>sip-address</span></a></li><li><a href="cljain.sip.address.html#var-sip-uri"><span>sip-uri</span></a></li><li><a href="cljain.sip.address.html#var-tel-uri"><span>tel-uri</span></a></li><li><a href="cljain.sip.address.html#var-uri-from-address"><span>uri-from-address</span></a></li><li><a href="cljain.sip.address.html#var-uri%3F"><span>uri?</span></a></li></ul></div><div class="namespace-docs" id="content"><h2>cljain.sip.address documentation</h2><pre class="doc"></pre><div class="public" id="var-address"><h3>address</h3><div class="usage"><code>(address uri)</code><code>(address uri display-name)</code></div><pre class="doc">Create a new Address object using a URI.
+<html><head><link href="css/default.css" rel="stylesheet" type="text/css"><script src="js/jquery.min.js" type="text/javascript"></script><script src="js/page_effects.js" type="text/javascript"></script><title>cljain.sip.address documentation</title></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html">Cljain 0.6.0-Alpha1 API documentation</a></h1></div><div class="sidebar" id="namespaces"><h3><span>Namespaces</span></h3><ul><li><a href="cljain.dum.html"><span>cljain.dum</span></a></li><li class="current"><a href="cljain.sip.address.html"><span>cljain.sip.address</span></a></li><li><a href="cljain.sip.core.html"><span>cljain.sip.core</span></a></li><li><a href="cljain.sip.header.html"><span>cljain.sip.header</span></a></li><li><a href="cljain.sip.message.html"><span>cljain.sip.message</span></a></li></ul></div><div class="sidebar" id="vars"><h3>Public Vars</h3><ul><li><a href="cljain.sip.address.html#var-address"><span>address</span></a></li><li><a href="cljain.sip.address.html#var-address%3F"><span>address?</span></a></li><li><a href="cljain.sip.address.html#var-sip-address"><span>sip-address</span></a></li><li><a href="cljain.sip.address.html#var-sip-uri"><span>sip-uri</span></a></li><li><a href="cljain.sip.address.html#var-tel-uri"><span>tel-uri</span></a></li><li><a href="cljain.sip.address.html#var-uri%3F"><span>uri?</span></a></li></ul></div><div class="namespace-docs" id="content"><h2>cljain.sip.address documentation</h2><pre class="doc"></pre><div class="public" id="var-address"><h3>address</h3><div class="usage"><code>(address address)</code><code>(address uri display-name)</code></div><pre class="doc">Create a new Address object using a URI.
It useful to create the To header etc.</pre></div><div class="public" id="var-address%3F"><h3>address?</h3><div class="usage"><code>(address? object)</code></div><pre class="doc">Check the 'obj' is an instance of javax.sip.Address.
</pre></div><div class="public" id="var-sip-address"><h3>sip-address</h3><div class="usage"><code>(sip-address host &amp; {:keys [user port transport display-name], :as options})</code></div><pre class="doc">A convenient way to create a new Address object that limited to sip uri.
(sip-address &quot;localhost&quot; :user &quot;tom&quot; :display-name &quot;Tom&quot; :port 5060 :transport &quot;udp&quot;)</pre></div><div class="public" id="var-sip-uri"><h3>sip-uri</h3><div class="usage"><code>(sip-uri host &amp; {:keys [user port transport]})</code></div><pre class="doc">Create a new SipURI object.
(sip-uri &quot;localhost&quot; :port 5060 :transport &quot;udp&quot; :user &quot;tom&quot;)</pre></div><div class="public" id="var-tel-uri"><h3>tel-uri</h3><div class="usage"><code>(tel-uri phone-number)</code></div><pre class="doc">Create a new TelURI object with a phone number.
-(tel-uri 12345678) or (tel-uri &quot;12345678&quot;)</pre></div><div class="public" id="var-uri-from-address"><h3>uri-from-address</h3><div class="usage"><code>(uri-from-address address)</code></div><pre class="doc">DEPRECATED: Use Java method 'getURI' directly instead.
-Get the URI member from a Address object.</pre></div><div class="public" id="var-uri%3F"><h3>uri?</h3><div class="usage"><code>(uri? object)</code></div><pre class="doc">Check the 'obj' is an instance of javax.sip.URI.
+(tel-uri 12345678) or (tel-uri &quot;12345678&quot;)</pre></div><div class="public" id="var-uri%3F"><h3>uri?</h3><div class="usage"><code>(uri? object)</code></div><pre class="doc">Check the 'obj' is an instance of javax.sip.URI.
</pre></div></div></body></html>
Oops, something went wrong.

0 comments on commit 67d91af

Please sign in to comment.