I have a lab that I need to insert a custom body (SDP) in SIP message. I'm using python3-pjsip(pjproject2.9) to create simple SIP UA. However, python3-pjsip(pjproject2.9) does not support custom SDP. I found that someone raise a question about pjsua custom SDP on stack overflow and solved it. Unfortunately, I don't know how to modify the pjsua source with those tips. Would you tell me how to modify it in more detail or share the source you modified? .
Could I need to modify the C code?
I've never used PJSIP in Python, but I think you should look into on_call_sdp_created callback. There you should use pjmedia_sdp_media structure to add new SDP parameter to pjmedia_sdp_session provided by callback's argument. Functions pjmedia_sdp_attr_create and pjmedia_sdp_media_add_attr also should be helpful there.
Good luck!
Related
I am new to the SIP. I want to make an emergency call using pjsip library. What I know, it should probably set some header in INVITE request or so.
I briefly checked RFC 5031 what seems to be related to this.
But I did not find any mention about such call in pjsip doc.
Do somebody know how to make such calls using pjsip?
Setting such header probably does not work as expected, see pjsip INVITE with URN support
I cannot find anywhere how to manage custom U-type messages. I use MessageCracker and need to understand the corresponding OnMessage method signature. For example my broker sends custom U1,U5, U2 messages, how can I capture those incoming messages inside a OnMessage method? I understand that Tag35 identifies those but if I cannot capture them through OnMessage then MessageCracker becomes kind of useless and I need to identify each message by Tag35 within FromApp or FromAdmin. Any suggestion how to handle those kind of custom U-types?
Thanks
Ah, custom messages. Fun stuff.
You need to add your counterparty's customizations to the DataDictionary xml file. Choose the appropriate FIXnn.xml file for your FIX version.
See here: http://quickfixn.org/tutorial/custom-fields-groups-and-messages
Then, because you are adding custom messages, you'll want to regenerate the QF/n source and rebuild the library so you can get classes for your new messages.
Instructions for rebuilding are here: https://github.com/connamara/quickfixn
You'll need to install Ruby. This annoys some people, but we haven't found any more-windows-oriented code-generator that we don't hate. Sorry in advance.
(If you were just adding fields to existing messages, you could probably get away with not rebuilding. But you're adding messages, so you pretty much have to regenerate/rebuild.)
To Windows developers, it may seem annoying that rebuilding the library is required, but it really is the norm for all the QF engines. FIX is just too fudgey a protocol for a single build to satisfy everyone, because it seems that every counterparty likes to screw with the message definitions.
The documentation is straightforward here: http://developer.chrome.com/apps/app_hardware.html#isochronous_transfers
It says the callback will be done on the findDevice.onEvent callback. However, the documentation appears to be behind, because the API no longer uses usb.findDevice, instead, it is usb.findDevices. usb.findDevices does not appear to have an option to define an onEvent.
Here is the current usb.findDevices documentation: http://developer.chrome.com/apps/usb.html#method-findDevices
Packaged Apps concept is wonderful, but the documentation is very confusing at the moment. Would love some help. Thanks
Updated Question
My question is, how do I get the data back from the Isochronous connection?
I understand this should be really easy but I can't find my way around the asterisk configuration files to do this.
What I need in an entry point for a external SIP call to execute an asterisk script. To keep things simple let's say I want to execute something like this:
[my888app]
exten => 888,1,Answer()
exten => 888,2,SayDigits(1234)
exten => 888,3,Hangup
The user will dial this particular 888 SIP extension in the form:
sip:888#mydomain.com
This is not an internal call, the call comes from another server, to test I'm using this Phono sample and the call is getting onto the asterisk server ok, the problem is that I have no idea how to route it to my888app. Already tried /etc/asterisk/sip_general_custom.conf without luck, guess the problem is the context [my888app] is not right. I already have the asterisk CLI in front of me
So, to recap:
No DID funny business, just SIP
In which .conf file do I put the [my888appp]
I dont understand if 888 is an entension or a channel
Multiple calls will be made at the same time to [my888app], is that a
problem?
Right now when I dial from the Phono app I get please enter the
channel number follow by the # sign, I dont know if that is helpful
or not
Thanks!!!
Well, after a lot of searching turns out the routing is as follows (default FreePBX installation):
The SIP calls goes into a context called from-sip-external
from there, it goes to the context from-trunk
from there it goes to from-pstn
from there it goes to ext-did-catchall
And there, in ext-did-catchall, is where I can put my888app and it will execute ok
I'm 100% positive this is not the correct place to put the app, but as I'm not an Asterisk expert I will settle for it.
Hope this help someone else.
Thanks.-
You need check the context attributes in your sip.conf. You can have a context in general section and you can have another in your peer definition, if you dont define any specific context in you peer then the general context attribute is assumed.
For simplicity I advice you change context in general section of sip.conf and put your my888app in extensions.conf.
Example of sip.conf general section:
[general]
context=my888app
...
About 888: it is a extension, an extension is a end point to your call. A channel is a object created dynamically when setting up a call to retain the session information and to exchange data (voice) between two points.
Answer is very simple, Any external call first land on the context which is defined under general section in sip.conf file. There you can define your own dial plan. if you want to redirect to your own context from there then you can use GoSub.
I want to modify the response that is sent when I am implementing a SOAP server using Zend_Soap_Server. I want to change the response that will be sent back because I am implementing the SOAP server for a client application that was written to work with another system but now I need to make it work with our system. The client application is expecting the XML response to be in a certain way. So what I want to do is that I dont want the handle method to put together its own XML response, I want to do it myself. Can this be done?
Thanks
I suspect there is some kind of output buffering trick you could use to do this, but a better solution might be to investigate the deeper cause of why the client is rejecting your XML and, in so doing, you may find a much more elegant solution.
For starters, you should probably read this very helpful article:
http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
You should then investigate Zend_Soap_AutoDiscover->setOperationBodyStyle() and Zend_Soap_AutoDiscover->setOperationBodyStyle() to see if changing the encoding style or binding style solves the problem.