[asterisk-dev] SIP Custom Fields

Samir S samir.bot at gmail.com
Wed Sep 26 17:17:44 CDT 2007


I am also having a similar question, however with the additional requirement
that my headers, need to go end-to-end between the two SIP clients as well.
If you just need to do only server-side processing of these new headers,
then it should be fairly straightfoward.
a. you need to extract the headers in channels/chan_sip.c in find_call() and
handle_response(), assuming that you have headers in both requests and
responses.
b. invoke appropriate
If you do NOT need to pass on the headers to the other end-point, it should
not be difficult, since by default Asterisk acts like a b2bua and does not
seem to pass on proprietary/extended headers from one end-point to the
other.

However, (in my view) it gets difficult if you *need* to pass on these
headers between the endpoints.
1. You  need to parse them and store them in sip_pvt structure
2. In the appropriate application logic (mostly, it would be pbx), you need
to copy these headers into incoming ast_channel
3. You need to copy them from incoming ast_channel to the outgoing one.
4. finally, in the outgoing sip channel, you need to again copy them to
sip_pvt and then encode them into the outgoing SIP message...

And this is  for the requests...I have still not been able to figure out how
to do this for responses..
viz. how to find the corresponding ast_channel, to copy them back from the
incoming to the outgoing response..

I just wish, there was an easier generic way to pass on these extended
headers from one end to another.
Or maybe there is, which I am not aware of. ..

hope this helps.
Samir



On 9/26/07, Hitesh Tewari <htewari at hotmail.com> wrote:
>
>
> Hello,
>
> We would like to carry some proprietary payment info in our initial INVITE
> message from the client to our SIP server.
> To do the same we are considering using one of the unused SDP fields or
> creating one of our own and
> transporting the info within the same.
>
> As we need to send the payment info periodically we are planning on making
> use of the UPDATE or re-INVITE
> methods and sending an updated SDP to the proxy. At the SIP server end we
> intend to make use of
> an Asterisk server and be able to extract out the payment info field
> before forwarding the INVITE or UPDATE.
>
> My question is that would this be a reasonable thing to do in Asterisk?
> Any guidance from you would be greatly appreciated. Many thanks for your
> time.
>
>
> Hitesh
> _________________________________________________________________
> Connect and share instantly with the world's most popular IM network.
> http://get.live.com/en-ie/messenger/overview
> _______________________________________________
>
> Sign up now for AstriCon 2007!  September 25-28th.
> http://www.astricon.net/
>
> --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/20070927/27180db6/attachment.htm 


More information about the asterisk-dev mailing list