[asterisk-dev] chan_sip.c: how to get phone source and destination

Kevin P. Fleming kpfleming at digium.com
Mon Jul 30 16:26:49 CDT 2007


Fadil Sutomo wrote:

> In order to use this field, then each client has to use this field
> through sip.conf.
> For example:
> [Xlite]
> username=Fadil
> secret=fadil
> ..
> ..
> database_location=/home/fadil/MySQL
> 
> I modify chan_sip in order to do this.
> 
> Now, what I want to do is to access this location "on-the-fly", that is
> accessing this field while the phone is answered. And I am doing this in
> app_dial.c.
> 
> Now my question: is there any way from app_dial.c to access the field
> that I created in chan_sip.c (database_location) ?

It would do you good to read the sample config files and documentation;
this functionality is already available. Change that line to:

setvar=database_location=/home/fadil/MySQL

and you will magically have a variable called 'DATABASE_LOCATION' in the
dialplan (and elsewhere) with that value in it.

-- 
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - "The Genuine Asterisk Experience" (TM)



More information about the asterisk-dev mailing list