Re: [SR-Users] avp_db_query() question
Hello, maybe is better to use sqlops module, it more suitable for queries with many records in result. http://kamailio.org/docs/modules/stable/modules_k/sqlops.html Cheers, Daniel On 1/19/11 2:58 PM, Klaus Darilion wrote: looks fine. try to increase debug level - then you should see the query and the results in syslog regards klaus Am 18.01.2011 12:07, schrieb ??: Hello |avp_db_query(query[,dest]) can get a database query and store the results in the avps.| |But what if the results returns many rows,and how can I get all the results? How to set the [dest] parameter ?| |I've tried the method describered in http://www.kamailio.org/docs/avp_db_query.html,but it doesn't work.| |like below| |mysqlselect mem_user from tgroup where grp_name='1234';| |+--+| || mem_user || |+--+| || 1013 || || 2013 || |+--+| |2 rows in set (0.00 sec)| |kamailio.cfg| |if(avp_db_query(select mem_user from tgroup where grp_name='1234',$avp(name)))| |{| |||xlog(L_INFO,query results[1] :$avp(name[1])\n);| |xlog(L_INFO,query results[2] :$avp(name[2])\n);| |}| |syslog| |INFO query results[1] :null| |INFO query results[2] :null| |version: kamailio 3.0.2 MySQL 5.0| || |thank you very much!| ___ 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 -- Daniel-Constantin Mierla Kamailio (OpenSER) Advanced Training Jan 24-26, 2011, Irvine, CA, USA http://www.asipto.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
Re: [SR-Users] Float Comparison
On 1/19/11 7:50 AM, Klaus Darilion wrote: Am 18.01.2011 21:26, schrieb Brandon Armstead: Hello, Is there anything special that needs to be done for float comparison? For example: if([5.5 = 4.3]) ^^^ this format is no longer supported starting with 3.0, just skip the square brackets, now it is working like in C. or if(5.5 4.3) The conditional does not seem to be coming back as true like it should? I have no idea if floating point comparison is supported, but you could multiple the values (e.g. * 1) before comparison The pseudo-variables can hold integer or strings. Do you do comparison with static values or you load the values in some variables and then compare? Cheers, Daniel -- Daniel-Constantin Mierla Kamailio (OpenSER) Advanced Training Jan 24-26, 2011, Irvine, CA, USA http://www.asipto.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
Re: [SR-Users] Handling call transfer in the Asterisk Realtime setup.
On 1/16/11 7:32 PM, David J. wrote: I am trying to add support for call transfer in the Asterisk realtime tutorial on Asipto; I am not sure what I would have to do to get this feature working; Perhaps I have to handle refer messages; but I am not sure how I send that to Asterisk; Any advice would be greatly appreciated. Kamailio has only the role of the proxy in this case. The REFER should be just forwarded to asterisk like any other request intended for callee. Cheers, Daniel -- Daniel-Constantin Mierla Kamailio (OpenSER) Advanced Training Jan 24-26, 2011, Irvine, CA, USA http://www.asipto.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
Re: [SR-Users] SL local ACK found - dropping it! error ...
Am 19.01.2011 19:14, schrieb Sébastien Cramatte: Efectively it was an issue with FW. I've setup my kamailio to listen on 5060 and 5062. Now I can call media server and my extensions can receive / make local calls respectively. The issue now is that I've got my SIP PSTN gateway that try to reach our server on port 5060 and this gateway listen on 5060 too. configure the gatway to send to port 5062 It shouldn't be a problem because Kamailio listen over 5060 and 5062 but unfortunately doesn't work and send me back a 404 error code. for sure the 4040 is not cause by using a different port. Seems like your config is not complete yet. regards klaus I use the same configuration as before just add two listen line Best regards 2011/1/19 Klaus Darilion klaus.mailingli...@pernau.at mailto:klaus.mailingli...@pernau.at With this trace I do not see a problem regarding your previous post SL local ACK found - dropping it! error But for sure you have a problem as the incoming INVITE is malformed. Either Bria iPhone is buggy or there is a FW/ALG device which rewrites the SIP packet (IP addresses) and does it in a wrong way (same old story with ALG). To verify if the problem is due to an buggy ALG you could try to start the SIP proxy on a different port, .e.g 45671 - whatever you like - anc configure Bria to use this port. regards klaus Am 19.01.2011 15:20, schrieb Sébastien Cramatte: Hello This is trace I've obtained when call through nated wifi device (iPHone 4+ Bria SIP client). I've replaced client address by xx.xx.xx.xx and server address bt yy.yy.yy.yy I've attached my current configuration Thank you for your help Bye - # U 2011/01/19 15:11:46.498804 xx.xx.xx.xx:59240 - yy.yy.yy.yy:5060 # U 2011/01/19 15:11:47.735309 xx.xx.xx.xx:59240 - yy.yy.yy.yy:5060 REGISTER sip:sip.mydomain.com http://sip.mydomain.com SIP/2.0 Via: SIP/2.0/UDP xx.xx.xx.xx:59240;rport;branch=z9hG4bKPj5nQlnpOAF3aeP2db4XDMX7lXklIMEBq9 Max-Forwards: 70 From: 868973396 sip:868973...@sip.mydomain.com mailto:sip%3a868973...@sip.mydomain.com;tag=b8lChOc4K4maceQRSrsMgOLy-OGO.FKe To: 868973396 sip:868973...@sip.mydomain.com mailto:sip%3a868973...@sip.mydomain.com Call-ID: xFmpKcSPhqITQTbCXdfvNe5D-Gkss9rR CSeq: 17448 REGISTER User-Agent: Bria iPhone 1.2.6 Contact: sip:868973...@xx.xx.xx.xx:59240;transport=UDP Expires: 900 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Content-Length: 0 # U 2011/01/19 15:11:47.735976 yy.yy.yy.yy:5060 - xx.xx.xx.xx:59240 SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP xx.xx.xx.xx:59240;rport=59240;branch=z9hG4bKPj5nQlnpOAF3aeP2db4XDMX7lXklIMEBq9 From: 868973396 sip:868973...@sip.mydomain.com mailto:sip%3a868973...@sip.mydomain.com;tag=b8lChOc4K4maceQRSrsMgOLy-OGO.FKe To: 868973396 sip:868973...@sip.mydomain.com mailto:sip%3a868973...@sip.mydomain.com;tag=8835075c631d8d3f40c2f41ff9a205b5.8b69 Call-ID: xFmpKcSPhqITQTbCXdfvNe5D-Gkss9rR CSeq: 17448 REGISTER WWW-Authenticate: Digest realm=sip.mydomain.com http://sip.mydomain.com, nonce=TTbyTk028SLrerBFAyFR2EylGU058Msj Server: kamailio (3.1.1 (i386/linux)) Content-Length: 0 # U 2011/01/19 15:11:47.760981 xx.xx.xx.xx:59240 - yy.yy.yy.yy:5060 REGISTER sip:sip.mydomain.com http://sip.mydomain.com SIP/2.0 Via: SIP/2.0/UDP xx.xx.xx.xx:59240;rport;branch=z9hG4bKPjBpuaWjJ6XgI.1BsotT1EnTGOkOhp3anf Max-Forwards: 70 From: 868973396 sip:868973...@sip.mydomain.com mailto:sip%3a868973...@sip.mydomain.com;tag=b8lChOc4K4maceQRSrsMgOLy-OGO.FKe To: 868973396 sip:868973...@sip.mydomain.com mailto:sip%3a868973...@sip.mydomain.com Call-ID: xFmpKcSPhqITQTbCXdfvNe5D-Gkss9rR CSeq: 17449 REGISTER User-Agent: Bria iPhone 1.2.6 Contact: sip:868973...@xx.xx.xx.xx:59240;transport=UDP Expires: 900 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Authorization: Digest username=868973396, realm=sip.mydomain.com http://sip.mydomain.com, nonce=TTbyTk028SLrerBFAyFR2EylGU058Msj, uri=sip:sip.mydomain.com http://sip.mydomain.com, response=842919b2224fd20c24aa5ae69b0d4613 Content-Length: 0 # U 2011/01/19 15:11:47.762107 yy.yy.yy.yy:5060 - xx.xx.xx.xx:59240 SIP/2.0 200 OK Via: SIP/2.0/UDP xx.xx.xx.xx:59240;rport=59240;branch=z9hG4bKPjBpuaWjJ6XgI.1BsotT1EnTGOkOhp3anf From: 868973396 sip:868973...@sip.mydomain.com
Re: [SR-Users] Refer Using UAC.
private mails are simply ignored after first advise in this regard, please CC the mailing list always. If you read the config from the tutorial, you see how the invite is relayed to asterisk. Refer should go to asterisk in the same way if it is an out of dialog request, or follow record route/contact address for within dialog requests. Cheers, Daniel On 1/20/11 11:37 AM, David J. wrote: could you point me to the docs? just use forward() or rewritehostport()? On 1/20/11 5:15 AM, Daniel-Constantin Mierla wrote: If asterisk is in the path of the call, then just forward the REFER to it, there is no need to generate a new one. Also, note that REFER is many times part of a dialog, uac_req_send() creates requests out of the dialog. Cheers, Daniel On 1/16/11 11:37 PM, David J. wrote: I realize that kamailio is not a b2bua; But because we are using Asterisk in the path; To extend the Asterisk Realtime Tutorial; I was wondering if I could do something like this... Kind of like how we use UAC to send a register to Asterisk; Could we do the same and modify the method to use REFER instead? I know it is more complex; but I am not sure where to handle this case; Thanks for any pointers. if(is_method(REFER)){ $var(rip) = $sel(cfg_get.asterisk.bindip); $uac_req(method)=REFER; $uac_req(ruri)=sip: + $var(rip) + : + $sel(cfg_get.asterisk.bindport); $uac_req(furi)=sip: + $au + @ + $var(rip) + ;tag= + $ft; $uac_req(turi)=sip: + $au + @ + $var(rip) + ;tag= + $tt; $uac_req(hdrs)=Contact: sip: + $au + @ + $sel(cfg_get.kamailio.bindip) + : + $sel(cfg_get.kamailio.bindport) + \r\n; if($sel(contact.expires) != $null) $uac_req(hdrs)= $uac_req(hdrs) + Expires: + $sel(contact.expires) + \r\n; else $uac_req(hdrs)= $uac_req(hdrs) + Expires: + $hdr(Expires) + \r\n; uac_req_send(); } ___ 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 -- Daniel-Constantin Mierla Kamailio (OpenSER) Advanced Training Jan 24-26, 2011, Irvine, CA, USA http://www.asipto.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
Re: [SR-Users] Proxying INVITE message without port information in R-URI
Klaus, Thanks for your continued help. How? Does it change the Contact header? Yes, the proxy changes the Contact header. So the SIP server is the registrar? Correct. The contact usually is the IP address of the client. So, if you the SIP server routes based on the contact header, it should send the INVITE directly to the client not to the proxy. Somehow this all does not fit together. Clarification : Both clients A and B have the proxy as an outbound proxy. Clients register to the SIP server through the proxy. The SIP server routes the INVITE (INVITE from A that was proxied to SIP server) to the proxy with the R-URI being constructed based on the contents of the Contact header (IP only no port info). This is what I meant by saying the SIP server routes INVITE based on registered Contact (R-URI of INVITE is based on Contact header of client B's REGISTER message). It depends on how is the registrar - proxy or the SIP server. The workaround also depends on the respective buggy behavior of the sip server (if there is one at all). I think it is not possible to further debug this problem without a complete trace of the scenario: ngrep -W byline -t -d any -P port 5060 Attached to the email is a sip trace captured at the proxy showing - Registration of client B - INVITE messages originated by client A trying to call client B - The sip trace has been edited to remove duplicate messages arising from authentication - Towards the end, the sip trace shows 4 INVITE messages from proxy to Client B. However none of these messages reach client B because proxy is sending to port 5060, while client B is reachable at Nated port 55000. This port information is not specified in the R-URI of INVITE by SIP server. - Eventually a timeout will occur (not shown in log for sake of brevity) - Both clients A,B are behind same NAT (public ip x.x.x.226) What needs to be done at the proxy to ensure INVITE is forwarded to the correct port (55000 in this case) instead of the default port 5060 ? Once again thanks for your help. Regards, Vikram. interface: any filter: (ip) and ( port 7160 ) # U 2011/01/20 10:21:23.413328 64.219.188.226:55000 - 64.219.188.229:7160 REGISTER sip:SIP_Server_IP:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.2:7160;rport;branch=z9hG4bKPj-FSwD5USvw4lmKGE3WwYElfQzJMInGur Route: sip:64.219.188.229:7160;lr Max-Forwards: 70 From: ClientB sip:ClientB@SIP_Server_IP;tag=XSZNZduKIDDETvbfarRDlPZmQrGDd9X9 To: ClientB sip:ClientB@SIP_Server_IP Call-ID: Ij6RSDWqbNiOj2zBp4.1.Bx6XRyiYk1z CSeq: 49366 REGISTER Contact: ClientB sip:ClientB@192.168.1.2:7160 Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Content-Length: 0 # U 2011/01/20 10:21:23.414514 64.219.188.229:7160 - SIP_Server_IP:5060 REGISTER sip:SIP_Server_IP:5060 SIP/2.0 Via: SIP/2.0/UDP 64.219.188.229:7160;branch=z9hG4bKb495.8144d513.0 Via: SIP/2.0/UDP 192.168.1.2:7160;received=64.219.188.226;rport=55000;branch=z9hG4bKPj-FSwD5USvw4lmKGE3WwYElfQzJMInGur Route: sip:64.219.188.229:7160;lr Max-Forwards: 69 From: ClientB sip:ClientB@SIP_Server_IP;tag=XSZNZduKIDDETvbfarRDlPZmQrGDd9X9 To: ClientB sip:ClientB@SIP_Server_IP Call-ID: Ij6RSDWqbNiOj2zBp4.1.Bx6XRyiYk1z CSeq: 49366 REGISTER Contact: ClientB sip:ClientB@64.219.188.226:55000--- ***CONTACT HAS BEEN CHANGED BY PROXY*** Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Content-Length: 0 P-hint: outbound # U 2011/01/20 10:21:23.478284 SIP_Server_IP:5060 - 64.219.188.229:7160 SIP/2.0 200 OK CSeq: 8788 REGISTER Via: SIP/2.0/UDP 64.219.188.229:7160;branch=z9hG4bK2b7e.46086b17.0 Via: SIP/2.0/UDP 192.168.1.2:7160;branch=z9hG4bKPjve-SmgIoXdUU711aE1OAxS1LGmNY3rgn From: ClientB sip:ClientB@SIP_Server_IP;tag=kRUY7xtRmeNC11G45ZU63Jc0Fvfxr-95 Call-ID: ELxAXihJOBqDrpWkKcb3U0QpnD6GwlIS To: ClientB sip:ClientB@SIP_Server_IP;tag=20012011 Contact: ClientB sip:ClientB@64.219.188.226:55000;expires=600 Expires: 600 Content-Length: 0 # U 2011/01/20 10:21:23.479021 64.219.188.229:7160 - 64.219.188.226:55000 SIP/2.0 200 OK CSeq: 8788 REGISTER Via: SIP/2.0/UDP 192.168.1.2:7160;branch=z9hG4bKPjve-SmgIoXdUU711aE1OAxS1LGmNY3rgn From: ClientB sip:ClientB@SIP_Server_IP;tag=kRUY7xtRmeNC11G45ZU63Jc0Fvfxr-95 Call-ID: ELxAXihJOBqDrpWkKcb3U0QpnD6GwlIS To: ClientB sip:ClientB@SIP_Server_IP;tag=20012011 Contact: ClientB sip:ClientB@64.219.188.226:55000;expires=600 Expires: 600 Content-Length: 0 # U 2011/01/20 10:21:30.381315 64.219.188.226:55002 - 64.219.188.229:7160 INVITE sip:5500ClientB@SIP_Server_IP:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.3:7160;rport;branch=z9hG4bKPjhLlO4oeqJs05Qr99ojTqv8GfXuGA9.Se Max-Forwards: 70 From: ClientA sip:ClientA@SIP_Server_IP;tag=FpymJ88fPnpB90-lDqvWt.VFkK9fMfM1 To: sip:5500ClientB@SIP_Server_IP Contact: ClientA sip:ClientA@192.168.1.3:7160 Call-ID: iiOmM.6qbL.Xt5RSi-Ja9h6eOFb3-XDl CSeq: 25561 INVITE Route: sip:64.219.188.229:7160;lr
Re: [SR-Users] Proxying INVITE message without port information in R-URI
The contact usually is the IP address of the client. So, if you the SIP server routes based on the contact header, it should send the INVITE directly to the client not to the proxy. Somehow this all does not fit together. Clarification : Both clients A and B have the proxy as an outbound proxy. Clients register to the SIP server through the proxy. The SIP server routes the INVITE (INVITE from A that was proxied to SIP server) to the proxy with the R-URI being constructed based on the contents of the Contact header (IP only no port info). This is what I meant by saying the SIP server routes INVITE based on registered Contact (R-URI of INVITE is based on Contact header of client B's REGISTER message). To me it seems that the SIP server also does some kind of NAT traversal: it puts the Contact IP in to the RURI but it sends the request to the IP:port from which the REGISTER was received (that's called NAT traversal). So, either fix the SIP server (make sure it adds the port as in the Contact header also to the RURI) or try a workaround: A woraround would be for example to put the received port in the Contact URI as an URI paramter. If the SIP server does not strip URI parameters as well, then you might be lucky and restore the port from the parameter in the RURI. For the URI-parameter workaround try the functions add_contact_alias() and handle_ruri_alias(): http://www.kamailio.org/docs/modules/stable/modules_k/nathelper.html#id2764276 regards klaus ___ 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
Re: [SR-Users] Proxying INVITE message without port information in R-URI
Klaus, To me it seems that the SIP server also does some kind of NAT traversal: it puts the Contact IP in to the RURI but it sends the request to the IP:port from which the REGISTER was received (that's called NAT traversal). So, either fix the SIP server (make sure it adds the port as in the Contact header also to the RURI) or try a workaround: A woraround would be for example to put the received port in the Contact URI as an URI paramter. If the SIP server does not strip URI parameters as well, then you might be lucky and restore the port from the parameter in the RURI. For the URI-parameter workaround try the functions add_contact_alias() and handle_ruri_alias(): http://www.kamailio.org/docs/modules/stable/modules_k/nathelper.html#id2764276 Ok, will try your suggestion for the workaround. Thanks for all the help. Regards, Vikram. ___ 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
Re: [SR-Users] SIP Router 3.03 topoh
On 13 January 2011 08:43, marius zbihlei marius.zbih...@1and1.ro wrote: On 01/13/2011 02:51 AM, dotnetdub wrote: On 29 November 2010 09:33, marius zbihlei marius.zbih...@1and1.ro wrote: On 11/26/2010 12:38 AM, dotne Hello Brian, Module: sip-router Branch: 3.1 Commit: a72e59d23d4b104af6d7f30d1dc02a5fe175f3af Also master and 3.0 are checked. the patch is this simple check for messages that don't have a correct CSeq header. Marius Ok, I checked out the latest 3.1 and it's definitely not included. Will patch and recompile... ___ 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