[asterisk-dev] [Code Review] func_srv and explicit specification of destination for SIP outgoing INVITEs

Russell Bryant russell at digium.com
Sat Apr 10 13:27:00 CDT 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/608/#review1822
-----------------------------------------------------------


I know this has already been committed, but it's easiest to add my comments here.

I don't see an update to sip.conf.sample in here.  The sample config has SIP dial string syntax documentation that needs to be updated.


/trunk/funcs/func_srv.c
<https://reviewboard.asterisk.org/r/608/#comment3916>

    This should be 2010



/trunk/funcs/func_srv.c
<https://reviewboard.asterisk.org/r/608/#comment3918>

    The channel needs to be in autoservice during this operation.



/trunk/funcs/func_srv.c
<https://reviewboard.asterisk.org/r/608/#comment3917>

    trailing whitespace



/trunk/funcs/func_srv.c
<https://reviewboard.asterisk.org/r/608/#comment3919>

    The res handling in this code is a bit bizarre, and doesn't guarantee a valid return value.


- Russell


On 2010-04-07 15:28:47, Mark Michelson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/608/
> -----------------------------------------------------------
> 
> (Updated 2010-04-07 15:28:47)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> There are two interrelated changes here.
> 
> First, there is the introduction of func_srv. This adds two new read-only dialplan functions, SRVQUERY and SRVRESULT. They work very similarly to the ENUMQUERY and ENUMRESULT functions, except that this allows one to query SRV records instead. In order to facilitate this work, I added a couple of new API calls to srv.h. ast_srv_get_record_count tells the number of records returned by an SRV lookup. This number is calculated at the time of the SRV lookup. ast_srv_get_nth_record allows one to get a numbered SRV record.
> 
> Second, there is the modification to chan_sip that allows one to specify a hostname or IP address (along with a port) to send an outgoing INVITE to when dialing a SIP peer. This goes hand-in-hand with func_srv. You can query SRV records and then use the host and port from the results to dial via a specific host instead of what is configured in sip.conf.
> 
> 
> Diffs
> -----
> 
>   /trunk/channels/chan_sip.c 256421 
>   /trunk/funcs/func_srv.c PRE-CREATION 
>   /trunk/include/asterisk/srv.h 256421 
>   /trunk/main/srv.c 256421 
> 
> Diff: https://reviewboard.asterisk.org/r/608/diff
> 
> 
> Testing
> -------
> 
> I have written two external tests which exercise the individual components of this patch. They will be uploaded in a separate code review.
> 
> 
> Thanks,
> 
> Mark
> 
>




More information about the asterisk-dev mailing list