-
Notifications
You must be signed in to change notification settings - Fork 131
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
TrueAfrican USSD transport #628
Conversation
response = self.transport.handle_session_new(session_id, | ||
msisdn, | ||
to_addr) | ||
returnValue(response) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
from vumi.components.session import SessionManager | ||
from vumi.config import ConfigText, ConfigInt, ConfigDict | ||
|
||
class TrueAfricanUssdTransportConfig(Transport.CONFIG_CLASS): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.
@jerith 👍 on your improvments :) |
….com:praekelt/vumi into feature/issue-627-trueafrican-ussd-transport
👍 |
…ssd-transport TrueAfrican USSD transport
A USSD transport for TrueAfrican's XMLRPC aggregator service. Loosely based on
HttpRpcTransport
andMtechUssdTransport
.For the XMLRPC spec, take a look at http://central.praekelt.com/vumi/PR67824E.