[asterisk-dev] chan_sip.c: how to get phone source and destination
Fadil Sutomo
fsutomo at gmail.com
Mon Jul 30 16:06:35 CDT 2007
Hi Lorenzo,
Thank You for your help. Can you please tell me a little bit about
pbx_builtin_getvar_helper.. where it is located, what''s the return value,
etc.
Anyway, I am sorry, but maybe I have to explain what I am doing.
Basically, I create an extra field for each asterisk client (SIP client).
Say, "database location".
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) ?
Thank You
Fadil
On 7/29/07, Lorenzo Miniero <lorenzo.miniero at unina.it> wrote:
>
> On Sunday 29 July 2007 06:53:48 Fadil Sutomo wrote:
> > Hi all,
> >
> > I am a new member in this list.
> >
> > I have a newbie question.
> > Is there anyway that I can get the source and destination in chan_sip.c
> ?
> >
> > For example, if I am calling from GrandStream GXP 2000 to Xlite, then
> how
> > can I get:
> > "source:grandstream and destination:Xlite"
> >
> > Or alternatively, since I know that I can do this in app_dial.c, is
> there
> > anyway that I can access sip_pvt member? note that struct sip_pvt is
> > defined in chan_sip.c ?
> >
> > Thank You
>
>
> Hi Fadil,
>
> theres no way to directly access sip_pvt. But you can get the information
> you
> need through the pbx_builtin_getvar_helper method, accessing the abstract
> channel instead, e.g. pbx_builtin_getvar_helper(chan, "SIPUSERAGENT").
>
> Regards,
> Lorenzo
>
> --
> Lorenzo Miniero, Junior Researcher
> Dipartimento di Informatica e Sistemistica
> Università degli Studi di Napoli "Federico II"
> Via Claudio 21 -- 80125 Napoli (Italy)
> Phone: +390817683821 - Fax: +390817683816
> Email: lorenzo.miniero at unina.it
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20070730/5b4d2a0a/attachment.htm
More information about the asterisk-dev
mailing list