[Asterisk-Dev] Multiple Routes for an * channel

Eric Liedtke e at musinghalfwit.org
Tue Oct 12 16:07:26 MST 2004


I recently started poking around chan_sip to look into the 300 "Multiple
Choices" support. I found that enabling the promiscredir I could at
least use the first route, however I needed to be able to process and
use all the routes returned.

I started looking into being able to support this in chan_sip and the
more I looked, the more it seemed to make sense to implement this in the base
ast_channel. I figured a route_list type construct could be used by more
than just chan_sip. Perhaps the EnumLookup() or even SRV lookup's would 
then be able to use multiple routes, process weights,  etc. 

I did a proof of concept implementation with a simple linked list added
to ast_channel and created the necessary auxillary funtions to add
routes, free the list, etc.

I think the actual internal behaviour is a little screwy though, I
copied the methodology used in the parse_moved_contact but employed it
in app_dial's wait_for_answer(). Basically if there is still a route
on the list then I move it into the call_forward field with that route
and then free() that entry from the list. It then copies remaining
routes into the list of the new channel. If the call get's answered I
also free the list.

As this is my first foray into the guts of * I am just looking for
comments on the idea and any advice as to perhaps, a "more proper" 
methodology for dealing with multiple routes than just setting the
call_forward of a channel every time..

-e



More information about the asterisk-dev mailing list