Unsupported outgoing call from Yeastar to 3cx via DID numbers

uniscanadmin

Customer
Joined
Mar 18, 2019
Messages
48
Reaction score
6
continuing the topic https://www.3cx.com/community/threads/how-to-get-the-callers-extension-number.136774/

Now we need to implement a return route so that 3CX displays the caller's number from Yeastar and headed to the called subscriber's number

I've already tried different connections, but almost nothing works.

If I do this through the Slave Bridge, then for some reason authorization in 3CX does not work for this trunk.

And if I select the "Asterisk" trunk, the call goes through and even the caller's number is displayed, but I can't figure out how to route it via DID.

How to configure an Asterisk trunk to route calls to internal numbers based on the To field value?
 
The result is slightly improved.
I adjusted the script using AI.
Since the DID number matches the called party's extension, I don't need an additional JSON file with the number mapping.

Can anyone tell me how to resolve the issue with displaying the caller's name using a script?
The name is in the "from" field.

C#:
#nullable disable
using CallFlow;
using System.Threading.Tasks;
using TCX.Configuration;
using TCX.PBXAPI;
using System.IO;

namespace dummy
{
    public class InterceptInboundCall : ScriptBase<InterceptInboundCall>
    {
        public override async Task<bool> StartAsync()
        {
            if (MyCall.Caller.DN is ExternalLine && MyCall.IsInbound)
            {
                var DIDNumber = MyCall.Caller.CalledNumber;

                if (!string.IsNullOrEmpty(DIDNumber))
                {
                    var route = $"Extension.{DIDNumber}.";
                    
                    if (DestinationStruct.TryParse(route, out var destination_struct))
                    {
                        var result = await MyCall.RouteToAsync(destination_struct);
                        
                        MyCall.Info($"DID {DIDNumber} matched as Extension. Redirected with result: {result}");
                        return true;
                    }
                }
            }
            return false;
        }
    }
}
 

Latest Posts

Forum statistics

Threads
111,990
Messages
590,161
Members
164,926
Latest member
tohoken1