File: //home/arjun/projects/buyercall/buyercall/blueprints/sms/__pycache__/bw_sms_inbound.cpython-310.pyc
o
�we�/ � @ s� d Z ddlmZ ddlZddlmZmZmZmZm Z
ddlmZ ddl
mZmZ ddlmZ ddlmZ e�e�Zed ed
d�ZdZejd
ddgd�ejdd� ��Zdd� Zejdddgd�ejdd� ��ZdS )z7
Governs the logic of the incoming lead text messages.
� )�print_functionN)� Blueprint�request�jsonify�
make_response�current_app)�Block)�csrf�db)�and_)� load_only�bw_sms_inbound� templates)�template_folder� bandwidthz/bw/sms�GET�POST)�methodsc C sh ddl m} | tj�}|r"tj}t|� d}tdd�}t||�}|S td� d}tdd�}t||�}|S ) a Entry point for the incoming SMS or MMS messages. This is specifically for Bandwidth API V2. A Location
exist with 2 application attach to it. One is for SMS/MMS and the other for Voice. This call-back url
is specified on the SMS.MMS application.
r ��authenticate_bw_request�� �Authentication passed.��message�Authentication failed� �Authentication failed.) �buyercall.lib.util_bandwidthr r �headers�json�lead_inbound_messager r �print)r �
authenticated�args�status_coder �response� r&