I see..... does that work for 1.7 too?<br><br><div class="gmail_quote">On 30 November 2011 14:27, Razvan Crainea <span dir="ltr">&lt;<a href="mailto:razvancrainea@opensips.org">razvancrainea@opensips.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hi, Pete!<br>
    <br>
    I think that registering an event notification using the
    event_datagram module requires a timeout, but the event_rabbitmq
    doesn&#39;t. But what you can do is to subscribe the command directly
    from OpenSIPS script. There if you don&#39;t specify a timeout, the
    subscriber will be registered forever. You can find more information
    here[1]<br>
    <br>
    [1]
    
    <a href="http://www.opensips.org/Resources/DocsCoreFcn#toc148" target="_blank">http://www.opensips.org/Resources/DocsCoreFcn#toc148</a><div class="im"><br>
    <br>
    Regards,<br>
    <pre cols="72">--
Răzvan Crainea
OpenSIPS Developer</pre>
    <br></div><div><div class="h5">
    On 11/30/2011 04:20 PM, Pete Kelly wrote:
    <blockquote type="cite">One other quick question, the fifo for setting up the
      listeners specifies a timeout... 
      <div><br>
      </div>
      <div>is it possible to set that to infinity (or until opensips is
        stopped?)<br>
        <br>
        <div class="gmail_quote">On 30 November 2011 14:16, Pete Kelly <span dir="ltr">&lt;<a href="mailto:pkelly@gmail.com" target="_blank">pkelly@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks
            Razvan.
            <div><br>
            </div>
            <div>I used a really simply python script for this... don&#39;t
              know if you would want to include in the docs?</div>
            <div><br>
            </div>
            <div>import socket</div>
            <div>
              <div>server_socket = socket.socket(socket.AF_INET,
                socket.SOCK_DGRAM)</div>
              <div>server_socket.bind((&quot;&quot;, 8085))</div>
              <div><br>
              </div>
              <div>print &quot;Server up on 8085&quot;</div>
              <div><br>
              </div>
              <div>while 1:</div>
              <div>        data, address = server_socket.recvfrom(256)</div>
              <div>        print &quot;( &quot; ,address[0], &quot; &quot; , address[1] , &quot;
                ) said : &quot;, data</div>
            </div>
            <div>
              <div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div><br>
                  <div class="gmail_quote">On 30 November 2011 13:14,
                    Razvan Crainea <span dir="ltr">&lt;<a href="mailto:razvancrainea@opensips.org" target="_blank">razvancrainea@opensips.org</a>&gt;</span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div bgcolor="#FFFFFF" text="#000000"> Hi, Pete!<br>
                        <br>
                        In order to use OpenSIPS Event Interface, you
                        need to create an external application that
                        listens for an event. This application should
                        create the UNIX socket used for communication,
                        and then subscribe to OpenSIPS for a certain
                        event, using the event_subscribe MI command.
                        When the event is raised, OpenSIPS searches all
                        the subscribers registered for that specific
                        event, and notifies them through the socket
                        provided at subscription. Therefore it&#39;s not
                        OpenSIPS&#39;s duty to create the socket, but the
                        external application. <br>
                        Let me know if you need any more help.<br>
                        <br>
                        Regards,<br>
                        <pre cols="72">--
Răzvan Crainea
OpenSIPS Developer</pre>
                        <div>
                          <div> <br>
                            On 11/30/2011 02:58 PM, Pete Kelly wrote: </div>
                        </div>
                        <blockquote type="cite">
                          <div>
                            <div>Hi
                              <div><br>
                              </div>
                              <div>I am using opensips 1.7 and would
                                like to raise an event when I see a BYE,
                                however I am struggling with the
                                documentation as it stands. This is what
                                I am doing:</div>
                              <div><br>
                              </div>
                              <div>In the script:</div>
                              <div><br>
                              </div>
                              <div>
                                <div><span style="white-space:pre-wrap">
                                  </span>if(is_method(&quot;BYE&quot;)) {</div>
                                <div><span style="white-space:pre-wrap">
                                  </span></div>
                                <div><span style="white-space:pre-wrap">
                                  </span>xlog(&quot;BYE seen, raising
                                  event&quot;);</div>
                                <div><span style="white-space:pre-wrap">
                                  </span></div>
                                <div><span style="white-space:pre-wrap">
                                  </span>$avp(s:attr) = &quot;number&quot;;</div>
                                <div><span style="white-space:pre-wrap">
                                  </span>$avp(s:val) = 0;</div>
                                <div><span style="white-space:pre-wrap">
                                  </span>$avp(s:attr) = &quot;string&quot;;</div>
                                <div><span style="white-space:pre-wrap">
                                  </span>$avp(s:val) = &quot;dummy value&quot;;</div>
                                <div><span style="white-space:pre-wrap">
                                  </span>raise_event(&quot;E_DUMMY&quot;,
                                  $avp(s:attr), $avp(s:val));</div>
                                <div><span style="white-space:pre-wrap">
                                  </span>}</div>
                              </div>
                              <div> <br>
                              </div>
                              <div><br>
                              </div>
                              <div>When opensips is started I am issuing
                                this FIFO:</div>
                              <div><br>
                              </div>
                              <div>opensipsctl fifo event_subscribe
                                E_DUMMY unix:/tmp/opensips_event.sock
                                1800</div>
                              <div><br>
                              </div>
                              <div><br>
                              </div>
                              <div>and I see this in the logs (debug=6)</div>
                              <div><br>
                              </div>
                              <div>
                                <div>Nov 30 12:57:00 pk-lenny
                                  /usr/local/opensips/sbin/opensips[4561]:
                                  DBG:mi_fifo:mi_parse_tree: adding node
                                  &lt;&gt; ; val &lt;E_DUMMY&gt;</div>
                                <div>Nov 30 12:57:00 pk-lenny
                                  /usr/local/opensips/sbin/opensips[4561]:
                                  DBG:mi_fifo:mi_parse_tree: adding node
                                  &lt;&gt; ; val
                                  &lt;unix:/tmp/opensips_event.sock&gt;</div>
                                <div>Nov 30 12:57:00 pk-lenny
                                  /usr/local/opensips/sbin/opensips[4561]:
                                  DBG:mi_fifo:mi_parse_tree: adding node
                                  &lt;&gt; ; val &lt;1800&gt;</div>
                                <div>Nov 30 12:57:00 pk-lenny
                                  /usr/local/opensips/sbin/opensips[4561]:
                                  DBG:mi_fifo:mi_parse_node: end of
                                  input tree</div>
                                <div>Nov 30 12:57:00 pk-lenny
                                  /usr/local/opensips/sbin/opensips[4561]:
                                  DBG:mi_fifo:mi_fifo_server: done
                                  parsing the mi tree</div>
                                <div>Nov 30 12:57:00 pk-lenny
                                  /usr/local/opensips/sbin/opensips[4561]:
                                  DBG:event_datagram:datagram_parse:
                                  address is
                                  &lt;/tmp/opensips_event.sock&gt;</div>
                                <div>Nov 30 12:57:00 pk-lenny
                                  /usr/local/opensips/sbin/opensips[4561]:
                                  DBG:event_datagram:datagram_match:
                                  socket matched
                                  /tmp/opensips_event.sock:0</div>
                              </div>
                              <div><br>
                              </div>
                              <div><br>
                              </div>
                              <div>However the file
                                /tmp/opensips_event.sock is not created
                                at all, even when the raise_event
                                function is called. </div>
                              <div><br>
                              </div>
                              <div>Am I doing something wrong?</div>
                              <br>
                              <fieldset></fieldset>
                              <br>
                            </div>
                          </div>
                          <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                        </blockquote>
                      </div>
                      <br>
                      _______________________________________________<br>
                      Users mailing list<br>
                      <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
                      <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                      <br>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
  </div></div></div>

</blockquote></div><br>