plivo / plivoframework

Open Source Telephony Application Prototyping Framework
http://www.plivo.com/open-source/
Other
418 stars 179 forks source link

Element "Number" can't call RTMP session #111

Open evghenin opened 10 years ago

evghenin commented 10 years ago

The problem is when I want bridge call to user which are connected through RTMP session. I'm trying to add "Number" element without specified gateways because I use ${rtmp_contact()} function as phone number, which returns correct contact string with gateway path. So, if we want to call RTMP session we have to have possibility to leave gateways attribute as array with single empty element.

My solution is:

File elements.py from the line 1238

    if gateways:
        # get list of gateways
        self.gateways = gateways.split(',')

replace to

    if gateways:
        # get list of gateways
        self.gateways = gateways.split(',')
    else:
        self.gateways = [""]

and in the same file from line 735

    #if not number_instance.gateways:
        outbound_socket.log.error("Gateway not defined on Number object !")
        return ''

replace to

    #if not number_instance.gateways:
    #    outbound_socket.log.error("Gateway not defined on Number object !")
    #    return ''
mike-plivo commented 10 years ago

Hi Dammazz,

thanks for the feedback and sharing the code . Can you do a pull request ?

evghenin commented 10 years ago

Done! Waiting for your review, may be you can improve this things.