<div dir="ltr">Thanks for looking at it, I have put in a notice message in the failure_route and it's not showing in the log which suggests it's not triggering this route at all.<div><br></div><div>I don't think it is treating the 401 as a failure route.</div>
<div><br></div><div>Keith<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Oct 8, 2013 at 1:54 PM,  <span dir="ltr"><<a href="mailto:sr-users-request@lists.sip-router.org" target="_blank">sr-users-request@lists.sip-router.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send sr-users mailing list submissions to<br>
        <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:sr-users-request@lists.sip-router.org">sr-users-request@lists.sip-router.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:sr-users-owner@lists.sip-router.org">sr-users-owner@lists.sip-router.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of sr-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Re: On register (Keith)<br>
   2. Re: On register (Daniel-Constantin Mierla)<br>
   3. Re: Apply changes made to sip reply in onreply_route<br>
      (Klaus Darilion)<br>
   4. Re: Presence: Duplicate entry<br>
      'username-domain-presence-*#-OFFLINE-#*' for key 'presentity_idx'<br>
      when multiple clients register using the same credentials (Yufei Tao)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 8 Oct 2013 12:31:20 +0100<br>
From: Keith <<a href="mailto:keith@hubner.co.uk">keith@hubner.co.uk</a>><br>
To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -<br>
        Users   Mailing List" <<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
Subject: Re: [SR-Users] On register<br>
Message-ID:<br>
        <CAK7Ybu96QT+xt6BqJCjemai5En8uZ7VHigCg=<a href="mailto:AFvpP5tUYKXWw@mail.gmail.com">AFvpP5tUYKXWw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi,<br>
<br>
I am trying to "on register" from kamailio to an asterisk box. I am having<br>
trouble when asterisk sends a 401 to the first register response. I have<br>
tried to set a failure route as follows:<br>
t_on_failure("FAILURE_HANDLE");<br>
<br>
failure_route[FAILURE_HANDLE] {<br>
<br>
       if (t_is_canceled()) {<br>
exit;<br>
}<br>
<br>
       if(t_check_status("401")) {<br>
          uac_auth();<br>
       }<br>
<br>
<br>
<br>
       t_relay();<br>
    }<br>
<br>
But it doesn't see to send the credentials back.<br>
<br>
Any help would be appreciated.<br>
Thanks.<br>
Keith<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.sip-router.org/pipermail/sr-users/attachments/20131008/880c82c1/attachment-0001.html" target="_blank">http://lists.sip-router.org/pipermail/sr-users/attachments/20131008/880c82c1/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 08 Oct 2013 13:36:57 +0200<br>
From: Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>><br>
To: "Kamailio (SER) - Users Mailing List"<br>
        <<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
Subject: Re: [SR-Users] On register<br>
Message-ID: <<a href="mailto:5253EE59.6030906@gmail.com">5253EE59.6030906@gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"<br>
<br>
Hello,<br>
<br>
haven't had time to look into sources, can you try:<br>
<br>
$ru = $ru;<br>
<br>
after uac_auth()?<br>
<br>
What I am trying to discover is if uac_auth() creates a new branch,<br>
because if it doesn't and you don't update any of the elements related<br>
to next hop address, kamailio won't detect there is need for a new relay.<br>
<br>
If still doesn't work, then provide the log messages with debug=3 in<br>
config file.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
On 10/8/13 1:31 PM, Keith wrote:<br>
> Hi,<br>
><br>
> I am trying to "on register" from kamailio to an asterisk box. I am<br>
> having trouble when asterisk sends a 401 to the first register<br>
> response. I have tried to set a failure route as follows:<br>
> t_on_failure("FAILURE_HANDLE");<br>
><br>
> failure_route[FAILURE_HANDLE] {<br>
><br>
>        if (t_is_canceled()) {<br>
> exit;<br>
> }<br>
><br>
>        if(t_check_status("401")) {<br>
>           uac_auth();<br>
>        }<br>
><br>
><br>
>        t_relay();<br>
>     }<br>
><br>
> But it doesn't see to send the credentials back.<br>
><br>
> Any help would be appreciated.<br>
> Thanks.<br>
> Keith<br>
><br>
><br>
> _______________________________________________<br>
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
--<br>
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a><br>
Kamailio Advanced Trainings - Berlin, Nov 25-28; Miami, Nov 18-20, 2013<br>
   - more details about Kamailio trainings at <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a> -<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.sip-router.org/pipermail/sr-users/attachments/20131008/318c7a9a/attachment-0001.html" target="_blank">http://lists.sip-router.org/pipermail/sr-users/attachments/20131008/318c7a9a/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Tue, 08 Oct 2013 14:50:40 +0200<br>
From: Klaus Darilion <<a href="mailto:klaus.mailinglists@pernau.at">klaus.mailinglists@pernau.at</a>><br>
To: <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
Subject: Re: [SR-Users] Apply changes made to sip reply in<br>
        onreply_route<br>
Message-ID: <<a href="mailto:5253FFA0.7070201@pernau.at">5253FFA0.7070201@pernau.at</a>><br>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"<br>
<br>
Am 08.10.2013 12:14, schrieb Grant Bagdasarian:<br>
><br>
> Hello,<br>
><br>
> I've setup two Kamailio machines, one which does all the processing<br>
> and the second one which always replies with a 500 Server Internal<br>
> Error, to test my Dispatcher fail-over.<br>
><br>
> When routing a call, the call is always routed to the second Kamailio<br>
> first, to test the fail-over.<br>
><br>
> What happens in this scenario is the 500 is received by the main<br>
> Kamailio and the 500 message is duplicated to the capture server.<br>
> After this the failure_route kicks in and the 500 is obviously never<br>
> sent back to the initiator.<br>
><br>
> The changes made to the 500 message  (adding a new header), in<br>
> onreply_route, aren't present when the message is duplicated to the<br>
> capture server, because the original 500 message is duplicated instead<br>
> of the modified one.<br>
><br>
Out of curiosity -why do you add a header to the response if it is<br>
likely to be dropped (depending of the response in the second branch)?<br>
Just to signal data to the capture server?<br>
<br>
klaus<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.sip-router.org/pipermail/sr-users/attachments/20131008/d68c13e0/attachment-0001.html" target="_blank">http://lists.sip-router.org/pipermail/sr-users/attachments/20131008/d68c13e0/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Tue, 8 Oct 2013 13:54:47 +0100<br>
From: Yufei Tao <<a href="mailto:yufei.tao@redembedded.com">yufei.tao@redembedded.com</a>><br>
To: <<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
Subject: Re: [SR-Users] Presence: Duplicate entry<br>
        'username-domain-presence-*#-OFFLINE-#*' for key 'presentity_idx' when<br>
        multiple clients register using the same credentials<br>
Message-ID: <<a href="mailto:52540097.9080408@redembedded.com">52540097.9080408@redembedded.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Thank you Juha for your replies!<br>
<br>
>From RFC3856:<br>
<br>
A Presence Event Package for the Session Initiation Protocol (SIP)<br>
<br>
<br>
6.11.  State Agents<br>
<br>
   RFC 3265 [2] requires each package to consider the role of state<br>
   agents in the package, and if they are used, to specify how<br>
   authentication and authorization are done.<br>
<br>
   State agents are core to this package.  Whenever the PA is not<br>
   co-located with the PUA for the presentity, the PA is acting as a<br>
   state agent.  It collects presence state from the PUA, and aggregates<br>
   it into a presence document.  Because there can be multiple PUA, a<br>
   centralized state agent is needed to perform this aggregation.  That<br>
   is why state agents are fundamental to presence.  Indeed, they have a<br>
   specific term that describes them - a presence server.<br>
<br>
Seems the presence server needs to aggregate statuses from different PUAs for the same presentity into a single presence document, if I understand it correctly? Anyway it is not what happens currently with Kamailio 4.0.3 unless I'm missing anything.<br>

<br>
Cheers,<br>
Yufei<br>
<br>
On 08/10/13 11:00, <a href="mailto:sr-users-request@lists.sip-router.org">sr-users-request@lists.sip-router.org</a><mailto:<a href="mailto:sr-users-request@lists.sip-router.org">sr-users-request@lists.sip-router.org</a>> wrote:<br>

<br>
Message: 2<br>
Date: Mon, 7 Oct 2013 13:31:17 +0300<br>
From: Juha Heinanen <<a href="mailto:jh@tutpro.com">jh@tutpro.com</a>><mailto:<a href="mailto:jh@tutpro.com">jh@tutpro.com</a>><br>
To: "Kamailio \(SER\) - Users Mailing List"<br>
        <<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
Subject: Re: [SR-Users] Presence: Duplicate entry<br>
        'username-domain-presence-*#-OFFLINE-#*' for key 'presentity_idx' when<br>
        multiple clients register using the same credentials<br>
Message-ID: <<a href="mailto:21074.36213.575240.614265@siika.tutpro.com">21074.36213.575240.614265@siika.tutpro.com</a>><mailto:<a href="mailto:21074.36213.575240.614265@siika.tutpro.com">21074.36213.575240.614265@siika.tutpro.com</a>><br>

Content-Type: text/plain; charset=us-ascii<br>
<br>
Yufei Tao writes:<br>
<br>
<br>
<br>
> When a client (S) subscribes to this contact (username@domain) whose<br>
> credentials are used by two clients, (S) gets NOTIFYs containing<br>
> statuses from either of the username@domain contacts in alternation. But<br>
> all these NOTIFYs have the same call-id.<br>
><br>
> I've tried remove the constraint 'CONSTRAINT presentity_idx UNIQUE<br>
> (username, domain, event, etag)' from the presentity table and the<br>
> errors have gone away. Just wondering if this is something that *should*<br>
> be done to cope with the situation where multiple presentities use the<br>
> same credentials.<br>
<br>
<br>
before knowing how to answer to that, i would like to know what presence<br>
rfcs say about this situation, i.e., is current kamailio presence<br>
implementation somehow broken when an aor (= presentity) has several<br>
active contacts.<br>
<br>
should notify give status of both contacts separately or should presence<br>
server try somehow to combine status of the contacts into a single<br>
notify?  what does it mean if one contact tells that it is offline and<br>
another online?  should presence server send only one notify telling<br>
that the presentity is online (since it is if one contact tells so)?<br>
<br>
-- juha<br>
<br>
<br>
<br>
<br>
On 05/10/13 11:00, <a href="mailto:sr-users-request@lists.sip-router.org">sr-users-request@lists.sip-router.org</a><mailto:<a href="mailto:sr-users-request@lists.sip-router.org">sr-users-request@lists.sip-router.org</a>> wrote:<br>

<br>
<br>
Hi<br>
<br>
I use kamailio 4.0.3 with presence. I sometimes get these errors:<br>
<br>
Oct  4 09:26:24 server /usr/sbin/kamailio[1292]: ERROR: presence<br>
[publish.c:171]: msg_presentity_clean(): Marking presentity<br>
Oct  4 09:26:34 server /usr/sbin/kamailio[1292]: ERROR: db_mysql<br>
[km_dbase.c:122]: db_mysql_submit_query(): driver error on query:<br>
Duplicate entry 'username-domain-presence-*#-OFFLINE-#*' for key<br>
'presentity_idx'<br>
Oct  4 09:26:34 server /usr/sbin/kamailio[1292]: ERROR: <core><br>
[db_query.c:337]: db_do_update(): error while submitting query<br>
Oct  4 09:26:34 server /usr/sbin/kamailio[1292]: ERROR: presence<br>
[presentity.c:1281]: mark_presentity_for_delete(): unsuccessful sql<br>
update operation<br>
<br>
This is when multiple SIP clients are registered using the same<br>
credentials, they each have a presentity entry, with the same username<br>
and domain but different etags, which is fine. But when they expire, the<br>
presentity.etag will be filled with '*#-OFFLINE-#*', and when both<br>
expire at about the same time, kamailio tries to fill both with the same<br>
'*#-OFFLINE-#*' etag. Because presentity table has a 'CONSTRAINT<br>
presentity_idx UNIQUE (username, domain, event, etag)', this gives the<br>
errors.<br>
<br>
Should the constraint be removed to cope with this situation?<br>
<br>
Thank you!<br>
Yufei<br>
<br>
--<br>
Yufei Tao<br>
Red Embedded<br>
<br>
This E-mail and any attachments hereto are strictly confidential and intended solely for the addressee. If you are not the intended addressee please notify the sender by return and delete the message.<br>
<br>
You must not disclose, forward or copy this E-mail or attachments to any third party without the prior consent of the sender.<br>
<br>
Red Embedded Design, Company Number 06688253 Registered in England: The Waterfront, Salts Mill Rd, Saltaire, BD17 7EZ<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.sip-router.org/pipermail/sr-users/attachments/20131008/41e137a4/attachment.html" target="_blank">http://lists.sip-router.org/pipermail/sr-users/attachments/20131008/41e137a4/attachment.html</a>><br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
<br>
End of sr-users Digest, Vol 101, Issue 32<br>
*****************************************<br>
</blockquote></div><br></div></div></div>