Advertisement
Guest User

Untitled

a guest
Aug 26th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. static switch_status_t enviar_mensaje(switch_core_session_t *session, svb_routing_data_t *rt, const char *usuario_dispositivo, const char *host, const char *mensaje)
  2. {
  3.     switch_event_t *event;
  4.  
  5.     if (switch_event_create(&event, SWITCH_EVENT_SEND_MESSAGE) == SWITCH_STATUS_SUCCESS) {
  6.         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user", usuario_dispositivo);
  7.         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "host", host);
  8.         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "profile", "internal");
  9.         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "content-type", "text/plain");
  10.         switch_event_add_body(event, "%s", mensaje);
  11.  
  12.         switch_event_fire(&event);
  13.     }
  14.  
  15.     return SWITCH_STATUS_SUCCESS;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement