Hello,
On 2014-08-14 01:01 , CommuniGate Discussion wrote:
>
> Hello,
> anyone know how to configure the router in CgPro to dial ISN number?
The trickiest part here would be to catch numbers with * anywhere in
them. I don't see a simple way to do that, so a consider instead the
approach with some prefix (aka trunk code) for dialing out and some
special domain name for incoming calls. Using these one can send those
requests to a CG/PL script for ISN number parsing and further forking to
the proper SIP destination.
S:<#*@*> = parse_isn{*}#postmaster@localhost
S:<*@isn-in.mydomain.tld> = parse_isn{*}#postmaster@localhost
entry main is
var isn = Vars().startParameter;
if isArray(isn) then isn=isn[0]; end if;
var starIdx = FindSubstring(isn, "*");
if starIdx <= 0 then RejectCall(404); end if;
// No * at all or right at the start - not an ISN
var itad = SubString(isn,starIdx+1,1000);
isn = SubString(isn,0,starIdx-1);
// now we have parsed ISN and ITAD, and can try to route them
// e.g. all local domains may have domain alias in the form
// ITAD.itad, and ISN as an extension (alias to an account)
// then I...@ITAD.itad should route to a local account
var uri = "sip:" + isn + "@" + itad + ".itad";
if RouteLocalURI(uri) != null then ForkCall(uri); end if;
// if ISN is not assigned locally we may need to send the call to
// some external SIP gateway - this I left as an exercise for you :)
end entry;
> Thank you
>
> Vincenzo
--
Best regards,
Dmitry Akindinov.
=======================================================================
When answering to letters sent to you by the tech.support staff, make
sure the original message you have received is included into your
reply.