]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
finish up last commit
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 6 Sep 2011 20:07:51 +0000 (15:07 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 6 Sep 2011 20:07:51 +0000 (15:07 -0500)
libs/esl/src/esl.c
libs/esl/src/esl_event.c

index cd3a7067f803ca8ef207c1e65cdbd677be6f6db5..9509572a80c91845a71ac0eefe793cbe61079a6a 100644 (file)
@@ -536,7 +536,7 @@ ESL_DECLARE(esl_status_t) esl_execute(esl_handle_t *handle, const char *app, con
 
 ESL_DECLARE(esl_status_t) esl_sendmsg(esl_handle_t *handle, esl_event_t *event, const char *uuid)
 {
-       char cmd_buf[128] = "sendmsg";
+       char cmd_buf[128] = "sendmsg\n";
        char send_buf[1292] = "";
        char *txt;
        
@@ -545,12 +545,13 @@ ESL_DECLARE(esl_status_t) esl_sendmsg(esl_handle_t *handle, esl_event_t *event,
     }
 
        if (uuid) {
-               snprintf(cmd_buf, sizeof(cmd_buf), "sendmsg %s", uuid);
+               snprintf(cmd_buf, sizeof(cmd_buf), "sendmsg %s\n", uuid);
        }
        
        esl_event_serialize(event, &txt, ESL_FALSE);
-       esl_log(ESL_LOG_DEBUG, "SENDMSG\n%s\n", txt);
+       esl_log(ESL_LOG_DEBUG, "%s%s\n", cmd_buf, txt);
 
+       if (send(handle->sock, cmd_buf, strlen(cmd_buf), 0) <= 0) goto fail;
        if (send(handle->sock, txt, strlen(txt), 0) <= 0) goto fail;
        
        free(txt);
index abd3c2be90ab4a43f58d223a33590feebb4f66ae..71e7d42b2a9dc31868fc01afa7654cd26f08c66b 100644 (file)
@@ -791,7 +791,7 @@ ESL_DECLARE(esl_status_t) esl_event_serialize(esl_event_t *event, char **str, es
                if (encode) {
                        esl_url_encode(hp->value, encode_buf, encode_len);
                } else {
-                       esl_snprintf(encode_buf, encode_len, "[%s]", hp->value);
+                       esl_snprintf(encode_buf, encode_len, "%s", hp->value);
                }