[asterisk-dev] How to get SIP packet source ip address in asterisk application

ast guy astguy at gmail.com
Mon Nov 23 17:34:23 CST 2009


Thanks, I will give it a try!

/ag

On Mon, Nov 16, 2009 at 8:28 AM, Kai Hoerner <kai at ciphron.de> wrote:

> Hi,
>
> i suggest you leave the authentication to the asterisk SIP stack and
> only let the authenticated peer enter the right context that contains
> your call to Application().
>
>
> if you really plan to implement authentication on your own (i see no
> good reason for that) you should start by looking at the "ast_channel"
> and "sip_pvt" structs. "sip_pvt" holds all information about the active
> SIP "dialog" (i.e. "call" in this case)
>
> channel->tech_pvt is a pointer from the ast_channel abstraction to the
> SIP tech-specific object. (of type sip_pvt)
> Before accessing any of its properties you want to check if the channel
> is type SIP.
>
> http://www.asterisk.org/doxygen/asterisk1.6.2/structsip__pvt.html
>
>
> ast guy schrieb:
> > Hi,
> >
> >  I have made an application an asterisk. Can any one tell how do I get
> > the source IP address of the SIP packets inside my app_Application()?
> > Application only gets the ast_channel variable and *data passed to it.
> >
> > SIP Call is being forwarded to my application from some Service
> > Provider. So when app_Applicaiton() is in execute state then I want to
> > get the sip source packet ip address and then authenticate it.
> >
> > Regards,
> > /ag
> >
> > _______________________________________________
> > --Bandwidth and Colocation Provided by http://www.api-digital.com--
> >
> > asterisk-dev mailing list
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-dev
> >
> >
>
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20091124/aab1affb/attachment.htm 


More information about the asterisk-dev mailing list