Skip to content

Commit

Permalink
freeswitch: Add a FS URL parsing function
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Feb 8, 2017
1 parent 77ba9d9 commit 0d716d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/freeswitch/fs_api.c
Expand Up @@ -38,6 +38,16 @@ static fs_mod_ref *mk_fs_mod_ref(str *tag, ev_hb_cb_f cbf, const void *priv);
static void free_fs_mod_ref(fs_mod_ref *mref);
static fs_evs *get_fs_evs(str *hostport);

int is_fs_url(str *in)
{
if (in->len < FS_SOCK_PREFIX_LEN ||
memcmp(in->s, FS_SOCK_PREFIX, FS_SOCK_PREFIX_LEN) != 0) {
return 0;
}

return 1;
}

static void parse_fs_url(str *in, str *host_out, unsigned int *port_out)
{
str st = *in;
Expand Down
2 changes: 2 additions & 0 deletions modules/freeswitch/fs_api.h
Expand Up @@ -110,6 +110,8 @@ struct fs_binds {
del_hb_evs_f del_hb_evs;
};

int is_fs_url(str *in);

typedef int (*bind_fs_t)(struct fs_binds *fsb);
static inline int load_fs_api(struct fs_binds *fsb)
{
Expand Down

0 comments on commit 0d716d9

Please sign in to comment.