Hi Kumar, There is some code available for sending "MESSAGE" in the sipxstacklib. I can't remember the filename, but you can search and basically replicate it.
However, I think you are trying some P2P here and I am wondering if PUBLISH is the right approach in this case. I believe it should be NOTIFY since the destination client should be able to interoperate with your client. On another note, I hope your clients are not behind NATs since you may need to do some bootstrapping in that case (sending message directly may work inconsistently). Medhavi. On 7/5/07, KUMAR <[EMAIL PROTECTED]> wrote:
Amith, can you send me the code to your api. I will very much appreciate it. Thank you kumar On 7/5/07, Amith Nambiar <[EMAIL PROTECTED]> wrote: > Kumar, > I had posted a similar question a couple of months ago. And i > got to know from > Jaroslav Libak that sipxtapi does not have an API fo sending PUBLISH > messages, but you could use sipxstacklib to send PUBLISH messages. > > Quoting Jaroslav: > > <Quote> > SipXtapi can't send PUBLISH messages or > receive them. You can only subscribe for NOTIFY. sipxPublisherCreate is > used for creating a context for receiving SUBSCRIBE and sending NOTIFY. > > Have a look at sipxtacklib. In SipMessage.h there is SIP_PUBLISH_METHOD > "PUBLISH" > > Also have a look at SipMessage::setPublishData > > So you will have to use sipxtacklib directly, create a SipMessage, call > setPublishData, setResponseListenerQueue and SipUserAgent::send. > > </Quote> > I have written an Api for sending PUBLISH requests (had to write it in a > day, so is badly written ) to send PUBLISH Requests. > And it is'nt very difficult to do it using sipxstacklib. > > > Hope this helps. > > -Amith > > > > http://www.mail-archive.com/[email protected]/msg01169.html > > > On 7/5/07, KUMAR <[EMAIL PROTECTED] > wrote: > > Thanks Amith, > > > > Thanks for your response. That cleared out a lot of things. However, > > one more thing that I want to know is how do i send the PUBLISH from > > the application layer using sipXtapi. > > > > Also, isn't sending PUBLISH only useful if you have presence server. > > What if I want to implement end-to-end presence ? Is there any way I > > can do that using sipxtapi ? > > > > kumar > > > > > > On 7/5/07, Amith Nambiar <[EMAIL PROTECTED]> wrote: > > > Well, you do get a EVENT_CATEGORY_NOTIFY event after you subscribe only > if > > > the other UA (Publisher) PUBLISH'es it's state change by sending a > PUBLISH > > > to the server (This PUBLISH has to be periodic, even if there is no > state > > > change, the PUBLISH should go out from the PUBLISH'er) > > > > > > RFC Session Initiation Protocol (SIP) Extension > > > for Event State Publication > > > Section 4.3 > > > > > > A publication refresh only extends the expiration time of already > > > existing event state. It does not affect that event state in any > > > other way. Therefore, a PUBLISH request that refreshes event state > > > MUST NOT have a body. > > > > > > . The server in turn NOTIFY's the SUBSCRIBE'r of the event change using > > > NOTIFY requests. > > > > > > You let other users know of your state change by sending a PUBLISH out > from > > > the application layer. > > > > > > -Amith > > > > > > > > > On 7/5/07, KUMAR < [EMAIL PROTECTED]> wrote: > > > > > > > > Hi all, > > > > I think I was unclear(maybe mistaken) while writing my previous post. > > > > When I Subscribe, I receive a 202 Accepted from the other end, as well > > > > as NOTIFY. But at the application level, I only get > > > > EVENT_CATEGORY_SUB_STATUS. Shouldn't I also be getting an > > > > EVENT_CATEGORY_NOTIFY type event. > > > > Also, I would like to know how to let other users know when I change > > > > my presence status ? > > > > > > > > Thank you > > > > kumar > > > > > > > > > > > > ---------- Forwarded message ---------- > > > > From: KUMAR < [EMAIL PROTECTED]> > > > > Date: Jul 5, 2007 9:56 AM > > > > Subject: Presence > > > > To: [email protected] > > > > > > > > > > > > Hi all, > > > > I'm trying to write a UA, with end-to-end presence support. I'm a bit > > > > confused about it. Here's what I'm doing. > > > > I want to be notified when the user at the other end changes his/her > > > status. > > > > > > > > > > > > sipxPublisherCreate(h_UA,&h_Pub,"sip:[EMAIL PROTECTED] ","presence","application/pidf+xml","Online",6); > > > > sipxConfigSubscribe(h_UA,h_Line," > sip:[EMAIL PROTECTED] > > > > ","presence","application/pidf+xml",CONTACT_AUTO,&h_Sub); > > > > > > > > Now, when this code executes, a SUBSCRIBE message is sent to user > > > > [EMAIL PROTECTED], I get a NOTIFY, which raises SUBSCRIPTION_ACTIVE > > > event. > > > > > > > > At no time do i get an EVENT_CATEGORY_NOTIFY. > > > > > > > > Even when the user at other end ([EMAIL PROTECTED] ) changes his status, > > > > no NOTIFY gets send. > > > > I'm doing > > > > > > > > sipxPublisherUpdate(h_Pub,"application/pidf+xml","Busy",4); > > > > at the other end when status is changed. > > > > > > > > My question is, how do I make the API send NOTIFY when the user > > > > changes his status ? > > > > > > > > Thank you > > > > kumar > > > > _______________________________________________ > > > > sipxtapi-dev mailing list > > > > [email protected] > > > > List Archive: > > > http://list.sipfoundry.org/archive/sipxtapi-dev/ > > > > > > > > > > > > > > _______________________________________________ sipxtapi-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/
-- Medhavi Bhatia CTO, 3CLogic www.3clogic.com
_______________________________________________ sipxtapi-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/
