oms_aa_dest_addr_get()
Abstract
Obtains a destination address at random from an address list.
Syntax
oms_aa_dest_addr_get (oms_aa_handle, dest_address_ptr)
| Argument | Type | Description |
|---|---|---|
oms_aa_handle |
OmsT_Aa_Address_Handle |
Handle to the list for the specific address type |
dest_address_ptr |
int * |
Memory address to which the address will be copied |
Return Type
void
No value returned
Details
If dest_address_ptr points to a number equal to OMSC_AA_AUTO_ADDRESS, this procedure chooses an address at random from the address list and copies it into the location referenced by dest_address_ptr. If dest_address_ptr points to an explicit address (i.e., any number other than OMSC_AA_AUTO_ADDRESS), this procedure leaves the value "as is" and exits.
Example
From csms_pbx process model, setup enter execs:
/ If the destination is specified as AUTO ASSIGNED */
/* pick a packet from the pool of available addresses */
/* Else the address has been specified and should be */
/* used as-is. */
if (dest_address == OMSC_AA_AUTO_ASSIGN)
{
/* Call function to generate a random destination */
/* from the pool of available addresses. */
/* Also make sure that my own address isn't picked */
/* for destination. */
do
{
call_dest_address = OMSC_AA_AUTO_ASSIGN;
oms_aa_dest_addr_get (oms_aa_handle,
&call_dest_address);
} while (call_dest_address == my_address);
else
call_dest_address = dest_address;