[Users] t_relay() to a destination set by dispatcher

Peter Childs peter.childs at nec.com.au
Wed Jul 12 08:20:30 CEST 2006


you can include the port in the dispatcher.list file ie
1 sip:somehost:someport
2 sip:someotherhost:someotherport

As for the TCP->UDP bit you could include the "uri.so" module and try

ds_select_domain("1", "0");
add_uri_param("transport=UDP");
t_relay();

The docs say that the add_uri_param will only work from the ROUTE
function, so handling gateway failover could be an issue if you can't do
it from the FAILURE_ROUTE thing...

You could also try "avpops.so" module and try

ds_select_domain("1", "0");
avp_printf("$avp(i:123)", "$ru;transport=UDP" );
avp_pushto("$ru", "$avp(i:123)" );
t_relay();

and similar in your FAILURE_ROUTE block.

In theory (??) you should not have to do a ds_select_domain() with the
CANCEL branch as the destination should already be known to OpenSER (as
it routed the INVITE), so you should just be able to t_relay() it...

I don't have a TCP SIP initiator to test any of this, but perhaps it
will help...

Perhaps a feature request for the dispatcher module to support transport
types as well??

On Tue, 2006-07-11 at 13:49 -0700, Radu Maierean wrote:
> hi all,
> 
> i need to use the dispatcher module to route (load-balanced) an incoming
> SIP request to one of my bunch of asterisk machines. openser (1.1.0, the
> only one that implements the dispatcher as i need it) is also supposed
> to translate from TCP (the protocol that my peer gateway uses) to UDP
> (the only protocol that asterisk knows - snip).
> 
> my attempt was this:
> 
> # routing INVITE and CANCEL messages received from the gateway to
> Asterisk
> if (uri=~"^sip:\+1[0-9]+ at xx\.xx\.xx\.xx") {
>    t_on_failure("2");
>    if ((method=="INVITE") || (method=="CANCEL")) {
>       ds_select_dst("1", "0");
>       t_relay("udp:$dd:5061");
>       return;
>    }
> }





More information about the Users mailing list