Legacy Dev Forum Posts

 View Only

Sign Up

How to transfer an incoming call?

  • 1.  How to transfer an incoming call?

    Posted 06-05-2025 18:11

    Stan | 2017-01-11 07:02:25 UTC | #1

    A call me I transfer A to C which API should I call ?


    RogierBosch | 2017-01-11 08:30:26 UTC | #2

    See link Transfer options API


    Stan | 2017-01-13 08:49:55 UTC | #3

    var api = new ConversationsApi(config); var destination = new Destination(transferNumber); var speakTo = ConsultTransfer.SpeakToEnum.Destination; var body = new ConsultTransfer(speakTo, destination); return api.PostCallsCallIdParticipantsParticipantIdConsult(callId, participantId, body);

    Error calling PostCallsCallIdParticipantsParticipantIdConsult: {"status":400,"code":"bad.request","message":"You are not a connected participant on the call","details":[],"errors":[]}


    RogierBosch | 2017-01-13 09:16:55 UTC | #4

    Wich participant are you using? A conversation has two participants in a call

    "purpose": "agent" and "purpose": "customer"

    If I am correct ; you need to use the correct participantID


    Stan | 2017-01-13 09:18:47 UTC | #5

    My code: string participantId = list.Entities[0].Participants.Find(x => x.Purpose.Equals("agent")).Id; should I use customer?


    RogierBosch | 2017-01-13 09:27:24 UTC | #6

    I think so.. did not test this API yet.. Give it a try :slight_smile:


    tim.smith | 2017-01-13 15:23:25 UTC | #7

    Stan, post:3, topic:782
    "message":"You are not a connected participant on the call"

    Is the call you're trying to transfer in the connected state? You can't transfer calls that are alerting you or have already been disconnected.

    @RogierBosch is correct that you need to use the agent participant. Keep in mind that there may be more than one participant with the purpose agent, and a single user can be multiple participants (transferring away and then back to the same user creates a new participant). list.Entities[0].Participants.Find(x => x.Purpose.Equals("agent")).Id is not enough. You need to also verify that the participant is you (check the user id against your own) and verify that the state is connected.


    Stan | 2017-01-17 00:33:22 UTC | #8

    @tim.smith I have checked the conversation. There's only one agent participant, and the status was connected.Why the API still return this error ?


    tim.smith | 2017-01-17 15:35:22 UTC | #9

    Can you provide a context ID from the response?


    Stan | 2017-01-20 17:14:59 UTC | #11

    @tim.smith

     {
      "entities": [
        {
          "id": "c48180ca-123f-4f5a-9795-63c2c42b7ba5",
          "participants": [
            {
              "id": "e3f5be79-193b-40ce-a1ed-979c1a81a4c7",
              "name": "National",
              "address": "tel:12345678",
              "startTime": "2017-01-17T07:23:49.250Z",
              "connectedTime": "2017-01-17T07:23:49.330Z",
              "purpose": "customer",
              "state": "connected",
              "direction": "inbound",
              "held": false,
              "wrapupRequired": false,
              "queue": {
                "id": "6535e25a-91f7-4161-8aee-5fe3da69ff00",
                "selfUri": "/api/v2/routing/queues/6535e25a-91f7-4161-8aee-5fe3da69ff00"
              },
              "attributes": {},
              "provider": "Edge",
              "muted": false,
              "confined": false,
              "recording": true,
              "recordingState": "active",
              "ani": "tel:12345678",
              "dnis": "tel:12345678"
            },
            {
              "id": "2d769672-503e-42b2-ab9c-1905de3907d7",
              "name": "ivr1",
              "address": "sip:4fdff121-42a5-41f0-8de3-36b8810a6023@127.0.0.1;language=en-US;user=ivr",
              "startTime": "2017-01-17T07:23:49.298Z",
              "connectedTime": "2017-01-17T07:23:49.318Z",
              "endTime": "2017-01-17T07:23:58.395Z",
              "purpose": "ivr",
              "state": "disconnected",
              "direction": "inbound",
              "disconnectType": "transfer",
              "held": false,
              "wrapupRequired": false,
              "attributes": {},
              "provider": "Edge",
              "muted": false,
              "confined": false,
              "recording": false,
              "recordingState": "none",
              "ani": "tel:12345678",
              "dnis": "sip:4fdff121-42a5-41f0-8de3-36b8810a6023@127.0.0.1;language=en-US;user=ivr"
            },
            {
              "id": "014e4624-052e-4251-8252-3dfbf9f85553",
              "name": "acd1",
              "address": "sip:6535e25a-91f7-4161-8aee-5fe3da69ff00@127.0.0.1;language=en-US;src=https://edge-proxy.ap-northeast-1.mypurecloud.jp/connector/v1/organizations/4dd9691e-09b3-484d-9ccc-458e3e17b853/defaults/ivr/1a3170fd-1d09-4b34-896e-2178c4228d2b/defaultentrypoint.vxml;user=acd",
              "startTime": "2017-01-17T07:23:58.443Z",
              "connectedTime": "2017-01-17T07:23:58.427Z",
              "endTime": "2017-01-17T07:24:05.242Z",
              "purpose": "acd",
              "state": "disconnected",
              "direction": "inbound",
              "disconnectType": "transfer",
              "held": false,
              "wrapupRequired": false,
              "queue": {
                "id": "6535e25a-91f7-4161-8aee-5fe3da69ff00",
                "selfUri": "/api/v2/routing/queues/6535e25a-91f7-4161-8aee-5fe3da69ff00"
              },
              "attributes": {},
              "provider": "Edge",
              "muted": false,
              "confined": false,
              "recording": false,
              "recordingState": "none",
              "ani": "tel:12345678",
              "dnis": "sip:6535e25a-91f7-4161-8aee-5fe3da69ff00@127.0.0.1;language=en-US;src=https://edge-proxy.ap-northeast-1.mypurecloud.jp/connector/v1/organizations/4dd9691e-09b3-484d-9ccc-458e3e17b853/defaults/ivr/1a3170fd-1d09-4b34-896e-2178c4228d2b/defaultentrypoint.vxml;user=acd"
            },
            {
              "id": "0fd870ca-5d11-4f0f-94b3-93a368df0836",
              "address": "tel:12345678;tgrp=f1ff8793-6c8d-4afe-9d8c-f8d9e41f594f;trunk-context=org1",
              "startTime": "2017-01-17T07:23:58.850Z",
              "connectedTime": "2017-01-17T07:24:05.238Z",
              "purpose": "agent",
              "state": "connected",
              "direction": "inbound",
              "held": false,
              "wrapupRequired": true,
              "wrapupPrompt": "optional",
              "user": {
                "id": "85d235b3-aef0-4544-adb0-405f9071b297",
                "selfUri": "/api/v2/users/85d235b3-aef0-4544-adb0-405f9071b297"
              },
              "queue": {
                "id": "6535e25a-91f7-4161-8aee-5fe3da69ff00",
                "selfUri": "/api/v2/routing/queues/6535e25a-91f7-4161-8aee-5fe3da69ff00"
              },
              "attributes": {},
              "wrapupSkipped": false,
              "provider": "Edge",
              "muted": false,
              "confined": false,
              "recording": false,
              "recordingState": "none",
              "ani": "sip:12345678;user=phone",
              "dnis": "tel:12345678;tgrp=f1ff8793-6c8d-4afe-9d8c-f8d9e41f594f;trunk-context=org1"
            }
          ],
          "otherMediaUris": [],
          "recordingState": "active",
          "selfUri": "/api/v2/conversations/calls/c48180ca-123f-4f5a-9795-63c2c42b7ba5"
        }
      ],
      "pageSize": 1,
      "pageNumber": 1,
      "total": 1,
      "lastUri": "/api/v2/conversations/calls?pageSize=1&pageNumber=1",
      "selfUri": "/api/v2/conversations/calls?pageSize=1&pageNumber=1",
      "firstUri": "/api/v2/conversations/calls?pageSize=1&pageNumber=1",
      "pageCount": 1
    }

    tim.smith | 2017-01-18 17:40:47 UTC | #12

    I'm looking for the ININ-Correlation-ID header.


    Stan | 2017-01-19 01:54:15 UTC | #13

    @tim.smith {ININ-Correlation-Id=5059f1bd-34e1-4d37-ba76-af4cac1187d2}


    tim.smith | 2017-01-19 16:47:29 UTC | #14

    When is that ID from? And what environment are you using? I can't find that correlation ID in the logs.


    Stan | 2017-01-20 01:12:05 UTC | #15

    about 24 hours ago, environment:mypurecloud.jp


    tim.smith | 2017-01-20 17:33:38 UTC | #16

    It looks like you'll need to open a ticket with PureCloud Support for this.

    I can see that in the conversation (43e3e52c-a7d2-4e62-8017-b4a81c4f1571) the agent participant used in the request (7e9468a0-0070-4ca5-9232-364130a1fe69) is connected as of 01/18/2017 18:43:49.276 -0700 and the consult request isn't made until 01/18/2017 18:44:11.295 -0700. Either the error message is misleading or there's a bug somewhere, but either possibility will require Support to investigate further.


    system | 2017-08-28 19:29:50 UTC | #17


    This post was migrated from the old Developer Forum.

    ref: 782