How to access Call-ID after doing a leg_setup

Version 1
    This document was generated from CDN thread

    Created by: Adolfo Arizpe on 21-01-2013 01:56:13 PM
    I need to find the "Call-ID" of an outgoing leg.
    If I call the following code, which is correct according to the manual:    
       # at some point in my code I place an outoing call    
       leg setup $my_destination callInfo leg_incoming     
       # later in the code, I need to retrieve call-id to match cdrs with a vendor    
       set call_id [infotag get leg_proto_headers "Call-ID" leg_outgoing]
    error:  
       expected integer but got "leg_outgoing"CallID leg_outgoing was not an Incoming Leg  
     
    what am I doing wrong?   thank you

    Subject: RE: How to access Call-ID after doing a leg_setup
    Replied by: Yaw-Ming Chen on 21-01-2013 07:18:47 PM
    Unless you do 'set callinfo(newguid) "true"  ', call-id will be the same so I will try   1. set callid [infotag get leg_incoming_guid] please refer to programming guide. 2. If you want to get it from header try infotag get evt_proto_headers Call-ID    
    Get this when you get "ev_setup_indication" event

    Subject: RE: How to access Call-ID after doing a leg_setup
    Replied by: Adolfo Arizpe on 22-01-2013 10:02:00 AM
    Yaw-Ming,
     
     thanks for your help. A couple of questions:
    1.- Isn't the ev_setup_indication event only called for incoming calls? If so, I won't be able to get the outgoing call-id.
     
    2.- I don't see any references to "set callid" in the programming guide.
     
    thanks again

    Subject: RE: How to access Call-ID after doing a leg_setup
    Replied by: Yaw-Ming Chen on 22-01-2013 10:59:04 AM
    Adolfo Arizpe:
    Yaw-Ming,
     
     thanks for your help. A couple of questions:
    1.- Isn't the ev_setup_indication event only called for incoming calls? If so, I won't be able to get the outgoing call-id.
     Usually call-id is unique for one call.
    2.- I don't see any references to "set callid" in the programming guide.
    command is [infotag get leg_incoming_guid], 'callid' is the varibale you can set it to anything else
     
    thanks again


    Subject: RE: How to access Call-ID after doing a leg_setup
    Replied by: Adolfo Arizpe on 22-01-2013 12:02:26 PM
    Yaw-Ming,
     
     using 
      'set callinfo(newguid) "true"'
    solved our problems! Thanks for your help!

    Subject: RE: How to access Call-ID after doing a leg_setup
    Replied by: Yaw-Ming Chen on 22-01-2013 12:27:07 PM
    Just curious, did you get the following error on IOS ?
    %CALL_CONTROL-6-CALL_LOOP: The incoming call has a global identifier already present in the list of currently handled calls. It is being refused.
     
    or 500 Internal error on SIP ?