-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpjsua.htm
1862 lines (1524 loc) · 122 KB
/
pjsua.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module pjsua</title>
<LINK href="/style/style.css" type="text/css" rel="stylesheet">
</head><body bgcolor="#f0f0f8">
<!--#include virtual="/header.html" -->
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>pjsua</strong></big></big></font></td
><td align=right valign=bottom >
</td></tr></table>
<p><tt>Multimedia communication client library based on SIP protocol.<br>
<br>
This implements a fully featured multimedia communication client <br>
library based on PJSIP stack (<a href="http://www.pjsip.org">http://www.pjsip.org</a>)<br>
<br>
<br>
1. FEATURES<br>
<br>
- Session Initiation Protocol (SIP) features:<br>
- Basic registration and call<br>
- Multiple accounts<br>
- <a href="#Call">Call</a> hold, attended and unattended call transfer<br>
- Presence<br>
- Instant messaging<br>
- Multiple SIP accounts<br>
- Media features:<br>
- Audio<br>
- Conferencing<br>
- Narrowband and wideband<br>
- Codecs: PCMA, PCMU, GSM, iLBC, Speex, G.722, L16<br>
- RTP/RTCP<br>
- Secure RTP (SRTP)<br>
- WAV playback, recording, and playlist<br>
- NAT traversal features<br>
- Symmetric RTP<br>
- STUN<br>
- TURN<br>
- ICE<br>
<br>
<br>
2. USING<br>
<br>
See <a href="http://www.pjsip.org/trac/wiki/Python_SIP_Tutorial">http://www.pjsip.org/trac/wiki/Python_SIP_Tutorial</a> for a more thorough<br> tutorial.
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>
<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="#Account">Account</a>
</font></dt><dt><font face="helvetica, arial"><a href="#AccountCallback">AccountCallback</a>
</font></dt><dt><font face="helvetica, arial"><a href="#AccountConfig">AccountConfig</a>
</font></dt><dt><font face="helvetica, arial"><a href="#AccountInfo">AccountInfo</a>
</font></dt><dt><font face="helvetica, arial"><a href="#AuthCred">AuthCred</a>
</font></dt><dt><font face="helvetica, arial"><a href="#Buddy">Buddy</a>
</font></dt><dt><font face="helvetica, arial"><a href="#BuddyCallback">BuddyCallback</a>
</font></dt><dt><font face="helvetica, arial"><a href="#BuddyInfo">BuddyInfo</a>
</font></dt><dt><font face="helvetica, arial"><a href="#Call">Call</a>
</font></dt><dt><font face="helvetica, arial"><a href="#CallCallback">CallCallback</a>
</font></dt><dt><font face="helvetica, arial"><a href="#CallInfo">CallInfo</a>
</font></dt><dt><font face="helvetica, arial"><a href="#CallRole">CallRole</a>
</font></dt><dt><font face="helvetica, arial"><a href="#CallState">CallState</a>
</font></dt><dt><font face="helvetica, arial"><a href="#CodecInfo">CodecInfo</a>
</font></dt><dt><font face="helvetica, arial"><a href="#CodecParameter">CodecParameter</a>
</font></dt><dt><font face="helvetica, arial"><a href="#Error">Error</a>
</font></dt><dt><font face="helvetica, arial"><a href="#Lib">Lib</a>
</font></dt><dt><font face="helvetica, arial"><a href="#LogConfig">LogConfig</a>
</font></dt><dt><font face="helvetica, arial"><a href="#MediaConfig">MediaConfig</a>
</font></dt><dt><font face="helvetica, arial"><a href="#MediaDir">MediaDir</a>
</font></dt><dt><font face="helvetica, arial"><a href="#MediaState">MediaState</a>
</font></dt><dt><font face="helvetica, arial"><a href="#PresenceActivity">PresenceActivity</a>
</font></dt><dt><font face="helvetica, arial"><a href="#SIPUri">SIPUri</a>
</font></dt><dt><font face="helvetica, arial"><a href="#SoundDeviceInfo">SoundDeviceInfo</a>
</font></dt><dt><font face="helvetica, arial"><a href="#SubscriptionState">SubscriptionState</a>
</font></dt><dt><font face="helvetica, arial"><a href="#TURNConnType">TURNConnType</a>
</font></dt><dt><font face="helvetica, arial"><a href="#Transport">Transport</a>
</font></dt><dt><font face="helvetica, arial"><a href="#TransportConfig">TransportConfig</a>
</font></dt><dt><font face="helvetica, arial"><a href="#TransportFlag">TransportFlag</a>
</font></dt><dt><font face="helvetica, arial"><a href="#TransportInfo">TransportInfo</a>
</font></dt><dt><font face="helvetica, arial"><a href="#TransportType">TransportType</a>
</font></dt><dt><font face="helvetica, arial"><a href="#UAConfig">UAConfig</a>
</font></dt></dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Account">class <strong>Account</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This describes SIP account class.<br>
<br>
PJSUA accounts provide identity (or identities) of the user who is <br>
currently using the application. In SIP terms, the identity is used <br>
as the From header in outgoing requests.<br>
<br>
<a href="#Account">Account</a> may or may not have client registration associated with it. <br>
An account is also associated with route set and some authentication <br>
credentials, which are used when sending SIP request messages using <br>
the account. An account also has presence's online status, which <br>
will be reported to remote peer when they subscribe to the account's <br>
presence, or which is published to a presence server if presence <br>
publication is enabled for the account.<br>
<br>
<a href="#Account">Account</a> is created with <a href="#Lib">Lib</a>.create_account(). At least one account <br>
MUST be created. If no user association is required, application can <br>
create a userless account by calling <a href="#Lib">Lib</a>.create_account_for_transport().<br>
A userless account identifies local endpoint instead of a particular <br>
user, and it correspond with a particular transport instance.<br>
<br>
Also one account must be set as the default account, which is used as <br>
the account to use when PJSUA fails to match a request with any other<br>
accounts.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Account-__del__"><strong>__del__</strong></a>(self)</dt></dl>
<dl><dt><a name="Account-__init__"><strong>__init__</strong></a>(self, lib, id, cb<font color="#909090">=None</font>)</dt><dd><tt>Construct this class. This is normally called by <a href="#Lib">Lib</a> class and<br>
not by application.<br>
<br>
Keyword arguments:<br>
lib -- the <a href="#Lib">Lib</a> instance.<br>
id -- the pjsua account ID.<br>
cb -- <a href="#AccountCallback">AccountCallback</a> instance to receive events from this <a href="#Account">Account</a>.<br>
If callback is not specified here, it must be set later<br>
using <a href="#Account-set_callback">set_callback</a>().</tt></dd></dl>
<dl><dt><a name="Account-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<dl><dt><a name="Account-add_buddy"><strong>add_buddy</strong></a>(self, uri, cb<font color="#909090">=None</font>)</dt><dd><tt>Add new buddy.<br>
<br>
Keyword argument:<br>
uri -- SIP URI of the buddy<br>
cb -- <a href="#BuddyCallback">BuddyCallback</a> instance to be installed to the newly<br>
created <a href="#Buddy">Buddy</a> object. If this callback is not specified<br>
(i.e. None is given), it must be installed later using<br>
buddy.<a href="#Account-set_callback">set_callback</a>().<br>
<br>
Return:<br>
<a href="#Buddy">Buddy</a> object</tt></dd></dl>
<dl><dt><a name="Account-delete"><strong>delete</strong></a>(self)</dt><dd><tt>Delete this account.</tt></dd></dl>
<dl><dt><a name="Account-info"><strong>info</strong></a>(self)</dt><dd><tt>Retrieve <a href="#AccountInfo">AccountInfo</a> for this account.</tt></dd></dl>
<dl><dt><a name="Account-is_default"><strong>is_default</strong></a>(self)</dt><dd><tt>Check if this account is the default account.</tt></dd></dl>
<dl><dt><a name="Account-is_valid"><strong>is_valid</strong></a>(self)</dt><dd><tt>Check if this account is still valid.</tt></dd></dl>
<dl><dt><a name="Account-make_call"><strong>make_call</strong></a>(self, dst_uri, cb<font color="#909090">=None</font>, hdr_list<font color="#909090">=None</font>)</dt><dd><tt>Make outgoing call to the specified URI.<br>
<br>
Keyword arguments:<br>
dst_uri -- Destination SIP URI.<br>
cb -- <a href="#CallCallback">CallCallback</a> instance to be installed to the newly<br>
created <a href="#Call">Call</a> object. If this <a href="#CallCallback">CallCallback</a> is not<br>
specified (i.e. None is given), it must be installed<br>
later using call.<a href="#Account-set_callback">set_callback</a>().<br>
hdr_list -- Optional list of headers to be sent with outgoing<br>
INVITE<br>
<br>
Return:<br>
<a href="#Call">Call</a> instance.</tt></dd></dl>
<dl><dt><a name="Account-pres_notify"><strong>pres_notify</strong></a>(self, pres_obj, state, reason<font color="#909090">=''</font>, hdr_list<font color="#909090">=None</font>)</dt><dd><tt>Send NOTIFY to inform account presence status or to terminate<br>
server side presence subscription.<br>
<br>
Keyword arguments:<br>
pres_obj -- The subscription object from on_incoming_subscribe()<br>
callback<br>
state -- Subscription state, from <a href="#SubscriptionState">SubscriptionState</a><br>
reason -- Optional reason phrase.<br>
hdr_list -- Optional header list.</tt></dd></dl>
<dl><dt><a name="Account-set_basic_status"><strong>set_basic_status</strong></a>(self, is_online)</dt><dd><tt>Set basic presence status of this account.<br>
<br>
Keyword argument:<br>
is_online -- boolean to indicate basic presence availability.</tt></dd></dl>
<dl><dt><a name="Account-set_callback"><strong>set_callback</strong></a>(self, cb)</dt><dd><tt>Register callback to receive notifications from this object.<br>
<br>
Keyword argument:<br>
cb -- <a href="#AccountCallback">AccountCallback</a> instance.</tt></dd></dl>
<dl><dt><a name="Account-set_default"><strong>set_default</strong></a>(self)</dt><dd><tt>Set this account as default account to send outgoing requests<br>
and as the account to receive incoming requests when more exact<br>
matching criteria fails.</tt></dd></dl>
<dl><dt><a name="Account-set_presence_status"><strong>set_presence_status</strong></a>(self, is_online, activity<font color="#909090">=0</font>, pres_text<font color="#909090">=''</font>, rpid_id<font color="#909090">=''</font>)</dt><dd><tt>Set presence status of this account. <br>
<br>
Keyword arguments:<br>
is_online -- boolean to indicate basic presence availability<br>
activity -- value from <a href="#PresenceActivity">PresenceActivity</a><br>
pres_text -- optional string to convey additional information about<br>
the activity (such as "On the phone")<br>
rpid_id -- optional string to be placed as RPID ID.</tt></dd></dl>
<dl><dt><a name="Account-set_registration"><strong>set_registration</strong></a>(self, renew)</dt><dd><tt>Manually renew registration or unregister from the server.<br>
<br>
Keyword argument:<br>
renew -- boolean to indicate whether registration is renewed.<br>
Setting this value for False will trigger unregistration.</tt></dd></dl>
<dl><dt><a name="Account-set_transport"><strong>set_transport</strong></a>(self, transport)</dt><dd><tt>Set this account to only use the specified transport to send<br>
outgoing requests.<br>
<br>
Keyword argument:<br>
transport -- <a href="#Transport">Transport</a> object.</tt></dd></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="AccountCallback">class <strong>AccountCallback</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Class to receive notifications on account's events.<br>
<br>
Derive a class from this class and register it to the <a href="#Account">Account</a> object<br>
using <a href="#Account">Account</a>.set_callback() to start receiving events from the <a href="#Account">Account</a><br>
object.<br>
<br>
Member documentation:<br>
<br>
account -- the <a href="#Account">Account</a> object.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="AccountCallback-__del__"><strong>__del__</strong></a>(self)</dt></dl>
<dl><dt><a name="AccountCallback-__init__"><strong>__init__</strong></a>(self, account<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="AccountCallback-on_incoming_call"><strong>on_incoming_call</strong></a>(self, call)</dt><dd><tt>Notification about incoming call.<br>
<br>
Unless this callback is implemented, the default behavior is to<br>
reject the call with default status code.<br>
<br>
Keyword arguments:<br>
call -- the new incoming call</tt></dd></dl>
<dl><dt><a name="AccountCallback-on_incoming_subscribe"><strong>on_incoming_subscribe</strong></a>(self, buddy, from_uri, contact_uri, pres_obj)</dt><dd><tt>Notification when incoming SUBSCRIBE request is received. <br>
<br>
Application may use this callback to authorize the incoming <br>
subscribe request (e.g. ask user permission if the request <br>
should be granted)<br>
<br>
Keyword arguments:<br>
buddy -- The buddy object, if buddy is found. Otherwise<br>
the value is None.<br>
from_uri -- The URI string of the sender.<br>
pres_obj -- Opaque presence subscription object, which is<br>
needed by <a href="#Account">Account</a>.pres_notify()<br>
<br>
Return:<br>
Tuple (code, reason), where:<br>
code: The status code. If code is >= 300, the<br>
request is rejected. If code is 200, the<br>
request is accepted and NOTIFY will be sent<br>
automatically. If code is 202, application<br>
must accept or reject the request later with<br>
<a href="#Account">Account</a>.press_notify().<br>
reason: Optional reason phrase, or None to use the<br>
default reasoh phrase for the status code.</tt></dd></dl>
<dl><dt><a name="AccountCallback-on_pager"><strong>on_pager</strong></a>(self, from_uri, contact, mime_type, body)</dt><dd><tt>Notification that incoming instant message is received on<br>
this account.<br>
<br>
Keyword arguments:<br>
from_uri -- sender's URI<br>
contact -- sender's Contact URI<br>
mime_type -- MIME type of the instant message body<br>
body -- the instant message body</tt></dd></dl>
<dl><dt><a name="AccountCallback-on_pager_status"><strong>on_pager_status</strong></a>(self, to_uri, body, im_id, code, reason)</dt><dd><tt>Notification about the delivery status of previously sent<br>
instant message.<br>
<br>
Keyword arguments:<br>
to_uri -- the destination URI of the message<br>
body -- the message body<br>
im_id -- message ID<br>
code -- SIP status code<br>
reason -- SIP reason phrase</tt></dd></dl>
<dl><dt><a name="AccountCallback-on_reg_state"><strong>on_reg_state</strong></a>(self)</dt><dd><tt>Notification that the registration status has changed.</tt></dd></dl>
<dl><dt><a name="AccountCallback-on_typing"><strong>on_typing</strong></a>(self, from_uri, contact, is_typing)</dt><dd><tt>Notification that remote is typing or stop typing.<br>
<br>
Keyword arguments:<br>
buddy -- <a href="#Buddy">Buddy</a> object for the sender, if found. Otherwise<br>
this will be None<br>
from_uri -- sender's URI of the indication<br>
contact -- sender's contact URI<br>
is_typing -- boolean to indicate whether remote is currently<br>
typing an instant message.</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>account</strong> = None</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="AccountConfig">class <strong>AccountConfig</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This describes account configuration to create an account.<br>
<br>
Member documentation:<br>
<br>
priority -- account priority for matching incoming<br>
messages.<br>
id -- SIP URI of this account. This setting is<br>
mandatory.<br>
force_contact -- force to use this URI as Contact URI. Setting<br>
this value is generally not recommended.<br>
reg_uri -- specify the registrar URI. Mandatory if<br>
registration is required.<br>
reg_timeout -- specify the SIP registration refresh interval<br>
in seconds.<br>
require_100rel -- specify if reliable provisional response is<br>
to be enforced (with Require header).<br>
publish_enabled -- specify if PUBLISH should be used. When<br>
enabled, the PUBLISH will be sent to the<br>
registrar.<br>
pidf_tuple_id -- optionally specify the tuple ID in outgoing<br>
PIDF document.<br>
proxy -- list of proxy URI.<br>
auth_cred -- list of <a href="#AuthCred">AuthCred</a> containing credentials to<br>
authenticate against the registrars and<br>
the proxies.<br>
auth_initial_send -- specify if empty Authorization header should be<br>
sent. May be needed for IMS.<br>
auth_initial_algorithm -- when auth_initial_send is enabled, optionally<br>
specify the authentication algorithm to use.<br>
Valid values are "md5", "akav1-md5", or<br>
"akav2-md5". <br>
transport_id -- optionally specify the transport ID to be used<br>
by this account. Shouldn't be needed unless<br>
for specific requirements (e.g. in multi-homed<br>
scenario).<br>
allow_contact_rewrite -- specify whether the account should learn its<br>
Contact address from REGISTER response and <br>
update the registration accordingly. Default is<br>
True.<br>
ka_interval -- specify the interval to send NAT keep-alive <br>
packet.<br>
ka_data -- specify the NAT keep-alive packet contents.<br>
use_srtp -- specify the SRTP usage policy. Valid values<br>
are: 0=disable, 1=optional, 2=mandatory.<br>
Default is 0.<br>
srtp_secure_signaling -- specify the signaling security level required<br>
by SRTP. Valid values are: 0=no secure <br>
transport is required, 1=hop-by-hop secure<br>
transport such as TLS is required, 2=end-to-<br>
end secure transport is required (i.e. "sips").<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="AccountConfig-__init__"><strong>__init__</strong></a>(self, domain<font color="#909090">=''</font>, username<font color="#909090">=''</font>, password<font color="#909090">=''</font>, display<font color="#909090">=''</font>, registrar<font color="#909090">=''</font>, proxy<font color="#909090">=''</font>)</dt><dd><tt>Construct account config. If domain argument is specified, <br>
a typical configuration will be built.<br>
<br>
Keyword arguments:<br>
domain -- domain name of the server.<br>
username -- user name.<br>
password -- plain-text password.<br>
display -- optional display name for the user name.<br>
registrar -- the registrar URI. If domain name is specified<br>
and this argument is empty, the registrar URI<br>
will be constructed from the domain name.<br>
proxy -- the proxy URI. If domain name is specified<br>
and this argument is empty, the proxy URI<br>
will be constructed from the domain name.</tt></dd></dl>
<dl><dt><a name="AccountConfig-build_config"><strong>build_config</strong></a>(self, domain, username, password, display<font color="#909090">=''</font>, registrar<font color="#909090">=''</font>, proxy<font color="#909090">=''</font>)</dt><dd><tt>Construct account config. If domain argument is specified, <br>
a typical configuration will be built.<br>
<br>
Keyword arguments:<br>
domain -- domain name of the server.<br>
username -- user name.<br>
password -- plain-text password.<br>
display -- optional display name for the user name.<br>
registrar -- the registrar URI. If domain name is specified<br>
and this argument is empty, the registrar URI<br>
will be constructed from the domain name.<br>
proxy -- the proxy URI. If domain name is specified<br>
and this argument is empty, the proxy URI<br>
will be constructed from the domain name.</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>allow_contact_rewrite</strong> = True</dl>
<dl><dt><strong>auth_cred</strong> = []</dl>
<dl><dt><strong>auth_initial_algorithm</strong> = ''</dl>
<dl><dt><strong>auth_initial_send</strong> = False</dl>
<dl><dt><strong>force_contact</strong> = ''</dl>
<dl><dt><strong>id</strong> = ''</dl>
<dl><dt><strong>ka_data</strong> = '<font color="#c040c0">\r\n</font>'</dl>
<dl><dt><strong>ka_interval</strong> = 15</dl>
<dl><dt><strong>pidf_tuple_id</strong> = ''</dl>
<dl><dt><strong>priority</strong> = 0</dl>
<dl><dt><strong>proxy</strong> = []</dl>
<dl><dt><strong>publish_enabled</strong> = False</dl>
<dl><dt><strong>reg_timeout</strong> = 0</dl>
<dl><dt><strong>reg_uri</strong> = ''</dl>
<dl><dt><strong>require_100rel</strong> = False</dl>
<dl><dt><strong>srtp_secure_signaling</strong> = 1</dl>
<dl><dt><strong>transport_id</strong> = -1</dl>
<dl><dt><strong>use_srtp</strong> = 0</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="AccountInfo">class <strong>AccountInfo</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This describes <a href="#Account">Account</a> info. Application retrives account info<br>
with <a href="#Account">Account</a>.info().<br>
<br>
Member documentation:<br>
<br>
is_default -- True if this is the default account.<br>
uri -- the account URI.<br>
reg_active -- True if registration is active for this account.<br>
reg_expires -- contains the current registration expiration value,<br>
in seconds.<br>
reg_status -- the registration status. If the value is less than<br>
700, it specifies SIP status code. Value greater than<br>
this specifies the error code.<br>
reg_reason -- contains the registration status text (e.g. the<br>
error message).<br>
online_status -- the account's presence online status, True if it's <br>
publishing itself as online.<br>
online_text -- the account's presence status text.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="AccountInfo-__init__"><strong>__init__</strong></a>(self, ai)</dt></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>is_default</strong> = False</dl>
<dl><dt><strong>online_status</strong> = False</dl>
<dl><dt><strong>online_text</strong> = ''</dl>
<dl><dt><strong>reg_active</strong> = False</dl>
<dl><dt><strong>reg_expires</strong> = -1</dl>
<dl><dt><strong>reg_reason</strong> = ''</dl>
<dl><dt><strong>reg_status</strong> = 0</dl>
<dl><dt><strong>uri</strong> = ''</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="AuthCred">class <strong>AuthCred</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Authentication credential for SIP or TURN account.<br>
<br>
Member documentation:<br>
<br>
scheme -- authentication scheme (default is "Digest")<br>
realm -- realm<br>
username -- username<br>
passwd_type -- password encoding (zero for plain-text)<br>
passwd -- the password<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="AuthCred-__init__"><strong>__init__</strong></a>(self, realm, username, passwd, scheme<font color="#909090">='Digest'</font>, passwd_type<font color="#909090">=0</font>)</dt></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>passwd</strong> = ''</dl>
<dl><dt><strong>passwd_type</strong> = 0</dl>
<dl><dt><strong>realm</strong> = '*'</dl>
<dl><dt><strong>scheme</strong> = 'Digest'</dl>
<dl><dt><strong>username</strong> = ''</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Buddy">class <strong>Buddy</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>A <a href="#Buddy">Buddy</a> represents person or remote agent.<br>
<br>
This class provides functions to subscribe to buddy's presence and<br>
to send or receive instant messages from the buddy.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Buddy-__del__"><strong>__del__</strong></a>(self)</dt></dl>
<dl><dt><a name="Buddy-__init__"><strong>__init__</strong></a>(self, lib, id, account, cb)</dt></dl>
<dl><dt><a name="Buddy-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<dl><dt><a name="Buddy-delete"><strong>delete</strong></a>(self)</dt><dd><tt>Remove this buddy from the buddy list.</tt></dd></dl>
<dl><dt><a name="Buddy-info"><strong>info</strong></a>(self)</dt><dd><tt>Get buddy info as <a href="#BuddyInfo">BuddyInfo</a>.</tt></dd></dl>
<dl><dt><a name="Buddy-send_pager"><strong>send_pager</strong></a>(self, text, im_id<font color="#909090">=0</font>, content_type<font color="#909090">='text/plain'</font>, hdr_list<font color="#909090">=None</font>)</dt><dd><tt>Send instant message to remote buddy.<br>
<br>
Keyword arguments:<br>
text -- Instant message to be sent<br>
im_id -- Optional instant message ID to identify this<br>
instant message when delivery status callback<br>
is called.<br>
content_type -- MIME type identifying the instant message<br>
hdr_list -- Optional list of headers to be sent with the<br>
request.</tt></dd></dl>
<dl><dt><a name="Buddy-send_typing_ind"><strong>send_typing_ind</strong></a>(self, is_typing<font color="#909090">=True</font>, hdr_list<font color="#909090">=None</font>)</dt><dd><tt>Send typing indication to remote buddy.<br>
<br>
Keyword argument:<br>
is_typing -- boolean to indicate wheter user is typing.<br>
hdr_list -- Optional list of headers to be sent with the<br>
request.</tt></dd></dl>
<dl><dt><a name="Buddy-set_callback"><strong>set_callback</strong></a>(self, cb)</dt><dd><tt>Install callback to receive notifications from this object.<br>
<br>
Keyword argument:<br>
cb -- <a href="#BuddyCallback">BuddyCallback</a> instance.</tt></dd></dl>
<dl><dt><a name="Buddy-subscribe"><strong>subscribe</strong></a>(self)</dt><dd><tt>Subscribe to buddy's presence status notification.</tt></dd></dl>
<dl><dt><a name="Buddy-unsubscribe"><strong>unsubscribe</strong></a>(self)</dt><dd><tt>Unsubscribe from buddy's presence status notification.</tt></dd></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="BuddyCallback">class <strong>BuddyCallback</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This class can be used to receive notifications about <a href="#Buddy">Buddy</a>'s<br>
presence status change. Application needs to derive a class from<br>
this class, and register the instance with <a href="#Buddy">Buddy</a>.set_callback().<br>
<br>
Member documentation:<br>
<br>
buddy -- the <a href="#Buddy">Buddy</a> object.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="BuddyCallback-__init__"><strong>__init__</strong></a>(self, buddy<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="BuddyCallback-on_pager"><strong>on_pager</strong></a>(self, mime_type, body)</dt><dd><tt>Notification that incoming instant message is received from<br>
this buddy.<br>
<br>
Keyword arguments:<br>
mime_type -- MIME type of the instant message body<br>
body -- the instant message body</tt></dd></dl>
<dl><dt><a name="BuddyCallback-on_pager_status"><strong>on_pager_status</strong></a>(self, body, im_id, code, reason)</dt><dd><tt>Notification about the delivery status of previously sent<br>
instant message.<br>
<br>
Keyword arguments:<br>
body -- the message body<br>
im_id -- message ID<br>
code -- SIP status code<br>
reason -- SIP reason phrase</tt></dd></dl>
<dl><dt><a name="BuddyCallback-on_state"><strong>on_state</strong></a>(self)</dt><dd><tt>Notification that buddy's presence state has changed. Application<br>
may then retrieve the new status with <a href="#Buddy">Buddy</a>.info() function.</tt></dd></dl>
<dl><dt><a name="BuddyCallback-on_typing"><strong>on_typing</strong></a>(self, is_typing)</dt><dd><tt>Notification that remote is typing or stop typing.<br>
<br>
Keyword arguments:<br>
is_typing -- boolean to indicate whether remote is currently<br>
typing an instant message.</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>buddy</strong> = None</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="BuddyInfo">class <strong>BuddyInfo</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This class contains information about <a href="#Buddy">Buddy</a>. Application may <br>
retrieve this information by calling <a href="#Buddy">Buddy</a>.info().<br>
<br>
Member documentation:<br>
<br>
uri -- the <a href="#Buddy">Buddy</a> URI.<br>
contact -- the <a href="#Buddy">Buddy</a> Contact URI, if available.<br>
online_status -- the presence online status.<br>
online_text -- the presence online status text.<br>
activity -- the <a href="#PresenceActivity">PresenceActivity</a><br>
subscribed -- specify whether buddy's presence status is currently<br>
being subscribed.<br>
sub_state -- <a href="#SubscriptionState">SubscriptionState</a><br>
sub_term_reason -- The termination reason string of the last presence<br>
subscription to this buddy, if any.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="BuddyInfo-__init__"><strong>__init__</strong></a>(self, pjsua_bi<font color="#909090">=None</font>)</dt></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>activity</strong> = 0</dl>
<dl><dt><strong>contact</strong> = ''</dl>
<dl><dt><strong>online_status</strong> = 0</dl>
<dl><dt><strong>online_text</strong> = ''</dl>
<dl><dt><strong>sub_state</strong> = 0</dl>
<dl><dt><strong>sub_term_reason</strong> = ''</dl>
<dl><dt><strong>subscribed</strong> = False</dl>
<dl><dt><strong>uri</strong> = ''</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Call">class <strong>Call</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This class represents SIP call.<br>
<br>
Application initiates outgoing call with <a href="#Account">Account</a>.make_call(), and<br>
incoming calls are reported in <a href="#AccountCallback">AccountCallback</a>.on_incoming_call().<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Call-__del__"><strong>__del__</strong></a>(self)</dt></dl>
<dl><dt><a name="Call-__init__"><strong>__init__</strong></a>(self, lib, call_id, cb<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="Call-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<dl><dt><a name="Call-answer"><strong>answer</strong></a>(self, code<font color="#909090">=200</font>, reason<font color="#909090">=''</font>, hdr_list<font color="#909090">=None</font>)</dt><dd><tt>Send provisional or final response to incoming call.<br>
<br>
Keyword arguments:<br>
code -- SIP status code.<br>
reason -- Reason phrase. Put empty to send default reason<br>
phrase for the status code.<br>
hdr_list -- Optional list of headers to be sent with the<br>
INVITE response.</tt></dd></dl>
<dl><dt><a name="Call-attach_to_id"><strong>attach_to_id</strong></a>(self, call_id)</dt></dl>
<dl><dt><a name="Call-dial_dtmf"><strong>dial_dtmf</strong></a>(self, digits)</dt><dd><tt>Send DTMF digits with RTP event package.<br>
<br>
Keyword arguments:<br>
digits -- DTMF digit string.</tt></dd></dl>
<dl><dt><a name="Call-dump_status"><strong>dump_status</strong></a>(self, with_media<font color="#909090">=True</font>, indent<font color="#909090">=''</font>, max_len<font color="#909090">=1024</font>)</dt><dd><tt>Dump the call status.</tt></dd></dl>
<dl><dt><a name="Call-hangup"><strong>hangup</strong></a>(self, code<font color="#909090">=603</font>, reason<font color="#909090">=''</font>, hdr_list<font color="#909090">=None</font>)</dt><dd><tt>Terminate the call.<br>
<br>
Keyword arguments:<br>
code -- SIP status code.<br>
reason -- Reason phrase. Put empty to send default reason<br>
phrase for the status code.<br>
hdr_list -- Optional list of headers to be sent with the<br>
message.</tt></dd></dl>
<dl><dt><a name="Call-hold"><strong>hold</strong></a>(self, hdr_list<font color="#909090">=None</font>)</dt><dd><tt>Put the call on hold.<br>
<br>
Keyword arguments:<br>
hdr_list -- Optional list of headers to be sent with the<br>
message.</tt></dd></dl>
<dl><dt><a name="Call-info"><strong>info</strong></a>(self)</dt><dd><tt>Get the <a href="#CallInfo">CallInfo</a>.</tt></dd></dl>
<dl><dt><a name="Call-is_valid"><strong>is_valid</strong></a>(self)</dt><dd><tt>Check if this call is still valid.</tt></dd></dl>
<dl><dt><a name="Call-reinvite"><strong>reinvite</strong></a>(self, hdr_list<font color="#909090">=None</font>)</dt><dd><tt>Send re-INVITE and optionally offer new codecs to use.<br>
<br>
Keyword arguments:<br>
hdr_list -- Optional list of headers to be sent with the<br>
message.</tt></dd></dl>
<dl><dt><a name="Call-send_request"><strong>send_request</strong></a>(self, method, hdr_list<font color="#909090">=None</font>, content_type<font color="#909090">=None</font>, body<font color="#909090">=None</font>)</dt><dd><tt>Send arbitrary request to remote call. <br>
<br>
This is useful for example to send INFO request. Note that this <br>
function should not be used to send request that will change the <br>
call state such as CANCEL or BYE.<br>
<br>
Keyword arguments:<br>
method -- SIP method name.<br>
hdr_list -- Optional header list to be sent with the request.<br>
content_type -- Content type to describe the body, if the body<br>
is present<br>
body -- Optional SIP message body.</tt></dd></dl>
<dl><dt><a name="Call-set_callback"><strong>set_callback</strong></a>(self, cb)</dt><dd><tt>Set callback object to retrieve event notifications from this call.<br>
<br>
Keyword arguments:<br>
cb -- <a href="#CallCallback">CallCallback</a> instance.</tt></dd></dl>
<dl><dt><a name="Call-transfer"><strong>transfer</strong></a>(self, dest_uri, hdr_list<font color="#909090">=None</font>)</dt><dd><tt>Transfer the call to new destination.<br>
<br>
Keyword arguments:<br>
dest_uri -- Specify the SIP URI to transfer the call to.<br>
hdr_list -- Optional list of headers to be sent with the<br>
message.</tt></dd></dl>
<dl><dt><a name="Call-transfer_to_call"><strong>transfer_to_call</strong></a>(self, call, hdr_list<font color="#909090">=None</font>, options<font color="#909090">=0</font>)</dt><dd><tt>Attended call transfer.<br>
<br>
Keyword arguments:<br>
call -- The <a href="#Call">Call</a> object to transfer call to.<br>
hdr_list -- Optional list of headers to be sent with the<br>
message.<br>
options -- Must be zero for now.</tt></dd></dl>
<dl><dt><a name="Call-unhold"><strong>unhold</strong></a>(self, hdr_list<font color="#909090">=None</font>)</dt><dd><tt>Release the call from hold.<br>
<br>
Keyword arguments:<br>
hdr_list -- Optional list of headers to be sent with the<br>
message.</tt></dd></dl>
<dl><dt><a name="Call-update"><strong>update</strong></a>(self, hdr_list<font color="#909090">=None</font>, options<font color="#909090">=0</font>)</dt><dd><tt>Send UPDATE and optionally offer new codecs to use.<br>
<br>
Keyword arguments:<br>
hdr_list -- Optional list of headers to be sent with the<br>
message.<br>
options -- Must be zero for now.</tt></dd></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="CallCallback">class <strong>CallCallback</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Class to receive event notification from <a href="#Call">Call</a> objects. <br>
<br>
Use <a href="#Call">Call</a>.set_callback() method to install instance of this callback <br>
class to receive event notifications from the call object.<br>
<br>
Member documentation:<br>
<br>
call -- the <a href="#Call">Call</a> object.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="CallCallback-__del__"><strong>__del__</strong></a>(self)</dt></dl>
<dl><dt><a name="CallCallback-__init__"><strong>__init__</strong></a>(self, call<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="CallCallback-on_dtmf_digit"><strong>on_dtmf_digit</strong></a>(self, digits)</dt><dd><tt>Notification on incoming DTMF digits.<br>
<br>
Keyword argument:<br>
digits -- string containing the received digits.</tt></dd></dl>
<dl><dt><a name="CallCallback-on_media_state"><strong>on_media_state</strong></a>(self)</dt><dd><tt>Notification that the call's media state has changed.</tt></dd></dl>
<dl><dt><a name="CallCallback-on_pager"><strong>on_pager</strong></a>(self, mime_type, body)</dt><dd><tt>Notification that incoming instant message is received on<br>
this call.<br>
<br>
Keyword arguments:<br>
mime_type -- MIME type of the instant message body.<br>
body -- the instant message body.</tt></dd></dl>
<dl><dt><a name="CallCallback-on_pager_status"><strong>on_pager_status</strong></a>(self, body, im_id, code, reason)</dt><dd><tt>Notification about the delivery status of previously sent<br>
instant message.<br>
<br>
Keyword arguments:<br>
body -- message body<br>
im_id -- message ID<br>
code -- SIP status code<br>
reason -- SIP reason phrase</tt></dd></dl>
<dl><dt><a name="CallCallback-on_replace_request"><strong>on_replace_request</strong></a>(self, code, reason)</dt><dd><tt>Notification when incoming INVITE with Replaces header is received. <br>
<br>
Application may reject the request by returning value greather than<br>
or equal to 500. The default behavior is to accept the request.<br>
<br>
Keyword arguments:<br>
code -- default status code to return<br>
reason -- default reason phrase to return<br>
<br>
Return:<br>
The callback should return (code, reason) tuple.</tt></dd></dl>
<dl><dt><a name="CallCallback-on_replaced"><strong>on_replaced</strong></a>(self, new_call)</dt><dd><tt>Notification that this call will be replaced with new_call. <br>
After this callback is called, this call will be disconnected.<br>
<br>
Keyword arguments:<br>
new_call -- the new call that will replace this call.</tt></dd></dl>
<dl><dt><a name="CallCallback-on_state"><strong>on_state</strong></a>(self)</dt><dd><tt>Notification that the call's state has changed.</tt></dd></dl>
<dl><dt><a name="CallCallback-on_transfer_request"><strong>on_transfer_request</strong></a>(self, dst, code)</dt><dd><tt>Notification that call is being transfered by remote party. <br>
<br>
Application can decide to accept/reject transfer request by returning<br>
code greater than or equal to 500. The default behavior is to accept <br>
the transfer by returning 202.<br>
<br>
Keyword arguments:<br>
dst -- string containing the destination URI<br>
code -- the suggested status code to return to accept the request.<br>
<br>
Return:<br>
the callback should return 202 to accept the request, or 300-699 to<br>
reject the request.</tt></dd></dl>
<dl><dt><a name="CallCallback-on_transfer_status"><strong>on_transfer_status</strong></a>(self, code, reason, final, cont)</dt><dd><tt>Notification about the status of previous call transfer request. <br>
<br>
Keyword arguments:<br>
code -- SIP status code to indicate completion status.<br>
text -- SIP status reason phrase.<br>
final -- if True then this is a final status and no further<br>
notifications will be sent for this call transfer<br>
status.<br>
cont -- suggested return value.<br>
<br>
Return:<br>
If the callback returns false then no further notification will<br>
be sent for the transfer request for this call.</tt></dd></dl>
<dl><dt><a name="CallCallback-on_typing"><strong>on_typing</strong></a>(self, is_typing)</dt><dd><tt>Notification that remote is typing or stop typing.<br>
<br>
Keyword arguments:<br>
is_typing -- boolean to indicate whether remote is currently<br>
typing an instant message.</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>call</strong> = None</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="CallInfo">class <strong>CallInfo</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This structure contains various information about <a href="#Call">Call</a>.<br>
<br>
Application may retrieve this information with <a href="#Call">Call</a>.info().<br>
<br>
Member documentation:<br>
<br>
role -- <a href="#CallRole">CallRole</a><br>
account -- <a href="#Account">Account</a> object.<br>
uri -- SIP URI of local account.<br>
contact -- local Contact URI.<br>
remote_uri -- remote SIP URI.<br>
remote_contact -- remote Contact URI<br>
sip_call_id -- call's <a href="#Call">Call</a>-ID identification<br>
state -- <a href="#CallState">CallState</a><br>
state_text -- state text.<br>
last_code -- last SIP status code<br>
last_reason -- text phrase for last_code<br>
media_state -- <a href="#MediaState">MediaState</a><br>
media_dir -- <a href="#MediaDir">MediaDir</a><br>
conf_slot -- conference slot number for this call.<br>
call_time -- call's connected duration in seconds.<br>
total_time -- total call duration in seconds.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="CallInfo-__init__"><strong>__init__</strong></a>(self, lib<font color="#909090">=None</font>, ci<font color="#909090">=None</font>)</dt></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>account</strong> = None</dl>
<dl><dt><strong>call_time</strong> = 0</dl>
<dl><dt><strong>conf_slot</strong> = -1</dl>
<dl><dt><strong>contact</strong> = ''</dl>
<dl><dt><strong>last_code</strong> = 0</dl>
<dl><dt><strong>last_reason</strong> = ''</dl>
<dl><dt><strong>media_dir</strong> = 0</dl>
<dl><dt><strong>media_state</strong> = 0</dl>
<dl><dt><strong>remote_contact</strong> = ''</dl>
<dl><dt><strong>remote_uri</strong> = ''</dl>
<dl><dt><strong>role</strong> = 0</dl>
<dl><dt><strong>sip_call_id</strong> = ''</dl>
<dl><dt><strong>state</strong> = 0</dl>
<dl><dt><strong>state_text</strong> = ''</dl>
<dl><dt><strong>total_time</strong> = 0</dl>
<dl><dt><strong>uri</strong> = ''</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="CallRole">class <strong>CallRole</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt><a href="#Call">Call</a> role constants.<br>
<br>
Member documentation:<br>
<br>
CALLER -- role is caller<br>
CALLEE -- role is callee<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Data and other attributes defined here:<br>
<dl><dt><strong>CALLEE</strong> = 1</dl>
<dl><dt><strong>CALLER</strong> = 0</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="CallState">class <strong>CallState</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt><a href="#Call">Call</a> state constants.<br>
<br>
Member documentation:<br>
<br>
NULL -- call is not initialized.<br>
CALLING -- initial INVITE is sent.<br>
INCOMING -- initial INVITE is received.<br>
EARLY -- provisional response has been sent or received.<br>
CONNECTING -- 200/OK response has been sent or received.<br>
CONFIRMED -- ACK has been sent or received.<br>
DISCONNECTED -- call is disconnected.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Data and other attributes defined here:<br>
<dl><dt><strong>CALLING</strong> = 1</dl>
<dl><dt><strong>CONFIRMED</strong> = 5</dl>
<dl><dt><strong>CONNECTING</strong> = 4</dl>
<dl><dt><strong>DISCONNECTED</strong> = 6</dl>
<dl><dt><strong>EARLY</strong> = 3</dl>
<dl><dt><strong>INCOMING</strong> = 2</dl>
<dl><dt><strong>NULL</strong> = 0</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="CodecInfo">class <strong>CodecInfo</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This describes codec info.<br>
<br>
Member documentation:<br>
name -- codec name<br>
priority -- codec priority (0-255)<br>
clock_rate -- clock rate<br>
channel_count -- number of channels<br>
avg_bps -- average bandwidth in bits per second<br>
frm_ptime -- base frame length in milliseconds<br>
ptime -- RTP frame length in milliseconds.<br>
pt -- payload type.<br>
vad_enabled -- specify if Voice Activity Detection is currently<br>