
    Efd                     Z    d dl Z d dlZd dlmZ d dlT  G d dej        j                  ZdS )    N)sha1)*c                   p    e Zd ZdZdZej        j        d             Zej        j        d             Z	d Z
dS )TelphinViewz/pub/voip/telphinNc                 0     | j         di t          j        S N )_processrequestargsselfs    ./modules/voip/views/telphin.pygetzTelphinView.get       t},,w|,,,    c                 0     | j         di t          j        S r   )r
   r   formr   s    r   postzTelphinView.post   r   r   c                    t                               d|            t          j                            t
          j                            d          g d          | _        |                    d          }| j        r|rt                               |           |dv r"| j                            ||d                    n|dk    r*| j        	                    ||d         |d	         
           n`|dk    rZ| j        
                    ||d         |d	         
          }|                    d          r| j                            ||           |                     d          S )NzTelphin request: token)zplugin.ext_secretparentzplugin.ext_key)idfields	EventType)zdial-inzdial-outCallFlowanswer
CallStatus)call_statushangupRecID)channel_callzresponse.html)gdebugmodelsCmfPluginTelphinr   r   r   telphin	voip_callvoip_call_startvoip_call_endvoip_recordrender_with_params)r   kwargs
event_typer"   s       r   r
   zTelphinView._process   ss   	,F,,---.22gl6F6Fw6O6O Yk Yk Yk2 l lZZ,,
< 		PJ 		PGGJ444&&vvj/ABBBBx'',,VVJ5GU[\hUi,jjjjx''#|99&&BTbhiubv9ww::g&& PL,,V,,OOO&&777r   )__name__
__module____qualname____url__r'   cmfviewsactionr   r   r
   r	   r   r   r   r      sm        !GGY- - - 	Y- - -8 8 8 8 8r   r   )	base64hmachashlibr   cmf.includer3   r4   BaseViewr   r	   r   r   <module>r;      sn               8 8 8 8 8#)$ 8 8 8 8 8r   