redirect to IVRs

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

redirect to IVRs

Gabriel Bermudez
hi list,

I'm using opensips as a redirect server based on the TO or R-URI
header.  If the user is in the IVR group the proxy will respond with a
redirect.

(is_user_in("To", "ivr")) {
     xlog("The call will be redirect to calling card server");
     rewritehostport("x.x.x.x:5060");
     sl_send_reply("302", "Moved Temporarily");
     exit;
}

but I would also want to tell the UAC (a PSTN gateway) to change the
FROM header from a local number to a international number.  Is this
possible?  If not, which is the best way to handle it if the IVR needs
to recognize an international CallerID and must be easily scalable (my
idea is to use the dispatcher module and stateless transactions for that)

Thanks for you answers.


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: redirect to IVRs

Saúl Ibarra Corretgé-2
IIRC routing based on the To header is not recommended, you should use
the RURI instead.

To alter the From header you could use the uac_replace_from function
from the uac module.

Regards,


2009/8/12, Gabriel Bermudez <[hidden email]>:

> hi list,
>
> I'm using opensips as a redirect server based on the TO or R-URI
> header.  If the user is in the IVR group the proxy will respond with a
> redirect.
>
> (is_user_in("To", "ivr")) {
>      xlog("The call will be redirect to calling card server");
>      rewritehostport("x.x.x.x:5060");
>      sl_send_reply("302", "Moved Temporarily");
>      exit;
> }
>
> but I would also want to tell the UAC (a PSTN gateway) to change the
> FROM header from a local number to a international number.  Is this
> possible?  If not, which is the best way to handle it if the IVR needs
> to recognize an international CallerID and must be easily scalable (my
> idea is to use the dispatcher module and stateless transactions for that)
>
> Thanks for you answers.
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

--
Enviado desde mi dispositivo móvil

/Saúl
http://www.saghul.net | http://www.sipdoc.net

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: redirect to IVRs

Bogdan-Andrei Iancu
In reply to this post by Gabriel Bermudez
Hi Gabriel,

Gabriel Bermudez wrote:

> hi list,
>
> I'm using opensips as a redirect server based on the TO or R-URI
> header.  If the user is in the IVR group the proxy will respond with a
> redirect.
>
> (is_user_in("To", "ivr")) {
>      xlog("The call will be redirect to calling card server");
>      rewritehostport("x.x.x.x:5060");
>      sl_send_reply("302", "Moved Temporarily");
>      exit;
> }
>
> but I would also want to tell the UAC (a PSTN gateway) to change the
> FROM header from a local number to a international number.  Is this
> possible?  If not, which is the best way to handle it if the IVR needs
> to recognize an international CallerID and must be easily scalable (my
> idea is to use the dispatcher module and stateless transactions for that)
>  
In a redirect setup, you do send back indication only on the new RURI to
be used. The redirect server cannot send any indication on the other
headers.

But if you need to change something, you can put an opensips in front
and use the uac_replace_from() function to set the proper callerid.

Regards,
Bogdan

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: redirect to IVRs

Gabriel Bermudez
Hi,

Bogdan-Andrei Iancu escribió:

> Hi Gabriel,
>
> Gabriel Bermudez wrote:
>> hi list,
>>
>> I'm using opensips as a redirect server based on the TO or R-URI
>> header.  If the user is in the IVR group the proxy will respond with
>> a redirect.
>>
>> (is_user_in("To", "ivr")) {
>>      xlog("The call will be redirect to calling card server");
>>      rewritehostport("x.x.x.x:5060");
>>      sl_send_reply("302", "Moved Temporarily");
>>      exit;
>> }
>>
>> but I would also want to tell the UAC (a PSTN gateway) to change the
>> FROM header from a local number to a international number.  Is this
>> possible?  If not, which is the best way to handle it if the IVR
>> needs to recognize an international CallerID and must be easily
>> scalable (my idea is to use the dispatcher module and stateless
>> transactions for that)
>>  
> In a redirect setup, you do send back indication only on the new RURI
> to be used. The redirect server cannot send any indication on the
> other headers.
Today I read the RFC and had the same impresion :)

>
> But if you need to change something, you can put an opensips in front
> and use the uac_replace_from() function to set the proper callerid.
>
> Regards,
> Bogdan
>
Ok, I'm going to try it out.  One question, this means that I _need_ to
use t_relay() to send the request to the IVR? ... I need it to be
scalable so I think if I can use forward() and disable record routing it
would scale better (I don't know if as much as with redirects).

Thanks for you answers.

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: redirect to IVRs

Bogdan-Andrei Iancu
Gabriel Bermudez wrote:

>> But if you need to change something, you can put an opensips in front
>> and use the uac_replace_from() function to set the proper callerid.
>>
>> Regards,
>> Bogdan
>>
> Ok, I'm going to try it out.  One question, this means that I _need_
> to use t_relay() to send the request to the IVR? ... I need it to be
> scalable so I think if I can use forward() and disable record routing
> it would scale better (I don't know if as much as with redirects).
t_relay() can do 10K calls per second (on a decent PC). If you do
forward() you will do stateless routing and you will not be able to use
failure_route for re-routing to different IVRs in cases of failures.

Regards,
Bogdan


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Redirect to independent servers

Gabriel Georgescu
In reply to this post by Bogdan-Andrei Iancu
Hi List,

Can anybody give me an ideea? I try to implement a load balancing
scenario or call distribution to a farm of independent voip servers,
but the original caller IP has to be preserved. Because these servers
have their own billing based on original caller IP.
I understand that it might be possible to do this by answering to the
initial request with a 'redirect' message specifying eafch time the
new server IP.
Is this working, or is this the best way to do it?
Also I want to be able to probe if the independent servers are alive
and set a maximum calls redirected/minute limit for each server.
Can all this be done with opensips?

Thanks in advance,
Gabriel


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Redirect to independent servers

Brett Nemeroff
Gabriel,
You can't really set a call limit if you perform the redirects statelessly. Basically the server wouldn't know the call count per server if you did that. 

What I see most people do here is to add some sort of header like X-Original-IP with the original IP of the request. Then on the destination server(s), use that header if it is present. 

Of course, you should really remove any existing X-Original-IP headers before adding one to keep users from spoofing.

-Brett

On Wed, Aug 12, 2009 at 2:52 PM, Gabriel Georgescu <[hidden email]> wrote:
Hi List,

Can anybody give me an ideea? I try to implement a load balancing
scenario or call distribution to a farm of independent voip servers,
but the original caller IP has to be preserved. Because these servers
have their own billing based on original caller IP.
I understand that it might be possible to do this by answering to the
initial request with a 'redirect' message specifying eafch time the
new server IP.
Is this working, or is this the best way to do it?
Also I want to be able to probe if the independent servers are alive
and set a maximum calls redirected/minute limit for each server.
Can all this be done with opensips?

Thanks in advance,
Gabriel


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Redirect to independent servers

Gabriel Georgescu
Thank you for your detailed answer Brett!
The problem with this additional X-Original-IP header is that it will not be recognized by the software on the destination voip server. And I cannot modify that software.


At 12:58 AM 8/13/2009, Brett Nemeroff wrote:
Gabriel,
You can't really set a call limit if you perform the redirects statelessly. Basically the server wouldn't know the call count per server if you did that.

What I see most people do here is to add some sort of header like X-Original-IP with the original IP of the request. Then on the destination server(s), use that header if it is present.

Of course, you should really remove any existing X-Original-IP headers before adding one to keep users from spoofing.

-Brett

On Wed, Aug 12, 2009 at 2:52 PM, Gabriel Georgescu <[hidden email] > wrote:
Hi List,

Can anybody give me an ideea? I try to implement a load balancing
scenario or call distribution to a farm of independent voip servers,
but the original caller IP has to be preserved. Because these servers
have their own billing based on original caller IP.
I understand that it might be possible to do this by answering to the
initial request with a 'redirect' message specifying eafch time the
new server IP.
Is this working, or is this the best way to do it?
Also I want to be able to probe if the independent servers are alive
and set a maximum calls redirected/minute limit for each server.
Can all this be done with opensips?

Thanks in advance,
Gabriel


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Redirect to independent servers

Bogdan-Andrei Iancu
Hi Gabriel,

But the software you mentioned, where is it looking for the caller's IP
- network level? sip level ?

Regards,
Bogdan

Gabriel Georgescu wrote:

> Thank you for your detailed answer Brett!
> The problem with this additional X-Original-IP header is that it will
> not be recognized by the software on the destination voip server. And
> I cannot modify that software.
>
>
> At 12:58 AM 8/13/2009, Brett Nemeroff wrote:
>> Gabriel,
>> You can't really set a call limit if you perform the redirects
>> statelessly. Basically the server wouldn't know the call count per
>> server if you did that.
>>
>> What I see most people do here is to add some sort of header like
>> X-Original-IP with the original IP of the request. Then on the
>> destination server(s), use that header if it is present.
>>
>> Of course, you should really remove any existing X-Original-IP
>> headers before adding one to keep users from spoofing.
>>
>> -Brett
>>
>> On Wed, Aug 12, 2009 at 2:52 PM, Gabriel Georgescu
>> <[hidden email] <mailto:[hidden email]> > wrote:
>>
>>     Hi List,
>>
>>     Can anybody give me an ideea? I try to implement a load balancing
>>     scenario or call distribution to a farm of independent voip servers,
>>     but the original caller IP has to be preserved. Because these servers
>>     have their own billing based on original caller IP.
>>     I understand that it might be possible to do this by answering to the
>>     initial request with a 'redirect' message specifying eafch time the
>>     new server IP.
>>     Is this working, or is this the best way to do it?
>>     Also I want to be able to probe if the independent servers are alive
>>     and set a maximum calls redirected/minute limit for each server.
>>     Can all this be done with opensips?
>>
>>     Thanks in advance,
>>     Gabriel
>>
>>
>>     _______________________________________________
>>     Users mailing list
>>     [hidden email] <mailto:[hidden email]>
>>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Redirect to independent servers

Gabriel Georgescu
Hi,

The software looks at SIP level for the caller's IP.
I do not know exactly if in Contact header or in Owner address from
message body but in any way it is RFC compliant and this canot be changed.

Best regards,
Gabriel


At 11:47 AM 8/13/2009, Bogdan-Andrei Iancu wrote:

>Hi Gabriel,
>
>But the software you mentioned, where is it looking for the caller's IP
>- network level? sip level ?
>
>Regards,
>Bogdan
>
>Gabriel Georgescu wrote:
> > Thank you for your detailed answer Brett!
> > The problem with this additional X-Original-IP header is that it will
> > not be recognized by the software on the destination voip server. And
> > I cannot modify that software.
> >
> >
> > At 12:58 AM 8/13/2009, Brett Nemeroff wrote:
> >> Gabriel,
> >> You can't really set a call limit if you perform the redirects
> >> statelessly. Basically the server wouldn't know the call count per
> >> server if you did that.
> >>
> >> What I see most people do here is to add some sort of header like
> >> X-Original-IP with the original IP of the request. Then on the
> >> destination server(s), use that header if it is present.
> >>
> >> Of course, you should really remove any existing X-Original-IP
> >> headers before adding one to keep users from spoofing.
> >>
> >> -Brett
> >>
> >> On Wed, Aug 12, 2009 at 2:52 PM, Gabriel Georgescu
> >> <[hidden email] <mailto:[hidden email]> > wrote:
> >>
> >>     Hi List,
> >>
> >>     Can anybody give me an ideea? I try to implement a load balancing
> >>     scenario or call distribution to a farm of independent voip servers,
> >>     but the original caller IP has to be preserved. Because these servers
> >>     have their own billing based on original caller IP.
> >>     I understand that it might be possible to do this by answering to the
> >>     initial request with a 'redirect' message specifying eafch time the
> >>     new server IP.
> >>     Is this working, or is this the best way to do it?
> >>     Also I want to be able to probe if the independent servers are alive
> >>     and set a maximum calls redirected/minute limit for each server.
> >>     Can all this be done with opensips?
> >>
> >>     Thanks in advance,
> >>     Gabriel
> >>
> >>
> >>     _______________________________________________
> >>     Users mailing list
> >>     [hidden email] <mailto:[hidden email]>
> >>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >>
> >>
> >> _______________________________________________
> >> Users mailing list
> >> [hidden email]
> >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Users mailing list
> > [hidden email]
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
>
>
>_______________________________________________
>Users mailing list
>[hidden email]
>http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Redirect to independent servers

Bogdan-Andrei Iancu
Hi Gabriel

ok, but what exactly it is looking at in the SIP message ?  because
there are parts of the message you can change, other you cannot
change....Push a question to the vendor of the software.

Regards,
Bogdan

Gabriel Georgescu wrote:

> Hi,
>
> The software looks at SIP level for the caller's IP.
> I do not know exactly if in Contact header or in Owner address from
> message body but in any way it is RFC compliant and this canot be changed.
>
> Best regards,
> Gabriel
>
>
> At 11:47 AM 8/13/2009, Bogdan-Andrei Iancu wrote:
>  
>> Hi Gabriel,
>>
>> But the software you mentioned, where is it looking for the caller's IP
>> - network level? sip level ?
>>
>> Regards,
>> Bogdan
>>
>> Gabriel Georgescu wrote:
>>    
>>> Thank you for your detailed answer Brett!
>>> The problem with this additional X-Original-IP header is that it will
>>> not be recognized by the software on the destination voip server. And
>>> I cannot modify that software.
>>>
>>>
>>> At 12:58 AM 8/13/2009, Brett Nemeroff wrote:
>>>      
>>>> Gabriel,
>>>> You can't really set a call limit if you perform the redirects
>>>> statelessly. Basically the server wouldn't know the call count per
>>>> server if you did that.
>>>>
>>>> What I see most people do here is to add some sort of header like
>>>> X-Original-IP with the original IP of the request. Then on the
>>>> destination server(s), use that header if it is present.
>>>>
>>>> Of course, you should really remove any existing X-Original-IP
>>>> headers before adding one to keep users from spoofing.
>>>>
>>>> -Brett
>>>>
>>>> On Wed, Aug 12, 2009 at 2:52 PM, Gabriel Georgescu
>>>> <[hidden email] <mailto:[hidden email]> > wrote:
>>>>
>>>>     Hi List,
>>>>
>>>>     Can anybody give me an ideea? I try to implement a load balancing
>>>>     scenario or call distribution to a farm of independent voip servers,
>>>>     but the original caller IP has to be preserved. Because these servers
>>>>     have their own billing based on original caller IP.
>>>>     I understand that it might be possible to do this by answering to the
>>>>     initial request with a 'redirect' message specifying eafch time the
>>>>     new server IP.
>>>>     Is this working, or is this the best way to do it?
>>>>     Also I want to be able to probe if the independent servers are alive
>>>>     and set a maximum calls redirected/minute limit for each server.
>>>>     Can all this be done with opensips?
>>>>
>>>>     Thanks in advance,
>>>>     Gabriel
>>>>        

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users