Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DLR reject with header("HTTP/1.0 404 Not Found") but SMSBOX still get rejected DLR #19

Open
vinayakvasu opened this issue Oct 28, 2019 · 1 comment

Comments

@vinayakvasu
Copy link

void pluginbox_http_receive_thread(void *arg) {
info(0, PLUGINBOX_LOG_PREFIX "Starting receive thread");
PluginHttp *plugin_http = arg;
Octstr *header_key, *header_value;
int status;
Octstr *final_url;
List *response_headers;
Octstr *response_body;
PluginBoxMsg *pluginbox_msg;

while((pluginbox_msg = http_receive_result(plugin_http->caller,&status,&final_url,&response_headers,&response_body)) != NULL) {
    semaphore_down(plugin_http->max_pending_requests);
    if((status >= HTTP_OK) && (status < HTTP_BAD_REQUEST)) {
        debug(PLUGINBOX_LOG_PREFIX"pluginbox.http.receive.thread", 0, "Upstream URL %s accepted message, processing changes", octstr_get_cstr(final_url));
        pluginbox_http_modify_with_headers(pluginbox_msg->msg, response_headers);
    } else {
        warning(0, PLUGINBOX_LOG_PREFIX"Upstream URL %s rejected msg with status %d (outside >= %d < %d), rejecting", octstr_get_cstr(final_url), status, HTTP_OK, HTTP_BAD_REQUEST);
        pluginbox_msg->status = PLUGINBOX_MESSAGE_REJECT;
    }
    pluginbox_msg->callback(pluginbox_msg);
    octstr_destroy(final_url);
    http_destroy_headers(response_headers);
    octstr_destroy(response_body);
}

}

@Suren15894
Copy link

@vinayakvasu ,

Existing implementation is done only to reject the submissions and not the DLR's.

If you want to reject the deliver_sm then you will have to alter the pluginbox.c file.

bearerbox_inbound_queue_plugins_done : line no 381.

in this function you will have to add PLUGINBOX_MESSAGE_REJECT commands.

This is not tested with load, may be you can check this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants