void sal_op_set_route(SalOp *op, const char *route){ char* route_string=(void *)0; SalOpBase* op_base = (SalOpBase*)op; if (op_base->route_addresses) { ms_list_for_each(op_base->route_addresses,(void (*)(void *))sal_address_destroy); op_base->route_addresses=ms_list_free(op_base->route_addresses); } if (route) { op_base->route_addresses=ms_list_append(NULL,NULL); assign_address((SalAddress**)&(op_base->route_addresses->data),route); route_string=sal_address_as_string((SalAddress*)op_base->route_addresses->data); \ } assign_string(&op_base->route,route_string); \ if(route_string) ms_free(route_string); }
void __sal_op_set_network_origin_address(SalOp *op, SalAddress *origin){ char* address_string=sal_address_as_string(origin); /*can probably be optimized*/ __sal_op_set_network_origin(op,address_string); ms_free(address_string); }
void sal_op_set_to_address(SalOp *op, const SalAddress *to){ char* address_string=sal_address_as_string(to); /*can probably be optimized*/ sal_op_set_to(op,address_string); ms_free(address_string); }
void sal_op_set_from_address(SalOp *op, const SalAddress *from){ char* address_string=sal_address_as_string(from); /*can probably be optimized*/ sal_op_set_from(op,address_string); ms_free(address_string); }
void sal_op_set_route_address(SalOp *op, const SalAddress *address){ char* address_string=sal_address_as_string(address); /*can probably be optimized*/ sal_op_set_route(op,address_string); ms_free(address_string); }
/** * Returns the address as a string. * The returned char * must be freed by the application. Use ms_free(). **/ char *linphone_address_as_string(const LinphoneAddress *u){ return sal_address_as_string(u); }