End to End KeepAlive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Empty body is ok for inside dialog INFO request.

Per RFC 2976
A 200 OK response MUST be sent by a UAS for an INFO request with no message
body if the INFO request was successfully received for an existing call


So you could use pjsua_call_send_request() to send INFO, and catch tsx
response at calback on_call_tsx_state().
And if your UA recv INFO with empty body in call, you need respond 200 OK,
otherwise 481

regards,
Gang
On Wed, May 20, 2009 at 2:23 AM, M.S. <hamstiede at yahoo.de> wrote:

>  Hi Gang Liu,
> i found a code snippet in pjusa for info request, but this code will
> send a DTMF string(dtmf-relay). Question, do you know the right "sip-style"
> to send
> the info request without DTMF, for the KeepAlive i think i need a empty
> request.
> It is possible to use another msg_data.content_type?
>  What do you think?
>
> thank you
>    mark
>
>  const pj_str_t <http://www.pjsip.org/pjlib/docs/html/structpj__str__t.htm> SIP_INFO = pj_str <http://www.pjsip.org/pjlib/docs/html/group__PJ__PSTR.htm#g20fa0c4d9ccddd0822a775730cf4a867>("INFO");
> 03703  pj_str_t <http://www.pjsip.org/pjlib/docs/html/structpj__str__t.htm> digits;
>
>
> 03719                 digits = pj_str <http://www.pjsip.org/pjlib/docs/html/group__PJ__PSTR.htm#g20fa0c4d9ccddd0822a775730cf4a867>(buf);
> 03720                 for (i=0; i<digits.slen <http://www.pjsip.org/pjlib/docs/html/structpj__str__t.htm#46788480bdb4080083dcc8965811e015>; ++i) {
> 03721                     pjsua_msg_data <http://www.pjsip.org/pjsip/docs/html/structpjsua__msg__data.htm> msg_data;
> 03722
>               char body[80];
> 03723
> 03724                     pjsua_msg_data_init <http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__BASE.htm#gc5d917f5344530d8eb3442450ddccd2d>(&msg_data);
> 03725                     msg_data.content_type <http://www.pjsip.org/pjsip/docs/html/structpjsua__msg__data.htm#cd4b9fa12c35d21f870635d9873fa596> = pj_str <http://www.pjsip.org/pjlib/docs/html/group__PJ__PSTR.htm#g20fa0c4d9ccddd0822a775730cf4a867>("application/dtmf-relay");
> 03726
> 03727                     pj_ansi_snprintf(body, sizeof(body),
> 03728
>      "Signal=%c\r\n"
> 03729                                      "Duration=160",
> 03730                                      buf[i]);
> 03731                     msg_data.msg_body <http://www.pjsip.org/pjsip/docs/html/structpjsua__msg__data.htm#9e8f81b8932ea6630b819632cb4bcdca> = pj_str <http://www.pjsip.org/pjlib/docs/html/group__PJ__PSTR.htm#g20fa0c4d9ccddd0822a775730cf4a867>(body);
> 03732
> 03733                     status = pjsua_call_send_request <http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__CALL.htm#g2bc70969ec7b6c7a63e9f220cd7110d8>(current_call, &SIP_INFO,
> 03734
>           &msg_data);
>
>
>
>
>  ------------------------------
> *Von:* Gang Liu <gangban.lau at gmail.com>
> *An:* pjsip list <pjsip at lists.pjsip.org>
> *Gesendet:* Dienstag, den 19. Mai 2009, 15:44:29 Uhr
> *Betreff:* Re: [pjsip] End to End KeepAlive
>
> If both agent are your program, you could use OPTIONS or INFO request to
> check signal path.
> session-timer not supported by pjsip current version.
>
> regards,
> Gang
>
> On Tue, May 19, 2009 at 3:57 PM, M.S. <hamstiede at yahoo.de> wrote:
>
>>  Hi,
>> I have this situation:
>>
>> SIP-Agent 1  <---> Registrar <-----> SIP Agent 2
>>  If i kill the connection (cut the network) between Registrar and SIP
>> Agent 2, Agent 1 will
>> not close the connection.
>>
>> If it possible to make a simple End - to End Keep Alive.  I tryed REINVITE
>> and UPDATE  for Agent 1
>> but both will rebuild my media streams (not really good for the voice)
>>
>> regards
>>
>>   Mark
>>
>>
>>
>> _______________________________________________
>> Visit our blog: http://blog.pjsip.org
>>
>> pjsip mailing list
>> pjsip at lists.pjsip.org
>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>
>>
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090520/e8a06313/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux