How to receive sip response? - sip

How do I receive responses from sip using php/nodejs/javascript.
What I have:
Software Telephone (SIP/TAPI) required!
Remote Debian Server (can't login to provider)
I'd like to open browser and Software VOIP Telephone and run a procedure.
Procedure:
Select Telephonnumber from Datebase (mysql)
Call selected nummber
receive response
work with response

It is possible to use SIP over WebSockets: https://datatracker.ietf.org/doc/html/draft-ibc-sipcore-sip-websocket
This protocol is supported by OverSIP, Kamailio, Asterisk, OfficeSIP.
And here are some usable libraries implementing SIP client over WS:
http://sipml5.org/
http://jssip.net/

Related

How to restart operating systems with a XMPP/EJABBER server using python

I want to create a XMPP server on my network and then send message to it with python so that this server can restart the target computer on the network , now how can i set up this server and how can i do the rest of the process?
tnx
I am not sure in what context you are trying to do this, but XMPP has been used in context outside of usual chat and instant messengers (e.g. load balancers, rpc, ...).
There can be several ways of doing this. One way I can think right now is by using Jabber RPC xep-0009 which says:
This specification defines an XMPP protocol extension for
transporting XML-RPC encoded requests and responses between two XMPP entities.
The protocol supports all syntax and semantics of XML-RPC except that
it uses XMPP instead of HTTP as the underlying transport.
Workflow wise here is how you can make this work:
You will need a jabber server which is up and running say on host-A
You will need to configure a startup service on other hosts in the network (say on host-B, host-C, host-D). This startup service is nothing but a xmpp client daemon which will start in the background whenever host is started.
This xmpp client configured as startup service are special in the sense that they will accept incoming rpc calls (support for XEP-0009) and execute received commands on the host.
Received RPC commands can be synonymous to shutdown, kill -9 xxxx depending upon your specific needs.
Finally, xmpp client on host-C can send one or more commands wrapped inside an stanza to xmpp client running on host-B.
You can use one of the existing python xmpp client library and simply extend their working examples for your use case. You will also need to check details on how to configure startup service depending upon your Operating System (e.g. update-rc.d for ubuntu or sc.exe for windows)

how to send packet to subdomain

I have two xmpp server instances: mydomain.com and node1.mydomain.com,
if I send a message from user1#mydomain.com to user2#node1.mydomain.com then
mydomain.com server thinks that node1 is a so called component part of the jabber id
and doesn't send it.
How can I tell my xmpp server that I want to send message to the remote user?
Is there any possibility to do so in xmpp standard or it is only implementation dependent?
I don't think that it is valid to make one server a subdomain of another. I think you should rename the server to node2.mydomain.com.
I found out that it is my xmpp server bug (I use Openfire), there is a patch fixing it here.
The best practice for any xmpp server is to check if such component is registered, and if not to consider packet as being sent to a remote xmpp server.

Can Fiddler monitor traffic other than HTTP

I have developed a Client/Server type application. XML data is passed between the client and server. I want to simulate how it would run on a very slow network (i.e. radio # 9.6kps). I understand Fiddler can be used in simulate modem speeds mode. But no matter what I do I cannot configure Fiddler to accept traffic from the client and redirect it to the server. And I have also tried a "reverse proxy" too.
Does Fiddler work with protocols other than HTTP?

How can I check if a server supports xmpp or not?

Is there anyway in which I can check if a server supports XMPP protocol or not?
I am very new to XMPP, and I am dealing with a shared server. I am supposed to use XMPP to create a chatting system. But as I read about XMPP, I am supposed to install openfire and I have no access to the server itself.
So I want to check if the server supports xmpp or not.
Here's the XMPP RFC which includes recommended port numbers:
https://www.rfc-editor.org/rfc/rfc3920#section-15.9
So you could try connecting to port 5222 on a server (with a proper XMPP client, a plain socket in C, the telnet program, or whatever). Note also that port 5223 is used by some XMPP servers for SSL/TLS (as noted in appendix D.1. of the RFC).

Using Asterisk as SIP relay server

I currently have issues with SIP User Agents behind a symmetric NAT connecting to my SIP client, which is an IVR voice service.
I read that Asterisk has a solution for this in the sip.conf, where I can set attribute
nat=yes
and this will ignore the IP and Port in the SIP headers and use the one for the SIP request and also waits for an incoming RTP stream to reply to.
I'd like to make use of this feature as we already have an Asterix server installed for AIX requests.
What would be the minimum configuration required for Asterix to act as the man in the middle on a new port as 5060 will still be used to connect directly to the SIP client? I don't care about authentication etc. I just need the Asterix to act as a SIP relay.
Thanks
K
You may also need to have "canreinvite=no" in the [general] section of your sip.conf.
That setting keeps Asterisk in the call path, otherwise voice traffic may be sent directly from one endpoint to the other.