<p>If a call fails without receiving a provisional reply first, it will trigger an error:<br>
ERROR:pua_dialoginfo:dialog_publish: sending publish failed for pres_uri [SIP URI] to server [SERVER]</p>

<p>The issue here is that the call is in trying state and then is terminated.<br>
If we set:<br>
modparam("pua_dialoginfo", "publish_on_trying", 1)<br>
the error doesn't occur because an initial PUBLISH is sent for trying.</p>

<p>If the "publish_on_trying" parameter is not set (the default value being 0), then the first PUBLISH is sent when the dialog is terminated.  The PUBLISH has an expiration set to 0 and since there was no previous states published before, pua does not send any PUBLISH, hence the error.</p>

<p>The relevant pua code (pua/send_publish.c send_publish_int):<br>
    if(presentity== NULL)<br>
    {<br>
        if(publ-&gt;expires== 0)<br>
        {<br>
            LM_DBG("request for a publish with expires 0 and"<br>
                    " no record found\n");<br>
            goto error;<br>
        }</p>

<p>The fix should be in pua_dialoginfo, there should be no PUBLISH sent out when:</p>

<ul>
<li>the call is transitioning from early to terminated;</li>
<li>the publish_on_trying parameter is set to 0.</li>
</ul><p>To test this, a call should be made to a SIP device that will reject the call without sending any 18x provisional replies first.</p>

<p>Regards,<br>
Ovidiu Sas</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href='https://github.com/OpenSIPS/opensips/issues/142'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/cHRwG-eeZpfKR_UBFXzvRDKp_nkrC0SkttmwABkZO_dJt_K_7ypuMGiALuWxz4oy.gif' height='1' width='1'></p>