How to get the Call-ID of an outgoing leg?

Version 1

    Subject: RE: How to get the Call-ID of an outgoing leg?
    Replied by: Yaw-Ming Chen on 18-05-2012 01:52:50 PM
    Try "evt_proto_headers"

    set fromEvt [infotag get evt_proto_headers From]
        puts "\n>>>> From header from evt tag == $fromEvt <<<<\n"
    This document was generated from CDN thread

    Created by: Adolfo Arizpe on 18-05-2012 01:10:16 PM
    In my TCL script, I need to access the Call-ID that is sent as SIP sip header when I do a leg setup to start an outgoing leg.
     
    The manual has examples on how to get this value for incoming SIP calls, but I haven't found the way to get this value when I'm initiating the outbound call.
     
    I have tried:
     
                    set foo [infotag get leg_proto_headers "Call-ID"]
     
    but it the returning value is empty.
     
    I have also tried using leg_outgoing_guid but the vale it returns is the exact same one as the leg_incoming_guid.
     
    Thanks in advance for any help!

    Subject: RE: How to get the Call-ID of an outgoing leg?
    Replied by: Adolfo Arizpe on 18-05-2012 02:30:37 PM
    Yaw-Ming, thank you for your help.

    I've tried using evt_proto_headers, which according to the manual, can only be used in the ev_notify, ev_subscribe_done, ev_unsubscribe_indication events.

    As soon as I add the ev_notify event to my fsm, i start getting errors:

       May 18 18:23:01.084: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
       Sent:
       SIP/2.0 500 Internal Server Error
       ...

    Adding ev_subscribe_done it's never triggered.

    Is there another way to retrieve the Call-Id sip header?