]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
send the call's uniqueid, if any, as the first element of the event's parameter list.
authorAndrew Thompson <andrew@hijacked.us>
Wed, 31 Dec 2008 04:47:58 +0000 (04:47 +0000)
committerAndrew Thompson <andrew@hijacked.us>
Wed, 31 Dec 2008 04:47:58 +0000 (04:47 +0000)
unlock the session returned by core_session_locate like I should've been doing.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11019 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c

index 511b7136133cf5a77ed2b9b18a84c11cb6fa2f9c..d3e9bbabe47b7b189a8060977fe37433411714ca 100644 (file)
@@ -271,6 +271,8 @@ static void remove_binding(listener_t *listener, erlang_pid *pid) {
 static void ei_encode_switch_event_headers(ei_x_buff *ebuf, switch_event_t *event)
 {
        int i;
+       char *uuid = switch_event_get_header(event, "unique-id");
+
        switch_event_header_t *hp;
 
        for (i = 0, hp = event->headers; hp; hp = hp->next, i++);
@@ -278,7 +280,13 @@ static void ei_encode_switch_event_headers(ei_x_buff *ebuf, switch_event_t *even
        if (event->body)
                i++;
 
-       ei_x_encode_list_header(ebuf, i);
+       ei_x_encode_list_header(ebuf, i+1);
+
+       if (uuid) {
+               ei_x_encode_string(ebuf, switch_event_get_header(event, "unique-id"));
+       } else {
+               ei_x_encode_atom(ebuf, "undefined");
+       }
 
        for (hp = event->headers; hp; hp = hp->next) {
                ei_x_encode_tuple_header(ebuf, 2);
@@ -983,7 +991,9 @@ sendevent_fail:
                                        ei_x_encode_atom(rbuf, "error");
                                        ei_x_encode_atom(rbuf, "badmem");
                                }
-                               /* switch_core_session_rwunlock(session); */ /* XXX is this needed? */
+
+                               /* release the lock returned by switch_core_locate_session */
+                               switch_core_session_rwunlock(session);
                                break;
 
 sendmsg_fail: