[OpenSER-Devel] dialog callbacks: mi enhancements

Ovidiu Sas osas at voipembedded.com
Sat Apr 19 00:26:29 CEST 2008


Well ... this is still a callback, but a different type :)
But I got your message :)

Regards,
Ovidiu Sas

On Fri, Apr 18, 2008 at 6:01 PM, Dan Pascu <dan at ag-projects.com> wrote:
> On Saturday 19 April 2008, Dan Pascu wrote:
>  > > can create two wrappers around the generic dialog callback:
>  > >  - one would be the existing run_dlg_callback (and keep the existing
>  > > signature), - the other one would be run_mi_callback.
>  >
>  > Again, I do not see these just as the same thing. I see them as 2
>  > different interfaces. The existing one and a new one to move
>  > information the other way around.
>  > They may look the same because one will most likely implement this new
>  > interface using a callback mechanism too, but the distinction of which
>  > interface moves data in which direction is important IMO.
>
>  If I think a bit more of this, the new interface doesn't have to be
>  callback based. It can just be a simple function each module that wishes
>  to participate in providing extra MI information would register, and this
>  function should return a node list. Something like:
>
>  // in the module built on top of dialog
>
>  struct mi_node*
>  dialog_mi_helper(struct dlg_cell *dlg, void **param)
>  {
>   // build node list
>   return node_list;
>  }
>
>  ...
>  dlg_api.register_mi_helper(dialog_mi_helper, param);
>  ...
>
>
>  // in the dialog module
>
>  ...
>  mi_helper = module_mi_helper_list; // simple linked list
>  while (mi_helper) {
>    node_list = mi_helper->function(dlg, mi_helper->param);
>    // process node_list for displaying it
>    mi_helper = mi_helper->next;
>  }
>  ...
>
>  --
>  Dan



More information about the Devel mailing list