Author Message
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
I was trying to divert a call to a conference bridge after I collected digits in the MediaListener and I got this exception:

java.lang.IllegalStateException: divertTo called in illegalServiceState

I have attached screenshots for both Log file and Code.

Could anyone help me with this ? Thanks !
  • [Thumb - 2.jpg]
[Disk] Download
  • [Thumb - 1.jpg]
[Disk] Download
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
Hello, can you please show us your code in callIntercepted as well? If you're not already doing so, you may want to try invoking call.suspend() from this callback method. The call should automatically be suspended if a media operation is invoked in callIntercepted, but it would be interesting to know if this solves your problem.
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
Hi,

Here is a screenshot of my callListener.

Should I put call.suspend() in the callAnswered() before I play the announcement ?

And what should I do after I collect the digits ?

Thanks !
  • [Thumb - 3.jpg]
[Disk] Download
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
I think we need to back up a little bit. Can you please say a little more about your expected call flow? divertTo is used when a call is intercepted between A and B. A calls B's number, but your snap-in is invoked before the call gets to B. At this point, your snap-in would be invoked via the callIntercepted callback.

It looks like this is perhaps not the flow you're going after. Can you please clarify?
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
Yes of cause. My flow is like this (which is same as the other post):

1. Create a call from A to B ->
2. When A answers, intercept the call and play an announcement ->
3. After announcement completed, use the media listener to collect digits ->
4. If user input 1 then end the interception and call B then merge A with B, otherwise drop the call.

This is basically to merge a Sip number to a conferencing bridge with a PIN code.
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
OK, in that case, please try the flow I suggested in the other post. This sort of 2-party make call is modeled perhaps a bit differently than you might have thought. callAlerting and callAnswered callbacks are not invoked on the call to the A leg. Instead, when A answers, callOriginated is invoked. In this callback, invoke call.suspend() (this may not be needed) and then invoke your play and collect operation. Once you get the digitsCollected callback, invoke allow() or drop().

Let us know how that goes!
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
I saw in the digitsCollected() function it says call.allow() is not supported.

How should I ends the interception so that it continues the B leg ?
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
I tried to put myCall.allow() under digitsCollected() in MediaListener() after I have the digits. But when I test it, it doesn't continue the call after I press "1".
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
Hmm, I'm not sure what to tell you. I just tried this out in my lab and it worked fine. I did find that I had to invoke call.suspend() within call.originated(), in addition to my play and collect operation.
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
Do you see any error logs? Also, what version of Engagement Development Platform (Colloboration Environment) are you using?
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
There is no error in the log. After I pressed "1", it went to the digitsCollected() where I invoked myCall.allow() and unable to continue the call. The call is not dropped either. I'm using CE 3.0.3.0.303003.
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
OK. I'm sorry, but I think we've done about as much as possible through the forums. I'd encourage you to open a DevConnect ticket for further support if you're not able to get things working on your own.
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
OK. Thank you very much. I will do more test on my own first.
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
I found out that after I pressed "1", it actually went into callOriginated() again and played the announcement again.
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
Then after I pressed "1" second time it will connect me to the conference room but without playing the conference announcement.
Go to:   
Mobile view