@@ -390,7 +390,7 @@ class Dial(Verb):
390
390
"""
391
391
GET = 'GET'
392
392
POST = 'POST'
393
- nestables = ['Number' , 'Conference' , 'Client' , 'Queue' ]
393
+ nestables = ['Number' , 'Conference' , 'Client' , 'Queue' , 'Sip' ]
394
394
395
395
def __init__ (self , number = None , ** kwargs ):
396
396
super (Dial , self ).__init__ (** kwargs )
@@ -412,6 +412,9 @@ def conference(self, name, **kwargs):
412
412
def queue (self , name , ** kwargs ):
413
413
return self .append (Queue (name , ** kwargs ))
414
414
415
+ def sip (self , name = None , ** kwargs ):
416
+ return self .append (Sip (name , ** kwargs ))
417
+
415
418
def addNumber (self , * args , ** kwargs ):
416
419
return self .number (* args , ** kwargs )
417
420
@@ -472,3 +475,51 @@ class Record(Verb):
472
475
"""
473
476
GET = 'GET'
474
477
POST = 'POST'
478
+
479
+
480
+ class Sip (Verb ):
481
+ """Dial out to a SIP endpoint
482
+
483
+ :param url: call screening URL none
484
+ :param method: call screening method POST
485
+ :param username: Username for SIP authentication
486
+ :param password: Password for SIP authentication
487
+ """
488
+ nestables = ['Headers' , 'Uri' ]
489
+
490
+ def __init__ (self , sip_address = None , ** kwargs ):
491
+ super (Sip , self ).__init__ (** kwargs )
492
+ if sip_address :
493
+ self .body = sip_address
494
+
495
+ def uri (self , uri , ** kwargs ):
496
+ return self .append (Uri (uri , ** kwargs ))
497
+
498
+ def headers (self , headers ):
499
+ """Add headers to this Sip noun
500
+
501
+ :param dict headers: A dictionary of headers
502
+ """
503
+ collection = Headers ()
504
+
505
+ for key , value in headers .iteritems ():
506
+ collection .append (Header (name = key , value = value ))
507
+
508
+ return self .append (collection )
509
+
510
+
511
+ class Uri (Verb ):
512
+ """A collection of headers"""
513
+ def __init__ (self , uri , ** kwargs ):
514
+ super (Uri , self ).__init__ (** kwargs )
515
+ self .body = uri
516
+
517
+
518
+ class Headers (Verb ):
519
+ """A collection of headers"""
520
+ nestables = ['Header' ]
521
+
522
+
523
+ class Header (Verb ):
524
+ """A single headers"""
525
+ pass
0 commit comments