Uniqueness of ActionID in Originate Action


Currently I’m tasked with developing a desktop application to do outgoing calls. The application will be used by 5-6 users. This is what the application is doing:

  1. When user clicks “Call” button in the app, the app will generate a unique GUID (f.e. 6bf11dfb-4e6c-4eb4-85cd-6c8b8026019f), then it will send the following command:
    Action: Originate
    Channel: SIP/10000
    Context: some-context
    Exten: 081299999 (destination number)
    Priority: 1
    WaitTime: 20
    CallerId: 10000 (the user’s extension)
    ActionId: 6bf11dfb-4e6c-4eb4-85cd-6c8b8026019f (the geenrated GUID)

  2. The user’s softphone (Zoiper) pops up and user starts talking on the phone

  3. My app checks the call status by sending this command:
    Action: Status
    ActionId: 6bf11dfb-4e6c-4eb4-85cd-6c8b8026019f

The problem is:
The asterisk server sends me a response containing correct ActionId 6bf11dfb-4e6c-4eb4-85cd-6c8b8026019f, but with destination and extension number belonging to other user (not 081299999 and 10000).

Worse, the returned uniqueid belongs to call made by other user which cause the app linking wrong CDR data to the call record (because the uniqueid belongs to other call made by other user).

However this situation occured randomly, sometimes the server returned correct call, sometimes wrong one. There are also instances where the recording was not created and not saved in CDR table.

Please note that the GUID used in ActionID is truly unique, each click to “Call” button will regenerate new GUID.

My question is:

  1. Is it possible that a unique ActionID is assigned to another call originated by other party? Other originated calls will certainly be assigned with different ActionIDs.
  2. What is actually the purpose of ActionID? Am I using it correctly? The documentation said it can be used as identifier that we can query later when we need info the call we made.

I developed the app using C#.NET, connecting to asterisk server using TCP socket connection. The asterisk server version is 11.3.

Really appreciate your help. Thanks.

The action ID is a remote procedure call identifier, not a call or channel identifier.

The Status action should have a different Action ID!

You need to look for the New Channel event to get an identifier for the channel and use that in the Channel parameter of Status.

Hi, thanks for your response.

I tried sending the “Action: Status” command (without specifying channel), and the server returns all events of all channels.

I noticed there are “Event: Status” and “Event: Newchannel” events. Both contains my channel (SIP/10000-xxxxx) and some Uniqueid.

If I only take events containing ‘SIP/10000’, can I rely on these information?

The SIP/10000 looks always consistent with the Uniqueid in all events…