Picture of Khalil 5054
Registered 4 years 322 days
Khalil 5054 Wednesday, 5 August 2020, 08:56 AM
Trying to make a call with RCC api
Hi

I am trying to make a call to another user, but get user unknown from returned UserCallResult.

This is my code:
public function ReceiveInitialStart(\AppPlatform\Message $msg) {
 $this->sendMessage(new AppPlatform\Message("Initialize", "api", "RCC"));
}

 public function ReceiveInitialUserInfo(\AppPlatform\Message $msg)
{
 $this->sendMessage(new AppPlatform\Message("UserCall", "api", "RCC","user",1,"cn","Khalil Abuawad","e164","22795592"));
 $this->log("UserCall");
}

 public function ReceiveInitialInitializeResult(\AppPlatform\Message $msg)
{
 $this->log("InitializeResult");
 
}

 public function ReceiveInitialUserCallResult(\AppPlatform\Message $msg)
{
 $this->log("UserCallResult");
 return "Dead";
}

what I get in output:
{"api":"RCC","mt":"UserCallResult","call":0,"error":"user unknown"}

Thanks in advance,
Best Regards,
Khalil
Andreas Fink
Moderator Registered 13 years 110 days
Andreas Fink (innovaphone) Wednesday, 5 August 2020, 09:36 AM
Re: Trying to make a call with RCC api
Hello Khalil,

you are missing UserInitilize, it must be done after Initialize, and before UserCall.

UserInitialize will deliver id for "user" parameter in the UserCall.

Best Regards
Andreas Fink
Picture of Khalil 5054
Registered 4 years 322 days
Khalil 5054 Wednesday, 5 August 2020, 09:40 AM
Re: Trying to make a call with RCC api
Well I have received the user id as u can see I am currently using 1 which is something that was received upon calling UserInitialize.. Do the user id change? Do I have to implement it dynamically and use it when I receive it from UserInitialize?
Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 190 days
Christoph Künkel (innovaphone) Wednesday, 5 August 2020, 09:55 AM
1 of 1 users consider this post helpful
Re: Trying to make a call with RCC api
to understand how this interface works, you may also have a look at the SOAP API description. RCC is a different approach to access the same functions, so it works quite similar (but not exactly the same).
Note: Although you could use SOAP from PHP right away, we do not recommend it, as it is sort of "deprecated".

Regarding your question, yes, you need to implement dynamic retrieval of the user id (as suggested in the SOAP docs: "Creates an outgoing call from the user (which is a handle obtained by a call to UserInitialize) to the destination ...").

Hope this can help, Christoph
Picture of Khalil 5054
Registered 4 years 322 days
Khalil 5054 Wednesday, 5 August 2020, 10:03 AM
Re: Trying to make a call with RCC api
Thanks Christoph I will try, could you look at the other question recently posted in the same post by me if that is something you can answer smile

Thanks in advance,
Best Regards,
Khalil
Picture of Khalil 5054
Registered 4 years 322 days
Khalil 5054 Wednesday, 5 August 2020, 09:57 AM in response to Andreas Fink (innovaphone)
Re: Trying to make a call with RCC api
I also have another question, I don't understand why certain function name works. The documentation doesn't say what to call these functions when calling the certain operations. It seems to me that I need to call the receiving result functions the operation + result at the end for the result to be received, could you explain this to me please?

Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 190 days
Christoph Künkel (innovaphone) Wednesday, 5 August 2020, 10:13 AM
1 of 1 users consider this post helpful
Re: Trying to make a call with RCC api
Not exactly sure what you are referring to but I assume its related to the names of the functions you write to handle incoming messages.

This is explained in the respective wiki article. There it says
abstract public function ReceiveInitialStart(\AppPlatform\Message $msg);
This function will be called by the base class, when a message with message type (mt, see above) of Start is received in the automaton state Initial.
So when you need to handle a message called FuncResult when your automaton is in state MyState, then you need to create a function like
public function ReceiveMyStateFuncResult(\AppPlatform\Message $msg);
If there is no such function, the incoming message is ignored. Using different states in your automaton is optional. If you like, you can stay in state Initial all the time.


← You can define your color theme preference here