[OpenSIPS-Users] Raising an exported event with pseudo var

Răzvan Crainea razvan at opensips.org
Mon Aug 4 10:20:07 CEST 2014


Hi, Tito!

Unfortunately there is no mechanism to add extra information for static 
events.
However, there is a workaround for this: you can register a custom event:

startup_route {
     subscribe_event("E_MY_UL_AOR_DELETE", "rabbitmq:127.0.0.1/reg 
<http://127.0.0.1/reg>");
}

Then catch the initial event in an event_route and raise the custome event:

event_route[E_UL_AOR_DELETE] {
     fetch_event_params("aor=$avp(aor)");
     $avp(param) = $Ri;
     $avp(param) = $avp(aor);
     raise_event("E_MY_UL_AOR_DELETE", "$avp(param)");
}

So basically you have to add some kind of a wrapper on the original 
event where you can add extra information. The same thing should be done 
for the INSERT event. I hope this helpls.

Best regards,
Răzvan

On 08/01/2014 11:53 PM, Tito Cumpen wrote:
> Group,
>
>
> Can anyone share the procedure in which I can raise and exported event 
> and include a pseudo variable in the body? I need $Ri to be included 
> to provide a sense of identification as to which server is raising the 
> event
>
>
>
> startup_route {
>
> subscribe_event("E_UL_AOR_DELETE", "rabbitmq:127.0.0.1/reg 
> <http://127.0.0.1/reg>");
>
> subscribe_event("E_UL_AOR_INSERT", "rabbitmq:127.0.0.1/reg 
> <http://127.0.0.1/reg>");
>
>
> }
>
> I am getting a payload that defines the user being added and deleted 
> but I I wish to include the server which raised the event in the body 
> as well.
>
>
>
> Thanks,
>
> Tito
>
>
>
> _______________________________________________
> 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/20140804/5828e2f6/attachment.htm>


More information about the Users mailing list