(phone_number, text, backend_api, timestamp=None,
             domain_scope=None, backend_message_id=None,
             raw_text=None, backend_id=None, media_urls=None)
return msg
entry point for incoming sms

    phone_number - originating phone number
    text - message content
    backend_api - backend API ID of receiving sms backend
    timestamp - message received timestamp; defaults to now (UTC)
    domain_scope - set the domain scope for this SMS; see SMSBase.domain_scope for details
    media_urls - list of urls for media download.
entry point for incoming sms
entry point for incoming sms
def incoming(phone_number, text, backend_api, timestamp=None,
             domain_scope=None, backend_message_id=None,
             raw_text=None, backend_id=None, media_urls=None):
    """
    entry point for incoming sms

    phone_number - originating phone number
    text - message content
    backend_api - backend API ID of receiving sms backend
    timestamp - message received timestamp; defaults to now (UTC)
    domain_scope - set the domain scope for this SMS; see SMSBase.domain_scope for details
    media_urls - list of urls for media download.
    """
    # Log message in message log
    if text is None:
        text = ""
    phone_number = clean_phone_number(phone_number)
    msg = get_sms_class()(
        phone_number=phone_number,
        direction=INCOMING,
        date=timestamp or get_utcnow(),
        text=text,
        domain_scope=domain_scope,
        backend_api=backend_api,
        backend_id=backend_id,
        backend_message_id=backend_message_id,
        raw_text=raw_text,
    )
    if media_urls:
        msg.custom_metadata = {"media_urls": media_urls}

    if settings.SMS_QUEUE_ENABLED:
        msg.processed = False
        msg.datetime_to_process = get_utcnow()
        msg.queued_timestamp = msg.datetime_to_process
        msg.save()
        enqueue_directly(msg)
    else:
        msg.processed = True
        msg.save()
        process_incoming(msg)
    return msg
def incoming ( phone_number , text , backend_api , timestamp = None , domain_scope = None , backend_message_id = None , raw_text = None , backend_id = None , media_urls = None ) : # Log message in message log if text is None : text = "" phone_number = clean_phone_number ( phone_number ) msg = get_sms_class ( ) ( phone_number = phone_number , direction = INCOMING , date = timestamp or get_utcnow ( ) , text = text , domain_scope = domain_scope , backend_api = backend_api , backend_id = backend_id , backend_message_id = backend_message_id , raw_text = raw_text , ) if media_urls : msg . custom_metadata = { "media_urls" : media_urls } if settings . SMS_QUEUE_ENABLED : msg . processed = False msg . datetime_to_process = get_utcnow ( ) msg . queued_timestamp = msg . datetime_to_process msg . save ( ) enqueue_directly ( msg ) else : msg . processed = True msg . save ( ) process_incoming ( msg ) return msg