Hi, all Not a Kamailio-related question, but. I want to form SIP-packets with info I need and receive answers. At first iteration in would be PUBLISH (with XML info) messages (PUBLISH - 200 OK) sent to Kamailio. I want to use Python (more preferable) or Lua (less preferable). Is there any lib I can create messages with, or forget and just use plain text + UDP socket?
There are Python bindings for PJSUA (simplified UA wrapper, part of PJSIP)...
Hello,
Your question is about how to send customized PUBLISH to Kamailio?
Anton On Mar 30, 2016 21:22, "Igor Olhovskiy" igorolhovskiy@gmail.com wrote:
Hi, all Not a Kamailio-related question, but. I want to form SIP-packets with info I need and receive answers. At first iteration in would be PUBLISH (with XML info) messages (PUBLISH - 200 OK) sent to Kamailio. I want to use Python (more preferable) or Lua (less preferable). Is there any lib I can create messages with, or forget and just use plain text + UDP socket?
-- Best regards, Igor
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Yep, will look at PJSUA, thanks.
More question is how to make sip packets with less work ))
2016-03-30 22:27 GMT+03:00 Anton Tonev anton.tonev@gmail.com:
Hello,
Your question is about how to send customized PUBLISH to Kamailio?
Anton On Mar 30, 2016 21:22, "Igor Olhovskiy" igorolhovskiy@gmail.com wrote:
Hi, all Not a Kamailio-related question, but. I want to form SIP-packets with info I need and receive answers. At first iteration in would be PUBLISH (with XML info) messages (PUBLISH
- 200 OK) sent to Kamailio.
I want to use Python (more preferable) or Lua (less preferable). Is there any lib I can create messages with, or forget and just use plain text + UDP socket?
-- Best regards, Igor
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
It may seem kind of ludicrous, but I actually found node-sip the easiest to use for crafting some custom requests...
https://github.com/kirm/sip.js/blob/master/doc/api.markdown
is this what you are looking for?
http://kamailio.org/docs/modules/4.4.x/modules/uac.html#uac.f.uac_req_send()
On Wed, Mar 30, 2016 at 10:44 PM, Alex Balashov abalashov@evaristesys.com wrote:
It may seem kind of ludicrous, but I actually found node-sip the easiest to use for crafting some custom requests...
https://github.com/kirm/sip.js/blob/master/doc/api.markdown
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Oh… Node. Too async for me ) But thanks.
2016-03-30 22:44 GMT+03:00 Alex Balashov abalashov@evaristesys.com:
It may seem kind of ludicrous, but I actually found node-sip the easiest to use for crafting some custom requests...
https://github.com/kirm/sip.js/blob/master/doc/api.markdown
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
With uac_req_send() I need to have Kamailio installed just to send message ;) Overkill a bit. But thanks :)
2016-03-30 22:47 GMT+03:00 Igor Olhovskiy igorolhovskiy@gmail.com:
Oh… Node. Too async for me ) But thanks.
2016-03-30 22:44 GMT+03:00 Alex Balashov abalashov@evaristesys.com:
It may seem kind of ludicrous, but I actually found node-sip the easiest to use for crafting some custom requests...
https://github.com/kirm/sip.js/blob/master/doc/api.markdown
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Best regards, Igor
then why are you asking this on kamailio mailing list? :)
On Wed, Mar 30, 2016 at 10:48 PM, Igor Olhovskiy igorolhovskiy@gmail.com wrote:
With uac_req_send() I need to have Kamailio installed just to send message ;) Overkill a bit. But thanks :)
2016-03-30 22:47 GMT+03:00 Igor Olhovskiy igorolhovskiy@gmail.com:
Oh… Node. Too async for me ) But thanks.
2016-03-30 22:44 GMT+03:00 Alex Balashov abalashov@evaristesys.com:
It may seem kind of ludicrous, but I actually found node-sip the easiest to use for crafting some custom requests...
https://github.com/kirm/sip.js/blob/master/doc/api.markdown
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Best regards, Igor
-- Best regards, Igor
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 03/30/2016 03:47 PM, Igor Olhovskiy wrote:
Oh… Node. Too async for me ) But thanks.
Yeah, I know. But look how easy - seductively easy. :)
---
function LRNquery(tn, req, res) { sip.send({ method: 'INVITE', uri: 'sip:' + tn + '@208.52.173.7:5062', version: '2.0', headers: { from: { name: 'node', uri: 'sip:node@172.30.106.108:5060', params: { tag: 'abcxyz123444' } },
to: { name: 'redirect', uri: 'sip:redirect@208.52.173.7:5062', params: {} },
'call-id': '9995551232344523@172.30.106.108', cseq: { seq: 1, method: 'INVITE' }, contact: [ { name: undefined, uri: 'sip:node@172.30.106.108:5081', params: {} } ] } }, function(rs) { if(rs.status == 302 && 'headers' in rs && 'contact' in rs.headers && rs.headers.contact.length > 0) { var contact = rs.headers.contact.shift();
var lrn = contact.uri.match(/rn=(\d+)/);
if(lrn) { res.writeHead(200, 'OK', { 'Content-Length': lrn[1].length });
res.end(lrn[1]); return; } }
res.writeHead(500, 'Internal Server Error'); res.end(); }); }
- then why are you asking this on kamailio mailing list? :) I know here are many SIP-developers. Question about SIP, and receiver of this message would be Kamailio :)
2016-03-30 22:52 GMT+03:00 Alex Balashov abalashov@evaristesys.com:
On 03/30/2016 03:47 PM, Igor Olhovskiy wrote:
Oh… Node. Too async for me ) But thanks.
Yeah, I know. But look how easy - seductively easy. :)
function LRNquery(tn, req, res) { sip.send({ method: 'INVITE', uri: 'sip:' + tn + '@208.52.173.7:5062', version: '2.0', headers: { from: { name: 'node', uri: 'sip:node@172.30.106.108:5060', params: { tag: 'abcxyz123444' } },
to: { name: 'redirect', uri: 'sip:redirect@208.52.173.7:5062', params: {} }, 'call-id': '9995551232344523@172.30.106.108', cseq: { seq: 1, method: 'INVITE' }, contact: [ { name: undefined, uri: 'sip:node@172.30.106.108:5081', params: {} } ] } }, function(rs) { if(rs.status == 302 && 'headers' in rs && 'contact' in
rs.headers && rs.headers.contact.length > 0) { var contact = rs.headers.contact.shift();
var lrn = contact.uri.match(/rn=(\d+)/); if(lrn) { res.writeHead(200, 'OK', { 'Content-Length': lrn[1].length }); res.end(lrn[1]); return; } } res.writeHead(500, 'Internal Server Error'); res.end(); });
}
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
You can probably use the sipp tool. It is more for load testing but you can easily create messages.
2016-03-30 22:00 GMT+02:00 Igor Olhovskiy igorolhovskiy@gmail.com:
- then why are you asking this on kamailio mailing list? :)
I know here are many SIP-developers. Question about SIP, and receiver of this message would be Kamailio :)
2016-03-30 22:52 GMT+03:00 Alex Balashov abalashov@evaristesys.com:
On 03/30/2016 03:47 PM, Igor Olhovskiy wrote:
Oh… Node. Too async for me ) But thanks.
Yeah, I know. But look how easy - seductively easy. :)
function LRNquery(tn, req, res) { sip.send({ method: 'INVITE', uri: 'sip:' + tn + '@208.52.173.7:5062', version: '2.0', headers: { from: { name: 'node', uri: 'sip:node@172.30.106.108:5060', params: { tag: 'abcxyz123444' } },
to: { name: 'redirect', uri: 'sip:redirect@208.52.173.7:5062', params: {} }, 'call-id': '9995551232344523@172.30.106.108', cseq: { seq: 1, method: 'INVITE' }, contact: [ { name: undefined, uri: 'sip:node@172.30.106.108:5081', params: {} } ] } }, function(rs) { if(rs.status == 302 && 'headers' in rs && 'contact' in
rs.headers && rs.headers.contact.length > 0) { var contact = rs.headers.contact.shift();
var lrn = contact.uri.match(/rn=(\d+)/); if(lrn) { res.writeHead(200, 'OK', { 'Content-Length': lrn[1].length }); res.end(lrn[1]); return; } } res.writeHead(500, 'Internal Server Error'); res.end(); });
}
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Best regards, Igor
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Yep, thanks for it too. sipp with custom XML can do the trick also.
2016-03-30 23:06 GMT+03:00 Anton Tonev anton.tonev@gmail.com:
You can probably use the sipp tool. It is more for load testing but you can easily create messages.
2016-03-30 22:00 GMT+02:00 Igor Olhovskiy igorolhovskiy@gmail.com:
- then why are you asking this on kamailio mailing list? :)
I know here are many SIP-developers. Question about SIP, and receiver of this message would be Kamailio :)
2016-03-30 22:52 GMT+03:00 Alex Balashov abalashov@evaristesys.com:
On 03/30/2016 03:47 PM, Igor Olhovskiy wrote:
Oh… Node. Too async for me ) But thanks.
Yeah, I know. But look how easy - seductively easy. :)
function LRNquery(tn, req, res) { sip.send({ method: 'INVITE', uri: 'sip:' + tn + '@208.52.173.7:5062', version: '2.0', headers: { from: { name: 'node', uri: 'sip:node@172.30.106.108:5060', params: { tag: 'abcxyz123444' } },
to: { name: 'redirect', uri: 'sip:redirect@208.52.173.7:5062', params: {} }, 'call-id': '9995551232344523@172.30.106.108', cseq: { seq: 1, method: 'INVITE' }, contact: [ { name: undefined, uri: 'sip:node@172.30.106.108:5081', params: {} } ] } }, function(rs) { if(rs.status == 302 && 'headers' in rs && 'contact' in
rs.headers && rs.headers.contact.length > 0) { var contact = rs.headers.contact.shift();
var lrn = contact.uri.match(/rn=(\d+)/); if(lrn) { res.writeHead(200, 'OK', { 'Content-Length': lrn[1].length }); res.end(lrn[1]); return; } } res.writeHead(500, 'Internal Server Error'); res.end(); });
}
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Best regards, Igor
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
to add a bit more to the suggestions offered by the others ... if you have the sip packet in a file, you can send it over with protoshoot (included in kamailio at utils/protoshoot/).
Maybe more useful will be sipsak, it allows to do a lot of sip stuff from command line -- this should be packaged on most linux distros, if not, it is hosted on github by the author Nils Olhmeier:
* https://github.com/nils-ohlmeier/sipsak
If you need to send over websocket, a while ago I wrote a small tool in go - wsctl:
* https://github.com/miconda/wsctl
Cheers, Daniel
On 30/03/16 21:21, Igor Olhovskiy wrote:
Hi, all Not a Kamailio-related question, but. I want to form SIP-packets with info I need and receive answers. At first iteration in would be PUBLISH (with XML info) messages (PUBLISH - 200 OK) sent to Kamailio. I want to use Python (more preferable) or Lua (less preferable). Is there any lib I can create messages with, or forget and just use plain text + UDP socket?
-- Best regards, Igor
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users