Is it possible to translate the ANI or the DNIS using Freeswitch? Thanks, Ken Fulmer
For outbound calls to the PSTN, we might need to strip a leading "9". For inbound calls, we might need to convert 10 digit DID's to internal 4 digit directory numbers. Those are two of the most common examples we encounter. Thanks, Ken From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Brian West Sent: Tuesday, April 20, 2010 11:50 AM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] ANI / DNIS Number Translation Can you provide some examples? All of what you want is doable but use cases would be most helpful. /b On Apr 20, 2010, at 11:38 AM, Ken Fulmer wrote: Is it possible to translate the ANI or the DNIS using Freeswitch? Thanks, Ken Fulmer
Ken, with FS, that's more than trivial. To strip a prefix from the dialed number for outbound calls, the idea is to do this in your extension (syntax is not correct, I dont want to spoil you from the pleasure to write it yourself :) ): condition destination_number regexp ^9(\d+)$ bridge sofia/gateway/whatever/$1 -> $1 will contain what's between the () in the regexp For inbound calls, what you want to do is the typical config of FS (like in the default one) as all phones on FS use a 4 digits userid. So the idea is to do: condition destination_number regexp ^415917220(\d)$ bridge user/100$1 -> in this example, I consider you have 10 DIDs from 4159172200 to 4159172209 and that those DIDs are allocated to 10 users, from 1000 to 1009. That's really an example. Your mileage may vary. David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 20/04/2010 à 19:02, Ken Fulmer a écrit :
For outbound calls to the PSTN, we might need to strip a leading “9”. For inbound calls, we might need to convert 10 digit DID’s to internal 4 digit directory numbers.
Those are two of the most common examples we encounter.
Thanks,
Ken
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org ] On Behalf Of Brian West Sent: Tuesday, April 20, 2010 11:50 AM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] ANI / DNIS Number Translation
Can you provide some examples? All of what you want is doable but use cases would be most helpful.
/b
On Apr 20, 2010, at 11:38 AM, Ken Fulmer wrote:
Is it possible to translate the ANI or the DNIS using Freeswitch?
Thanks,
Ken Fulmer
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Thanks guys. That is exactly what I needed. I’m re-reading the dial plan page to better understand pattern matching / substitutions. Thanks again! Ken From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of David Ponzone Sent: Tuesday, April 20, 2010 12:23 PM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] ANI / DNIS Number Translation Ken, with FS, that's more than trivial. To strip a prefix from the dialed number for outbound calls, the idea is to do this in your extension (syntax is not correct, I dont want to spoil you from the pleasure to write it yourself :) ): condition destination_number regexp ^9(\d+)$ bridge sofia/gateway/whatever/$1 -> $1 will contain what's between the () in the regexp For inbound calls, what you want to do is the typical config of FS (like in the default one) as all phones on FS use a 4 digits userid. So the idea is to do: condition destination_number regexp ^415917220(\d)$ bridge user/100$1 -> in this example, I consider you have 10 DIDs from 4159172200 to 4159172209 and that those DIDs are allocated to 10 users, from 1000 to 1009. That's really an example. Your mileage may vary. David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr <BLOCKED::http://www.ipeva.fr/> - www.ipeva-studio.com <BLOCKED::http://www.ipeva-studio.com/> Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 20/04/2010 à 19:02, Ken Fulmer a écrit : For outbound calls to the PSTN, we might need to strip a leading “9”. For inbound calls, we might need to convert 10 digit DID’s to internal 4 digit directory numbers. Those are two of the most common examples we encounter. Thanks, Ken From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Brian West Sent: Tuesday, April 20, 2010 11:50 AM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] ANI / DNIS Number Translation Can you provide some examples? All of what you want is doable but use cases would be most helpful. /b On Apr 20, 2010, at 11:38 AM, Ken Fulmer wrote: Is it possible to translate the ANI or the DNIS using Freeswitch? Thanks, Ken Fulmer _______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
For outbound calls to the PSTN, we might need to strip a leading "9". For inbound calls, we might need to convert 10 digit DID's to internal 4 digit directory numbers.
Those are two of the most common examples we encounter.
Regex group matches? That's how I do it... <condition field="destination_number" expression="^(?:1{0,1})(403|587)(\d{7})$"> ... <action application="bridge" data="sofia/gateway/foo.ca/1$1$2|$1$2@bar.local:5060"/> Just an example how I dial as needed from a more flexible input...
Ken, can you define "translate" ? You can change them, of course, as you can change most parameters of a call. David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 20/04/2010 à 18:38, Ken Fulmer a écrit :
Is it possible to translate the ANI or the DNIS using Freeswitch?
Thanks,
Ken Fulmer
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (4)
-
Brian West
-
David Ponzone
-
Joseph L. Casale
-
Ken Fulmer