      (first (filter (fn[c] (= ext (.getName (.getAddress c))))
                     (.getConnections call)))
   )
-(defmulti transform-event (fn[event ext] (.getClass event)))
-
-(defmethod transform-event javax.telephony.events.TermConnActiveEv [event ext]
-  (log/info "transform-event" "TermConnActiveEv" ext)
+(defmulti transform-event (fn[event ext] (.getID event)))
+
+(defmethod transform-event 115 [event ext]
+  (log/info "transform-event" "TerminalConnectionEvent" ext)
   (let [ call (.getCall event )
         callers (get-callers-from-provider call)
          ]
     (log/info "transform-event!" "TermConnActiveEv" "callers" callers)
     (swap! jtapi-provider assoc-in [:calls ext ] call)
-    {:operation "call" :ext ext :body {:cause (.getCause event) :meta-code (.getMetaCode event) :callers callers}}
+    {:operation "call" :ext ext :body {:id (.getID event) :callers callers}}
     ))
 
 
-(defmethod transform-event javax.telephony.events.TermConnDroppedEv [event ext]
+(defmethod transform-event 117 [event ext]
         (swap! jtapi-provider assoc-in [:calls ext] nil)
-        {:operation "hangup" :ext ext :body {:cause (.getCause event) :meta-code (.getMetaCode event)}}
+        {:operation "hangup" :ext ext :body {:id(.getID event)}}
 )
 (defmethod transform-event :default [event ext]
-  (log/warn "transform-event" "default" ext event)
+  (log/warn "transform-event" "default" ext (.getID event ) event)
   )
 
 (defn call-listener-handler [ ext callback-fn event]

              ;;; (Thread/sleep 2000)
              ;;; (.drop ccc)
              (log/info "transfer" "completed" to from)
                  {:operation "transfer" :ext from :body {:status "success" :to to}}
            )))
    (catch Exception e
      (log/error "transfer" e)
      )
    )
  )

(defn get-dups[] dups)

(defn debug-call [ ext n e ]
  (log/debug ext n (.getID e) (bean e))
)
(defn reify-call-control-connection-listener [ext handler-fn]
  (log/info "reify-call-control-connection-listener" ext handler-fn)
