Author Message
Swapnil_Bhosale
Joined: May 18, 2015
Messages: 88
Offline
Hi All,

I am dong following things in my code.

  • Creating 2 party call for multiple participants. Calling party : participant e.g 3002 ,3004 etc. Called Party : scopia DID number i.e 3002

  • I am watching in callOriginated callback. and doing following things :
    1. call.suspend.
    2. playing media and collecting digit if press 1 then call.allow


  • However, the first person whom so ever press 1 digit to join conference only get connected to Scopia bridge. Succeeding participants are not being allowed further to join Scopia DID. Call stays in that state only forever.

    Perhaps, call.allow() method is being called still its not getting connected to Scopia..


    Whats the issue ??

    Looking forward for your earlier response.


    Thanks and regards,
    Swapnil.
    Swapnil_Bhosale
    Joined: May 18, 2015
    Messages: 88
    Offline
    I am watching in playCompleted() callback.
    And i am calling call. Allow() there.

    However, the first participant who executes this callback, successfully getting connected to the Scopia bridge.
    I can see after call.Allow() executed callAnswered(0 callback getting called but it happens only for first participant not for others.
    Subsequent, participants are not getting connected.

    What might be the problem.

    Please reply back as soon as possible.
    JoelEzell
    Joined: Nov 15, 2013
    Messages: 780
    Offline
    Hi Swapnil, a few questions for you:

    - Why are you doing this in the playCompleted callback rather than digitsCollected? I'd think you only want to allow the call if you actually got the expected DTMF digit.

    - How are you storing the Call object / ID that you are then using in the media callback to allow the call? Is it stored as a field in your MediaListener? If so...

    - Are you creating a new instance of your MediaListener for each call or are you reusing the same instance? Is it possible that the Call object / ID isn't getting updated on subsequent calls? By the way, I'd strongly suggest that you use a unique instance per call as this will avoid any problems with concurrent calls. This is likely what you're doing.

    - As a sanity check, can you please add debug logs in the originated() callback and right before you invoke allow to ensure that the Call ID is the same across those? Please check Call ID and not UCID

    - Do you see any exceptions coming out of the allow() invocation?

    - Do you see any error logs in the debug log? (ce dlogv from the command line).
    Swapnil_Bhosale
    Joined: May 18, 2015
    Messages: 88
    Offline
    Hi Joel,

    Actually, i have 2 medias to play.
    In first media i am collecting digit and if it is "1" i am playing another media and then i am watching in playCompleted() callback.

    Answers to your questions:

    1) I am giving call object as a parameter in mediaListner constructor. This way i am storing call object

    2) I am creating new instance of mediaListner each time.

    3) I have added logs in playCompleted() callback. For the first party calling party is : 2304 called party:3002 , then
    call.allow() gets called and after that callAnswered() callback gets executed. For subsequent participants calling party: 2304,2305,2306
    Called party :3002 are correct . call.allow method is also getting called but callAnswered() callback is not getting executed.


    Please find code below:


    DigitsCollected()callback from MyListener mediaListner class :

    public MyListner(Call call)
    {
    this.call=call;
    }


    public void digitsCollected(UUID requestId, String digits,
    DigitCollectorOperationCause cause) {
    logger.info("Digits entered or timeout occured");
    if(digits==null || digits.length()==0) /* no digits entered by the user, drop the call */
    {
    logger.info("Digits not entered. Dropping the call");
    call.drop();
    }
    else if("*".equals(digits)) /* if * is pressed play announcement again */
    {
    MediaService ms= (MediaService) call.getAttribute("mediaservice");
    PlayItem pi =(PlayItem) call.getAttribute("playItem");
    DigitOptions dp = (DigitOptions)call.getAttribute("digitoptions");
    MediaListener ml = (MediaListener) call.getAttribute("medialistener");
    final UUID Id=ms.promptAndCollect(call.getCallingParty(), pi, dp, ml);
    }
    else if("1".equals(digits))
    {
    try
    {
    final MyMediaListner mediaListener = new MyMediaListner(call);
    final MediaService mediaService = MediaFactory.createMediaService();
    final PlayItem playItem=MediaFactory.createPlayItem();
    playItem.setInterruptible(true);
    playItem.setIterateCount(1);

    playItem.setSource("file://"+MyResource.mediaString+""+MyResource.randomNumber1+".wav");


    final Participant participant = call.getCallingParty();
    call.setAttribute("conference","true");
    final UUID myId = mediaService.play(participant, playItem, mediaListener);
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
    }
    else /* drop the call if any other digit is pressed */
    call.drop();

    }



    playCompleted() callback from MyMediaListner class:


    public MyMediaListner(Call call)
    {
    this.call=call;
    }


    public void playCompleted(UUID requestId, PlayOperationCause cause) {
    // TODO Auto-generated method stub
    logger.info("Play Completed");
    call.allow();
    //call.setAttribute("conference", "true");
    logger.info("Call Allowed || calling party : "+call.getCallingParty().getHandle()+ "Called Party : "+call.getCalledParty().getHandle());

    }



    How I am initiating calls :

    public String CreateCall(String[] participant)
    {
    ReadClusterAttributeI readCluster=new ReadClusterAttributeImpl();
    String destination =readCluster.getScopiaDidNumber();
    String presentedHandle="Conference Call",presentedDomain="collaboratory.avaya.com",presentedDisplay="Conference Call";

    for(int i=0;i<participant.length;i++)
    {

    Identity identity=IdentityFactory.create("Conference Call", "Conference Call");
    Call call=CallFactory.create(participant[i],destination, identity);
    logger.info("Call Created | Source :"+participant[i]+" Destination :"+destination);
    call.getCallingParty().setPresentedHandle(participant[i]);
    call.getCallingParty().setPresentedDomain(presentedDomain);
    call.getCallingParty().setPresentedDisplayName(presentedDisplay);
    call.setAttribute("firstCall", "true");
    call.setAttribute("conference", "false");
    call.setAttribute("numberOfUsers", participant.length);
    call.initiate();
    }

    return "Calls created";
    }




    Please let me know whats the issue, on urgent basis.


    Thanks and regards,
    Swapnil.
    Swapnil_Bhosale
    Joined: May 18, 2015
    Messages: 88
    Offline
    Hi Joel,

    I am using your approach for creating conference.
    i.e

    1. Look into callOriginated() Callback.
    2. do call.suspend();
    3. execute media prompt and collect operation.
    4. call.allow().


    Please look at the code below and rest of code in previous reply

    callOriginated() callback code :

    public void callOriginated(Call call) {
    logger.info("Call originated");
    call.suspend();
    if(call.getAttribute("conference").equals("false"))
    {
    try
    {
    logger.info("CONFERENCE ATTRIBUTE FALSE");
    final DigitOptions digitoptions=MediaFactory.createDigitOptions().setNumberOfDigits(1).setTimeout(20000);
    final MyListner mediaListener = new MyListner(call);
    final MediaService mediaService = MediaFactory.createMediaService();
    final PlayItem playItem=MediaFactory.createPlayItem();
    playItem.setInterruptible(true);
    playItem.setIterateCount(1);

    playItem.setSource("file://"+MyResource.initString+""+MyResource.randomNumber2+".wav");


    logger.info("Play Item : "+MyResource.initString+""+MyResource.randomNumber2+".wav");

    call.setAttribute("playItem", playItem);
    call.setAttribute("digitoptions", digitoptions);
    call.setAttribute("medialistener", mediaListener);
    call.setAttribute("mediaservice", mediaService);

    final UUID requestId=mediaService.promptAndCollect(call.getCallingParty(), playItem, digitoptions, mediaListener);
    logger.info("Media Played");

    }
    catch(URISyntaxException e)
    {
    // TODO Auto-generated catch block
    logger.error("Error while playing Media : ",e);
    }
    }
    }



    Let me know what is the issue.


    Swapnil_Bhosale
    Joined: May 18, 2015
    Messages: 88
    Offline
    Hi all,

    The issue was in following line of code:

    call.getCallingParty().setPresentedHandle(participant[i]);
    call.getCallingParty().setPresentedDomain(presentedDomain);
    call.getCallingParty().setPresentedDisplayName(presentedDisplay);

    If deleted these line and it worked .

    Thank you all.

    JoelEzell
    Joined: Nov 15, 2013
    Messages: 780
    Offline
    I'm happy to hear that you were able to work around your problem by removing the code below. On the other hand, I'm sorry that you had to do so. This sounds like a bug and we'll look into it.
    Swapnil_Bhosale
    Joined: May 18, 2015
    Messages: 88
    Offline
    Yeah...
    Seems to be a bug.

    Thank you all for your support and help.


    Thanks and regards,
    Swapnil.
    JoelEzell
    Joined: Nov 15, 2013
    Messages: 780
    Offline
    Hi Swapnil, one of the developers here suggested that the 'i' in this line "call.getCallingParty().setPresentedHandle(participant[i]);" might be out of bounds for the failing conditions. Is it possible that that's true? From the code snippet you posted, it looks as if a thrown exception might not have been caught. You might check the TextLog files in the /var/log/Avaya/sm directory to see if any Exceptions are posted there.
    Swapnil_Bhosale
    Joined: May 18, 2015
    Messages: 88
    Offline
    Hi Joel,

    I have reviewed logs.
    No exceptions i found there.

    FYI : Call call=CallFactory.create(participant[i],destination, identity);
    in this line of code the exception might have thrown if there is a IndexOutOfBounds.

    Adding to that, All of the calls were getting initiated, only the problem was with call.allow() method.

    If there was a problem in the following statemenet,

    call.getCallingParty().setPresentedHandle(participant[i])

    Calls might not got initiated.


    Thanks and regards,
    Swapnil.
    JoelEzell
    Joined: Nov 15, 2013
    Messages: 780
    Offline
    OK, thanks. We'll investigate further. I may come back and ask for more logs if we can't reproduce the problem.
    Swapnil_Bhosale
    Joined: May 18, 2015
    Messages: 88
    Offline
    Yes sure,

    No problem at all.

    Thank you so much for your help.

    Can you please just help me out on the new question i posted on the forum?
    JoelEzell
    Joined: Nov 15, 2013
    Messages: 780
    Offline
    Here's another thought from one of our developers:

    Since he is doing a create with participant[i] this variable probably contains an address “handle@domain”. If he then passes that to setPresentedHandle we will end up with an @ in the handle, and then we will make our own when we add the presented domain. This will make for nonsense. We have no error checking in setPresentedHandle to ensure that the handle is a properly formed string containing legitimate handle characters, whatever the official list is.

    Can you please check to see if the value you're passing to setPresentedHandle has an "@" in it? This value should only contain numbers. I'll write an enhancement request for improved error checking in this method.
    Swapnil_Bhosale
    Joined: May 18, 2015
    Messages: 88
    Offline
    Hi Joel,

    Participant[] is a String array which contains only numbers taken as a input.

    It contains only extension numbers i.e handles e.g 2300,2304.


    Let me know in case of any queries.


    Thanks and regards,
    Swapnil

    Go to:   
    Mobile view