Picture of Sascha
Registered 5 years 337 days
Sascha Friday, 23 June 2023, 11:12 AM
C++ RCC - UserRedirect
Hello everyone,

I need informations about the UserRedirect event.

We would like to know what is meant with this: "Indicating an error if the operation failed". I got this text from here -> https://sdk.innovaphone.com/13r2/doc/appwebsocket/RCC.htm

When is a operation failed for this API?
Does this API react on special release caues which would indicate that the operation has failed?

Regards,
Sascha
Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Friday, 23 June 2023, 12:49 PM
Re: C++ RCC - UserRedirect
Hello Sascha,

an error is returned in two cases here:
  • no appropriate call was found
  • no appropriate peer was found
The error in the response is invoked immediately, so it does not depend on any upcoming events.

Best Regards
Andreas Fink
Picture of Sascha
Registered 5 years 337 days
Sascha Friday, 23 June 2023, 02:28 PM
Re: C++ RCC - UserRedirect
Hello Andreas,

thank you for the informations.
Would it be possible to get the release cause of the peer to which I would do the redirect to in the UserRediectResult event?

With this it would be possible to react on a busy signal on the peer to which we redirected to.

Regards,
Sascha
Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Friday, 23 June 2023, 04:41 PM
Re: C++ RCC - UserRedirect
Hello Sascha,

no, it is an asynchronous operation at this point. The UserRedirectResult message returns directly after the operation was queued.

But it should be possible to get CallInfo Events containing the Release Cause as soon this happens.

Do you mean, you get no CallInfo with such information?

Best Regards
Andreas Fink
Picture of Sascha
Registered 5 years 337 days
Sascha Monday, 26 June 2023, 02:11 PM
Re: C++ RCC - UserRedirect
Hello Andreas,

I have to check it maybe I missed this event. I will come back to you after I have checked this.

Regards,
Sascha
Picture of Sascha
Registered 5 years 337 days
Sascha Wednesday, 12 July 2023, 10:45 AM in response to Andreas Fink (innovaphone)
Re: C++ RCC - UserRedirect
Hello Andreas,

this works now like it should work. But I have a new problem.

If I use our old Sofphone which we created we don't see any CallInfo events in the RCC API. I have activated the CallAdd, CallUpdate and CallDell events now in the RCC API but the call id's I get are unknown to the RCC API.

I have testet this with the Innovaphone Softphone where we get the CallInfo Events and it looks like this:

{"mt":"CallAdd","api":"RCC","src":"RccApiSession","guid":"f3a5ab53251a610178d80050569337b0","cn":"Sascha","call":3,"state":0,"conf-id":"4cdc18fc2c2b4dfd8546813e3fb53f24","call-id":"65e328aa77c34f1f8fed747cf031cfff"}
{"mt":"CallAdd","api":"RCC","src":"RccApiSession","guid":"065e4f3637d45c013c6b0050569337b0","cn":"AMT","call":4,"state":128,"conf-id":"4cdc18fc2c2b4dfd8546813e3fb53f24","call-id":"c4d24c4720ad640118c60050569337b0"}


{"mt":"CallUpdate","api":"RCC","src":"RccApiSession","call":3,"msg":"x-setup","remote":{"h323":"Sascha","e164":"109"},"local":{"h323":"","e164":"001511234567"}}
{"mt":"CallUpdate","api":"RCC","src":"RccApiSession","call":4,"msg":"r-setup","remote":{"h323":"","e164":"001511234567"},"local":{"h323":"Sascha","e164":"109"}}
{"mt":"CallInfo","api":"RCC","src":"f3a5ab53251a610178d80050569337b0","user":1,"call":2,"state":1,"conf":"4cdc18fc2c2b4dfd8546813e3fb53f24","peer":{"e164":"001511234567","h323":""},"time":0,"msg":"x-setup"}


{"mt":"CallUpdate","api":"RCC","src":"RccApiSession","call":4,"msg":"x-call-proc","remote":{"h323":"","e164":"001511234567"},"local":{"h323":"Sascha","e164":"109"}}
{"mt":"CallUpdate","api":"RCC","src":"RccApiSession","call":3,"msg":"r-call-proc","remote":{"h323":"Sascha","e164":"109"},"local":{"h323":"","e164":"001511234567"}}
{"mt":"CallInfo","api":"RCC","src":"f3a5ab53251a610178d80050569337b0","user":1,"call":2,"state":3,"peer":{"e164":"001511234567","h323":""},"time":4,"msg":"r-call-proc"}


{"mt":"CallUpdate","api":"RCC","src":"RccApiSession","call":3,"msg":"r-alert","remote":{"h323":"Sascha","e164":"109"},"local":{"h323":"","e164":""}}
{"mt":"CallUpdate","api":"RCC","src":"RccApiSession","call":4,"msg":"x-alert","remote":{"h323":"","e164":"001511234567"},"local":{"h323":"Sascha","e164":"109"}}
{"mt":"CallInfo","api":"RCC","src":"f3a5ab53251a610178d80050569337b0","user":1,"call":2,"state":4,"peer":{"e164":"001511234567","h323":""},"time":6,"msg":"r-alert"}


{"mt":"CallUpdate","api":"RCC","src":"RccApiSession","call":3,"msg":"r-conn","remote":{"h323":"Sascha","e164":"109"},"local":{"h323":"","e164":"0004915187654321"}}
{"mt":"CallUpdate","api":"RCC","src":"RccApiSession","call":4,"msg":"x-conn","remote":{"h323":"","e164":"0004915187654321"},"local":{"h323":"Sascha","e164":"109"}}
{"mt":"CallInfo","api":"RCC","src":"f3a5ab53251a610178d80050569337b0","user":1,"call":2,"state":5,"peer":{"e164":"0004915187654321","h323":"","norm":"0004915187654321"},"time":9,"msg":"r-conn"}


{"mt":"CallUpdate","api":"RCC","src":"RccApiSession","call":3,"msg":"r-rel","remote":{"h323":"Sascha","e164":"109"},"local":{"h323":"","e164":"0004915187654321"}}
{"mt":"CallUpdate","api":"RCC","src":"RccApiSession","call":4,"msg":"x-rel","remote":{"h323":"","e164":"0004915187654321"},"local":{"h323":"Sascha","e164":"109"}}
{"mt":"CallInfo","api":"RCC","src":"f3a5ab53251a610178d80050569337b0","user":1,"call":2,"state":6,"peer":{"e164":"0004915187654321","h323":""},"time":14,"msg":"r-rel"}


{"mt":"CallDel","api":"RCC","src":"RccApiSession","call":3}
{"mt":"CallDel","api":"RCC","src":"RccApiSession","call":4}
{"mt":"CallInfo","api":"RCC","src":"f3a5ab53251a610178d80050569337b0","user":1,"call":2,"del":true,"state":6,"peer":{"e164":"0004915187654321","h323":""},"time":14,"msg":"del"}

I know that the call from the CallInfo event is the call I need to make a UserRedirect but when I use the call from the CallUpdate event I get this error.

{"api":"RCC","src":"f3a5ab53251a610178d80050569337b0","mt":"UserRedirectResult","error":"call not found"}

How can I get the right call id so that I can do a UserRedirect?

Regards,
Sascha

(Edited by Andreas Fink (innovaphone) - original submission Tuesday, 11 July 2023, 11:29 AM)

Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Tuesday, 11 July 2023, 02:02 PM
Re: C++ RCC - UserRedirect
Hello Sascha,

> I know that the call from the CallInfo event is the call I need to make
> a UserRedirect but when I use the call from the CallUpdate event I get
> this error.
>
> {"api":"RCC","src":"f3a5ab53251a610178d80050569337b0",
> "mt":"UserRedirectResult","error":"call not found"}

it would be great to see the corresponding prior JSON messages to the UserRedirectResult.

The context of the messages CallAdd, CallDel and CallUpdate are isolated from the other RCC user IDs and their call IDs.

As you can see, there is no user ID available in the CallAdd message, this means it can not be used on other user sessions, since a call ID in context of a specific user ID will be different.



> If I use our old Sofphone which we created we don't see any CallInfo
> events in the RCC API.

This seems to be the original problem you are trying to workaround. To be able to analyse this, we need to take a look on all messages of this RCC session starting from UserInitialize. Is the correct "hw" property is used? Is Devices message is used to find out the correct "hw" for specific user?

Best Regards
Andreas Fink

P.S.: Fun fact: After composing this answer I have posted your question to ChatGPT together with RCC documentation and got following answer:

The problem you're facing is related to the call ID not being recognized when attempting to perform a UserRedirect operation.

Based on the event sequence you provided, the call values in CallUpdate events are not the same as the call value in CallInfo events. It appears that the call value you should use for UserRedirect should be from CallInfo rather than CallUpdate.

To fix this issue, you would need to ensure that you're capturing the call ID from the CallInfo events. This might require adjusting your application logic to store the correct call ID when a CallInfo event is received.

Picture of Sascha
Registered 5 years 337 days
Sascha Wednesday, 12 July 2023, 01:02 PM
Re: C++ RCC - UserRedirect
Hello Andreas,

I have send you the logs in an ticket to presales. This is the ticket number ###366249###.

Regards,
Sascha
Picture of Sascha
Registered 5 years 337 days
Sascha Tuesday, 18 July 2023, 11:30 AM
Re: C++ RCC - UserRedirect
Hello Andreas,

do you have any futher infomations for me?

Regards,
Sascha
Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Tuesday, 18 July 2023, 03:27 PM
Re: C++ RCC - UserRedirect
Hello Sascha,

I'm sorry for the delay.

I can see following messages:

The Log from RCC API:
{"mt":"UserInitialize","api":"RCC", "cn":"Sascha Waitz","hw":"byon_softphone"}

The log from Softphone:
{"mt":"Register","api":"PbxSignal","hw":"byon_swphone_swaitz"}

No other messages for "Register" or "UserInitialize" can be found, so I assume this must be two corresponding events, where you are expecting to see CallInfo, but since the "hw" property is not equal, this are different devices. In this particular case my previous question "Is Devices message is used to find out the correct "hw" for specific user?" must be answered with No. and this is the reason, why you can not see any CallInfo messages in the RCC API.

Best Regards
Andreas Fink


Picture of Sascha
Registered 5 years 337 days
Sascha Tuesday, 18 July 2023, 03:42 PM
Re: C++ RCC - UserRedirect
Hi Andreas,

thanks for the reply. I can also see those two entries. I have already thought that it is because of the different hardware names.

I read the default phone app from the myapps and send it to the backend to create the UserInitialize event. I thought that the device which is set there is automatically the right device to use for the UserInitialize event.

I get the default phone app send with this event {"mt":"InitRccApi","src":"rccRequest","guid":"","pbx":"developer_v13","defaultPhoneApp":"byon_softphone"}

Is there a way to change the behavior of the default phone app so that it would send me the correct hardware name?

Regards,
Sascha
Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Tuesday, 18 July 2023, 04:01 PM
Re: C++ RCC - UserRedirect
Hello Sascha,

define "correct hardware name"?

You are using a softphone app with hw "byon_swphone_swaitz" to make calls, but has hw "byon_softphone" configured as default phone. Correct?

Best Regards
Andreas Fink
Picture of Sascha
Registered 5 years 337 days
Sascha Wednesday, 19 July 2023, 07:41 AM
Re: C++ RCC - UserRedirect
Hello Andreas,

yes that is corrrect.

If I use the Innovaphone Softphone I get as a default phone something like dev:byon_swphone_swaitz but our own Softphone uses it's app name as far as I have seen it.

So I wanted to know if there is a way to implement it in a way that we also get dev:byon_swphone_swaitz from our softphone.

Regards,
Sascha
Picture of Sascha
Registered 5 years 337 days
Sascha Wednesday, 19 July 2023, 01:34 PM
Re: C++ RCC - UserRedirect
Hello Andreas,

here is the part how I read the default phone app in myapps. You can find it in the example.html.

The ApiUpdate Event looks like this which we get:
{
"mt":"ApiUpdate",
"apis":{
"com.innovaphone.notificationhandler":{
"@client":{
"title":"innovaphone myApps",
"url":"https://.../PBX0/APPCLIENT/136422/appclient.htm",
"info":{
 
},
"model":{
 
},
"restart":0
},
"byon_softphone":{
"title":"byon softphone",
"url":"https://.../.../byon_softphone/byon-softphone.htm",
"info":{
 
},
"model":{
 
}
},
"chat":{
"title":"Chat",
"url":"https://.../PBX0/APPS/chat/chat.htm",
"info":{
 
},
"model":{
 
}
},
"dev:SwPh_Sascha Waitz_634551a1":{
"title":"Softphone",
"url":"https://.../PBX0/APPS/softphone/softphone.htm",
"info":{
 
},
"model":{
 
}
}
},
"com.innovaphone.client":{
"@client":{
"title":"innovaphone myApps",
"url":"https://.../PBX0/APPCLIENT/136422/appclient.htm",
"info":{ },
"model":{
"user":{
"domain":"",
"sip":"Sascha Waitz",
"guid":"",
"dn":"Sascha Waitz",
"num":"109",
"email":"",
"prefix":{}
},
"home":[],
"deviceApps":[
{
"name":"phone",
"title":"Phone",
"deviceapp":"phone"
},
{
"name":"rcc",
"title":"Rcc",
"deviceapp":"rcc"
},
{
"name":"softphone",
"title":"Softphone",
"deviceapp":"softphone"
}
],
"profileApp":"profile",
"lang":"de",
"scheme":"dark",
"launcher":false,
"launcherUpdateBuild":"136395",
"appStoreUrl":"http://store.innovaphone.com/release/download/",
"adminSettings":{
"autostart":{
"value":true
},
"taskbar":{
"value":true
},
"offline":{
"value":0
},
"video":{
"value":false
},
"noVpnAddresses":{
"value":false,
"force":true
}
}
},
"restart":0
}
},
"com.innovaphone.phone":{
"byon_softphone":{
"title":"byon softphone",
"url":"https://.../.../byon_softphone/byon-softphone.htm",
"info":{
"type":"softphone"
},
"model":{ }
},
"dev:SwPh_Sascha Waitz_634551a1":{
"title":"Softphone",
"url":"https://.../PBX0/APPS/softphone/softphone.htm",
"info":{
"type":"softphone"
},
"model":{ }
}
},
"com.innovaphone.callkit":{
"byon_softphone":{
"title":"byon softphone",
"url":"https://.../.../byon_softphone/byon-softphone.htm",
"info":{ },
"model":{ }
},
"dev:SwPh_Sascha Waitz_634551a1":{
"title":"Softphone",
"url":"https://.../PBX0/APPS/softphone/softphone.htm",
"info":{ },
"model":{ }
}
},
"com.innovaphone.chat":{
"chat":{
"title":"Chat",
"url":"https://.../PBX0/APPS/chat/chat.htm",
"info":{ },
"model":{ }
}
}
},
"defaultApiProviders":{
"com.innovaphone.chat":"chat",
"com.innovaphone.phone":"byon_softphone"
}
}

I will try to get the device over the other way's you have mentioned in our phone call.

Regards,
Sascha

example.html
Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Thursday, 20 July 2023, 11:29 AM
Re: C++ RCC - UserRedirect
Hello Sascha,

the way to get the default "Hardware Id" via ApiUpdate and defaultApiProviders for com.innovaphone.phone can work, but requires a special API announcement from the App Service of your custom softphone.

In the AppInfoResult message from the App Service of your custom softphone a property "deviceapp" must be set:
https://sdk.innovaphone.com/13r3/doc/appwebsocket/AppWebsocket.htm#AppInfoResult

Please check if it done correctly.

Also consider to check following "info" object that is set by the innovaphone softphone App:
{
"apis": {
"com.innovaphone.callkit": {},
"com.innovaphone.notificationhandler": {},
"com.innovaphone.phone": {
"info": {
"type": "softphone"
}
}
},
"wake": [
"phone",
"softphone"
]
}


The alternative (and more convenient) way would be to get correct "Hardware Id" for the specific App and User via PbxAdminApi or ReplicationApi/TableUsersApi.

Best Regards
Andreas Fink
Picture of Sascha
Registered 5 years 337 days
Sascha Thursday, 20 July 2023, 11:20 AM in response to Andreas Fink (innovaphone)
1 of 1 users consider this post helpful
Re: C++ RCC - UserRedirect
Hello Andreas,

I have now a solution for this problem. You can mark it as resolved.

I use now the PbxAdminApi and do a GetObject call to get the hardware names of all devices of this extension. After I have found the correct device I make the UserInitialize with the RCC API and I get all the CallInfo Messages which where missing before.

Regards,
Sascha
Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Thursday, 20 July 2023, 11:30 AM
Re: C++ RCC - UserRedirect
Hello Sascha,

this is a more reliable way, since the mechanism with "dev:" App should be considered as not a public API and could be changed.

Best Regards
Andreas Fink
← You can define your color theme preference here