Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrueAfrican USSD transport #628

Merged
merged 24 commits into from
Oct 23, 2013

Conversation

vgeddes
Copy link
Contributor

@vgeddes vgeddes commented Oct 16, 2013

A USSD transport for TrueAfrican's XMLRPC aggregator service. Loosely based on HttpRpcTransport and MtechUssdTransport.

For the XMLRPC spec, take a look at http://central.praekelt.com/vumi/PR67824E.

response = self.transport.handle_session_new(session_id,
msisdn,
to_addr)
returnValue(response)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function isn't a generator, so you shouldn't use @inlineCallbacks. Rather drop the decorator and just return whatever handle_new_session() gives you, which can be a deferred.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jerith ah, yeah, oops, I was debugging this method and removed the yield before self.transport.handle_session_new, and that shouldn't have been committed. I'll try what you suggest though.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 44184d3 on feature/issue-627-trueafrican-ussd-transport into 8f3bfa0 on develop.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling afcc8bb on feature/issue-627-trueafrican-ussd-transport into 8f3bfa0 on develop.

from vumi.components.session import SessionManager
from vumi.config import ConfigText, ConfigInt, ConfigDict

class TrueAfricanUssdTransportConfig(Transport.CONFIG_CLASS):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pep8 violation: You need two empty lines before the class definition.

"USSD.END": self.ussd_session_end,
}

def lookupProcedure(self, procedurePath):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather use a subhandler for the USSD prefix than override the default behaviour here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main reason I overrode the default behavior was to avoid having handlers with uppercase names, like INIT(), CONT(), END(). Unfortunately those names are specified by the TrueAfrican API doc. So I chose what I believed were the lesser of two evils :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The handlers would be xmlrpc_INIT() and friends, not just the procedure name.

@vgeddes
Copy link
Contributor Author

vgeddes commented Oct 23, 2013

@jerith 👍 on your improvments :)

Vincent Geddes added 3 commits October 23, 2013 14:58
@jerith
Copy link
Member

jerith commented Oct 23, 2013

👍

vgeddes added a commit that referenced this pull request Oct 23, 2013
…ssd-transport

TrueAfrican USSD transport
@vgeddes vgeddes merged commit ac15bde into develop Oct 23, 2013
@vgeddes vgeddes deleted the feature/issue-627-trueafrican-ussd-transport branch October 23, 2013 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants