[OpenSIPS-Users] Event module setup

Pete Kelly pkelly at gmail.com
Wed Nov 30 17:00:09 CET 2011


I see..... does that work for 1.7 too?

On 30 November 2011 14:27, Razvan Crainea <razvancrainea at opensips.org>wrote:

>  Hi, Pete!
>
> I think that registering an event notification using the event_datagram
> module requires a timeout, but the event_rabbitmq doesn't. But what you can
> do is to subscribe the command directly from OpenSIPS script. There if you
> don't specify a timeout, the subscriber will be registered forever. You can
> find more information here[1]
>
> [1] http://www.opensips.org/Resources/DocsCoreFcn#toc148
>
>
> Regards,
>
> --
> Răzvan Crainea
> OpenSIPS Developer
>
>
> On 11/30/2011 04:20 PM, Pete Kelly wrote:
>
> One other quick question, the fifo for setting up the listeners specifies
> a timeout...
>
>  is it possible to set that to infinity (or until opensips is stopped?)
>
> On 30 November 2011 14:16, Pete Kelly <pkelly at gmail.com> wrote:
>
>> Thanks Razvan.
>>
>>  I used a really simply python script for this... don't know if you
>> would want to include in the docs?
>>
>>  import socket
>>  server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
>> server_socket.bind(("", 8085))
>>
>>  print "Server up on 8085"
>>
>>  while 1:
>>         data, address = server_socket.recvfrom(256)
>>         print "( " ,address[0], " " , address[1] , " ) said : ", data
>>
>>
>>
>>
>>
>>
>> On 30 November 2011 13:14, Razvan Crainea <razvancrainea at opensips.org>wrote:
>>
>>>  Hi, Pete!
>>>
>>> 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's not OpenSIPS's duty to create the socket, but the external
>>> application.
>>> Let me know if you need any more help.
>>>
>>> Regards,
>>>
>>> --
>>> Răzvan Crainea
>>> OpenSIPS Developer
>>>
>>>
>>> On 11/30/2011 02:58 PM, Pete Kelly wrote:
>>>
>>>  Hi
>>>
>>>  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:
>>>
>>>  In the script:
>>>
>>>   if(is_method("BYE")) {
>>>   xlog("BYE seen, raising event");
>>>   $avp(s:attr) = "number";
>>>  $avp(s:val) = 0;
>>>  $avp(s:attr) = "string";
>>>  $avp(s:val) = "dummy value";
>>>  raise_event("E_DUMMY", $avp(s:attr), $avp(s:val));
>>>  }
>>>
>>>
>>>  When opensips is started I am issuing this FIFO:
>>>
>>>  opensipsctl fifo event_subscribe E_DUMMY unix:/tmp/opensips_event.sock
>>> 1800
>>>
>>>
>>>  and I see this in the logs (debug=6)
>>>
>>>  Nov 30 12:57:00 pk-lenny /usr/local/opensips/sbin/opensips[4561]:
>>> DBG:mi_fifo:mi_parse_tree: adding node <> ; val <E_DUMMY>
>>> Nov 30 12:57:00 pk-lenny /usr/local/opensips/sbin/opensips[4561]:
>>> DBG:mi_fifo:mi_parse_tree: adding node <> ; val
>>> <unix:/tmp/opensips_event.sock>
>>> Nov 30 12:57:00 pk-lenny /usr/local/opensips/sbin/opensips[4561]:
>>> DBG:mi_fifo:mi_parse_tree: adding node <> ; val <1800>
>>> Nov 30 12:57:00 pk-lenny /usr/local/opensips/sbin/opensips[4561]:
>>> DBG:mi_fifo:mi_parse_node: end of input tree
>>> Nov 30 12:57:00 pk-lenny /usr/local/opensips/sbin/opensips[4561]:
>>> DBG:mi_fifo:mi_fifo_server: done parsing the mi tree
>>> Nov 30 12:57:00 pk-lenny /usr/local/opensips/sbin/opensips[4561]:
>>> DBG:event_datagram:datagram_parse: address is </tmp/opensips_event.sock>
>>> 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
>>>
>>>
>>>  However the file /tmp/opensips_event.sock is not created at all, even
>>> when the raise_event function is called.
>>>
>>>  Am I doing something wrong?
>>>
>>>
>>>  _______________________________________________
>>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20111130/c98ba527/attachment.htm>


More information about the Users mailing list