sip-lab 1.11.4 → 1.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -3
- package/binding.gyp +1 -0
- package/index.js +23 -13
- package/install.sh +12 -1
- package/package.json +2 -1
- package/samples/{late_negotiation.js → delayed_media.js} +22 -25
- package/samples/g729.js +11 -11
- package/samples/register_subscribe.js +30 -7
- package/samples/reinvite_and_dtmf.js +22 -24
- package/samples/send_and_receive_fax.js +13 -17
- package/samples/simple.js +76 -39
- package/samples/sip_cancel.js +10 -12
- package/samples/tcp_and_extra_headers.js +333 -0
- package/src/addon.cpp +107 -498
- package/src/event_templates.cpp +22 -22
- package/src/event_templates.hpp +10 -10
- package/src/sip.cpp +1267 -599
- package/src/sip.hpp +58 -17
package/src/sip.hpp
CHANGED
|
@@ -11,49 +11,90 @@
|
|
|
11
11
|
|
|
12
12
|
#define FLAG_NO_AUTO_100_TRYING 1
|
|
13
13
|
|
|
14
|
-
#define
|
|
14
|
+
#define CALL_FLAG_DELAYED_MEDIA 1
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
int __pjw_init();
|
|
18
18
|
int __pjw_poll(char *out_evt);
|
|
19
|
-
int pjw_transport_create(const char *sip_ipaddr, int port, pjsip_transport_type_e type, int *out_t_id, int *out_port);
|
|
20
|
-
int pjw_transport_get_info(int t_id, char *out_sip_ipaddr, int *out_port);
|
|
21
19
|
|
|
22
|
-
int
|
|
23
|
-
int
|
|
20
|
+
//int pjw_transport_create(const char *sip_ipaddr, int port, pjsip_transport_type_e type, int *out_t_id, int *out_port);
|
|
21
|
+
int pjw_transport_create(const char *json, int *out_t_id, char *out_t_address, int *out_port);
|
|
22
|
+
|
|
23
|
+
int pjw_transport_get_info(int t_id, char **out_sip_ipaddr, int *out_port);
|
|
24
|
+
|
|
25
|
+
//int pjw_account_create(int t_id, const char *domain, const char *server, const char *username, const char *password, const char *additional_headers, const char *c_to_url, int expires, int *out_acc_id);
|
|
26
|
+
int pjw_account_create(int t_id, const char *json, int *out_acc_id);
|
|
27
|
+
|
|
28
|
+
//int pjw_account_register(long acc_id, pj_bool_t autoreg);
|
|
29
|
+
int pjw_account_register(long acc_id, const char *json);
|
|
30
|
+
|
|
24
31
|
int pjw_account_unregister(long acc_id);
|
|
25
32
|
|
|
26
|
-
int pjw_call_create(long t_id, unsigned flags, const char *from_uri, const char *to_uri, const char *request_uri, const char *proxy_uri, const char *additional_headers, const char *realm, const char *username, const char *password, long *out_call_id, char *out_sip_call_id);
|
|
27
|
-
int
|
|
28
|
-
|
|
29
|
-
int
|
|
30
|
-
int
|
|
31
|
-
|
|
33
|
+
//int pjw_call_create(long t_id, unsigned flags, const char *from_uri, const char *to_uri, const char *request_uri, const char *proxy_uri, const char *additional_headers, const char *realm, const char *username, const char *password, long *out_call_id, char *out_sip_call_id);
|
|
34
|
+
int pjw_call_create(long t_id, const char *json, long *out_call_id, char *out_sip_call_id);
|
|
35
|
+
|
|
36
|
+
//int pjw_call_respond(long call_id, int code, const char *reason, const char *additional_headers);
|
|
37
|
+
int pjw_call_respond(long call_id, const char *json);
|
|
38
|
+
|
|
39
|
+
//int pjw_call_terminate(long call_id, int code, const char *reason, const char *additional_headers);
|
|
40
|
+
int pjw_call_terminate(long call_id, const char *json);
|
|
41
|
+
|
|
42
|
+
//int pjw_call_send_dtmf(long call_id, const char *digits, int mode);
|
|
43
|
+
int pjw_call_send_dtmf(long call_id, const char *json);
|
|
44
|
+
|
|
45
|
+
//int pjw_call_reinvite(long call_id, int hold, unsigned flags);
|
|
46
|
+
int pjw_call_reinvite(long call_id, const char *json);
|
|
47
|
+
|
|
48
|
+
//int pjw_call_send_request(long call_id, const char *method_name, const char *additional_headers, const char *body, const char *ct_type, const char *ct_subtype);
|
|
49
|
+
int pjw_call_send_request(long call_id, const char *json);
|
|
50
|
+
|
|
51
|
+
//int pjw_call_start_record_wav(long call_id, const char *file);
|
|
32
52
|
int pjw_call_start_record_wav(long call_id, const char *file);
|
|
53
|
+
|
|
54
|
+
//int pjw_call_start_play_wav(long call_id, const char *file);
|
|
33
55
|
int pjw_call_start_play_wav(long call_id, const char *file);
|
|
56
|
+
|
|
34
57
|
int pjw_call_stop_play_wav(long call_id);
|
|
58
|
+
|
|
35
59
|
int pjw_call_stop_record_wav(long call_id);
|
|
36
|
-
|
|
60
|
+
|
|
61
|
+
//int pjw_call_start_fax(long call_id, bool is_sender, const char *file);
|
|
62
|
+
int pjw_call_start_fax(long call_id, const char *json);
|
|
63
|
+
|
|
37
64
|
int pjw_call_stop_fax(long call_id);
|
|
65
|
+
|
|
38
66
|
int pjw_call_get_stream_stat(long call_id, char *out_stats);
|
|
39
|
-
|
|
67
|
+
|
|
68
|
+
//int pjw_call_refer(long call_id, const char *dest_uri, const char *additional_headers, long *out_subscription_id);
|
|
69
|
+
int pjw_call_refer(long call_id, const char *json, long *out_subscription_id);
|
|
70
|
+
|
|
40
71
|
int pjw_call_get_info(long call_id, const char *required_info, char *out_info);
|
|
72
|
+
|
|
41
73
|
int pjw_call_gen_string_replaces(long call_id, char *out_replaces);
|
|
42
74
|
|
|
43
75
|
int pjw_packetdump_start(const char *dev, const char *file);
|
|
76
|
+
|
|
44
77
|
int pjw_packetdump_stop();
|
|
45
78
|
|
|
46
79
|
int pjw_get_codecs(char *out_codecs);
|
|
80
|
+
|
|
47
81
|
int pjw_set_codecs(const char *in_codec_info);
|
|
82
|
+
|
|
48
83
|
int __pjw_shutdown();
|
|
49
84
|
|
|
50
|
-
int pjw_notify(long subscriber_id, const char *content_type, const char *body, int subscription_state, const char *reason, const char *additional_headers);
|
|
51
|
-
int
|
|
85
|
+
//int pjw_notify(long subscriber_id, const char *content_type, const char *body, int subscription_state, const char *reason, const char *additional_headers);
|
|
86
|
+
int pjw_notify(long subscriber_id, const char *json);
|
|
87
|
+
|
|
88
|
+
//int pjw_notify_xfer(long subscriber_id, int subscription_state, int xfer_status_code, const char *xfer_status_text);
|
|
89
|
+
int pjw_notify_xfer(long subscriber_id, const char *json);
|
|
52
90
|
|
|
53
91
|
int pjw_register_pkg(const char *event, const char *accept);
|
|
54
92
|
|
|
55
|
-
int pjw_subscription_create(long transport_id, const char *event, const char *accept, const char *from_uri, const char *to_uri, const char *request_uri, const char *proxy_uri, const char *realm, const char *username, const char *password, long *out_subscription_id);
|
|
56
|
-
int
|
|
93
|
+
//int pjw_subscription_create(long transport_id, const char *event, const char *accept, const char *from_uri, const char *to_uri, const char *request_uri, const char *proxy_uri, const char *realm, const char *username, const char *password, long *out_subscription_id);
|
|
94
|
+
int pjw_subscription_create(long transport_id, const char *json, long *out_subscription_id);
|
|
95
|
+
|
|
96
|
+
//int pjw_subscription_subscribe(long subscription_id, int expires, const char *additional_headers);
|
|
97
|
+
int pjw_subscription_subscribe(long subscription_id, const char *json);
|
|
57
98
|
|
|
58
99
|
int pjw_log_level(long log_level);
|
|
59
100
|
|