@@ -390,7 +390,7 @@ class Dial(Verb):
390390 """
391391 GET = 'GET'
392392 POST = 'POST'
393- nestables = ['Number' , 'Conference' , 'Client' , 'Queue' ]
393+ nestables = ['Number' , 'Conference' , 'Client' , 'Queue' , 'Sip' ]
394394
395395 def __init__ (self , number = None , ** kwargs ):
396396 super (Dial , self ).__init__ (** kwargs )
@@ -412,6 +412,9 @@ def conference(self, name, **kwargs):
412412 def queue (self , name , ** kwargs ):
413413 return self .append (Queue (name , ** kwargs ))
414414
415+ def sip (self , name = None , ** kwargs ):
416+ return self .append (Sip (name , ** kwargs ))
417+
415418 def addNumber (self , * args , ** kwargs ):
416419 return self .number (* args , ** kwargs )
417420
@@ -472,3 +475,51 @@ class Record(Verb):
472475 """
473476 GET = 'GET'
474477 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