[Spce-user] Possible to rewrite caller CLI based on callee number dialled?

Andreas Granig agranig at sipwise.com
Fri Feb 6 05:30:07 EST 2015


Hi,

The main question is where this feature should be used, whether for
inbound rules, outbound rules, or both.

>From a technical point of view, the rewrite rules are designed in a way
that it should only take one or two lines of code in the proxy.cfg.tt2
file to accomplish this.

What you see in rewrite rules are variables like ${something}, which are
essentially just mapped to $avp(s:something) internally, so the only
thing you need to introduce a new variable is setting the
$avp(s:something) in the proxy config to the value you'd need in the
right place.

At the moment, there is already a $avp(s:acc_callee_dialed) set quite at
the beginning of the routing, so in theory you should be able to use
${acc_callee_dialed} in your inbound and also outbound rewrite rules,
both in the matching and replacing part. That would reflect the
user-part of the R-URI as is has been received from the caller.

Once the inbound rewrite rules are processed, there is also
$avp(s:acc_callee_user_in), which is the user-part of the R-RURI after
inbound rules are applied (so usually the normalized format), so you
could in theory use ${acc_callee_user_in} in your outbound rules also.

Give it a try and let me know if it works.

Andreas

On 02/06/2015 11:10 AM, Daniel Grotti wrote:
> Hi,
> yes there is no such feature.
> I will raise an dev ticket though, since it could be useful to have it.
> Nevertheless, I can confirm now if this request will be accepted by devs
> and when we are going to release that.
> 
> 
> Daniel
> 
> 
> On 02/06/2015 11:06 AM, Barry Flanagan wrote:
>> On 6 February 2015 at 09:49, George Mason <george.mason at xoomtalk.com
>> <mailto:george.mason at xoomtalk.com>> wrote:
>>
>>     Hi,
>>
>>     We have a situation where we need to dynamically rewrite the callers CLI
>>     depending on the number they dial. The calls would come in from one
>>     peering, then depending on the number dialled, have the calling CLI
>>     changed, before being sent out over another peering.
>>
>>     I can see how to do this within the same field, i.e. to change the
>>     format of the calling CLI or called number - but is it possible to
>>     manipulate the CALLER number depending on the CALLEE CLI?
>>
>>
>> I would love this feature as well, and have asked about it in the past.
>> There is no current ability to do this. It could be done using some
>> custom proxy config, to look up the callee in a database table,
>> containing destination/callerID pairs and to make the necessary changes
>> but I have not got around to doing that yet. 
>>
>> From my point of view it would be very useful for customers who have DDI
>> in different countries, so that when calling a country where they have a
>> DDI then we change the CallerID to be that DDI.
>>
>> -Barry
>>
>>
>>     Thanks
>>
>>     George
>>     _______________________________________________
>>     Spce-user mailing list
>>     Spce-user at lists.sipwise.com <mailto:Spce-user at lists.sipwise.com>
>>     https://lists.sipwise.com/listinfo/spce-user
>>
>>
>>
>>
>> _______________________________________________
>> Spce-user mailing list
>> Spce-user at lists.sipwise.com
>> https://lists.sipwise.com/listinfo/spce-user
>>
> _______________________________________________
> Spce-user mailing list
> Spce-user at lists.sipwise.com
> https://lists.sipwise.com/listinfo/spce-user
> 



More information about the Spce-user mailing list