Hi All,
I'm trying to add an event route to be execute for each successfully delivered message from msilo module, but I'm still not getting running the event route I have defined for it in the script.
If someone can have a look at the patch and give me some hint would be really great.
Thanks in advance. Roberto Fichera.
Hello,
your patch seems a bit to complex -- I didn't figure out why you store the message in pkg memory.
Also, you change to use Call-ID from database, any reason for that? MESSAGE request doesn't create a dialog and reusing call-id later can result in side effects if the CSeq overlaps or is lower.
Daniel
On 09/06/14 15:47, Roberto Fichera wrote:
Hi All,
I'm trying to add an event route to be execute for each successfully delivered message from msilo module, but I'm still not getting running the event route I have defined for it in the script.
If someone can have a look at the patch and give me some hint would be really great.
Thanks in advance. Roberto Fichera.
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 06/09/2014 05:16 PM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
your patch seems a bit to complex -- I didn't figure out why you store the message in pkg memory.
Ok! So I will need to shm_malloc() the memory in such case, right?
Also, you change to use Call-ID from database, any reason for that? MESSAGE request doesn't create a dialog and reusing call-id later can result in side effects if the CSeq overlaps or is lower.
Ah! Ok! I'll remove it!
Cheers, Roberto Fichera.
Daniel
On 09/06/14 15:47, Roberto Fichera wrote:
Hi All,
I'm trying to add an event route to be execute for each successfully delivered message from msilo module, but I'm still not getting running the event route I have defined for it in the script.
If someone can have a look at the patch and give me some hint would be really great.
Thanks in advance. Roberto Fichera.
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 - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
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,
On 09/06/14 17:41, Roberto Fichera wrote:
[...]
your patch seems a bit to complex -- I didn't figure out why you store the message in pkg memory.
Ok! So I will need to shm_malloc() the memory in such case, right?
I don't get why you need to do that at all. If you need to access from, to, etc..., you can get them from the SIP response. You go in dangerous zone as you do that cloning.
Because you want to execute the event route on 200ok, the best is to run the event route with the SIP response structure.
Cheers, Daniel
On 06/09/2014 05:49 PM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
On 09/06/14 17:41, Roberto Fichera wrote:
[...]
your patch seems a bit to complex -- I didn't figure out why you store the message in pkg memory.
Ok! So I will need to shm_malloc() the memory in such case, right?
I don't get why you need to do that at all. If you need to access from, to, etc..., you can get them from the SIP response. You go in dangerous zone as you do that cloning.
The idea was to set a sip_msg just to have all the pseudo-variable available within the event route and nothing else.
Because you want to execute the event route on 200ok, the best is to run the event route with the SIP response structure.
At the beginning this was my choice, but I'd always got ps->req = NULL in the callback tmcb_params hence the event route wasn't executed. But I'll re-try it just to be sure.
BTW! using shm_malloc() I was finally able to execute the event route in the script with all the pseudo-variable correctly set!
Cheers, Roberto Fichera.
Cheers, Daniel -- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
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 06/09/2014 06:03 PM, Roberto Fichera wrote:
Hi,
On 06/09/2014 05:49 PM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
On 09/06/14 17:41, Roberto Fichera wrote:
[...]
your patch seems a bit to complex -- I didn't figure out why you store the message in pkg memory.
Ok! So I will need to shm_malloc() the memory in such case, right?
I don't get why you need to do that at all. If you need to access from, to, etc..., you can get them from the SIP response. You go in dangerous zone as you do that cloning.
The idea was to set a sip_msg just to have all the pseudo-variable available within the event route and nothing else.
Because you want to execute the event route on 200ok, the best is to run the event route with the SIP response structure.
At the beginning this was my choice, but I'd always got ps->req = NULL in the callback tmcb_params hence the event route wasn't executed. But I'll re-try it just to be sure.
I can confirm, I'm always getting ps->req = NULL
un 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [parser/msg_parser.c:170]: get_hdr_field(): get_hdr_field: cseq <CSeq>: <10> <MESSAGE> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:949]: t_reply_matching(): DEBUG: t_reply_matching: hash 39390 label 0 branch 0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1004]: t_reply_matching(): DEBUG: t_reply_matching: reply matched (T=0xb2f7ebfc)! Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1141]: t_check_msg(): DEBUG: t_check_msg: msg id=1 global id=1 T end=0xb2f7ebfc Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2206]: reply_received(): DEBUG: reply_received: org. status uas=0, uac[0]=0 local=2 is_invite=0) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=200 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0xb2f7ebfc, callback type 1024, id 0 entered Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb301669c Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 147] Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <147> was sent successfully Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:147 fl:4 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) --->>>>> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] ps->req=(nil)) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [xavp.c:448]: xavp_destroy_list(): destroying xavp list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [receive.c:296]: receive_msg(): receive_msg: cleaning up
BTW! using shm_malloc() I was finally able to execute the event route in the script with all the pseudo-variable correctly set!
Attached you will find the patch I'm actually using.
Cheers, Roberto Fichera.
Cheers, Roberto Fichera.
Cheers, Daniel -- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
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,
ps->req is null, because there is no incoming request, but you should have ps->rpl available if there is a 200ok.
Cheers, Daniel
On 09/06/14 18:12, Roberto Fichera wrote:
On 06/09/2014 06:03 PM, Roberto Fichera wrote:
Hi,
On 06/09/2014 05:49 PM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
On 09/06/14 17:41, Roberto Fichera wrote:
[...]
your patch seems a bit to complex -- I didn't figure out why you store the message in pkg memory.
Ok! So I will need to shm_malloc() the memory in such case, right?
I don't get why you need to do that at all. If you need to access from, to, etc..., you can get them from the SIP response. You go in dangerous zone as you do that cloning.
The idea was to set a sip_msg just to have all the pseudo-variable available within the event route and nothing else.
Because you want to execute the event route on 200ok, the best is to run the event route with the SIP response structure.
At the beginning this was my choice, but I'd always got ps->req = NULL in the callback tmcb_params hence the event route wasn't executed. But I'll re-try it just to be sure.
I can confirm, I'm always getting ps->req = NULL
un 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [parser/msg_parser.c:170]: get_hdr_field(): get_hdr_field: cseq <CSeq>: <10> <MESSAGE> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:949]: t_reply_matching(): DEBUG: t_reply_matching: hash 39390 label 0 branch 0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1004]: t_reply_matching(): DEBUG: t_reply_matching: reply matched (T=0xb2f7ebfc)! Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1141]: t_check_msg(): DEBUG: t_check_msg: msg id=1 global id=1 T end=0xb2f7ebfc Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2206]: reply_received(): DEBUG: reply_received: org. status uas=0, uac[0]=0 local=2 is_invite=0) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=200 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0xb2f7ebfc, callback type 1024, id 0 entered Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event():
>> msilo_notification_event 0xb301669c
Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 147] Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <147> was sent successfully Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:147 fl:4 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) --->>>>> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] ps->req=(nil)) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [xavp.c:448]: xavp_destroy_list(): destroying xavp list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [receive.c:296]: receive_msg(): receive_msg: cleaning up
BTW! using shm_malloc() I was finally able to execute the event route in the script with all the pseudo-variable correctly set!
Attached you will find the patch I'm actually using.
Cheers, Roberto Fichera.
Cheers, Roberto Fichera.
Cheers, Daniel -- Daniel-Constantin Mierla -http://www.asipto.com http://twitter.com/#!/miconda -http://www.linkedin.com/in/miconda
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
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 06/09/2014 06:16 PM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
ps->req is null, because there is no incoming request, but you should have ps->rpl available if there is a 200ok.
Which is my case! Only triggered once a 200ok has been received! Anyway it seems to work because the event route get executed but $ru seems not defined:
Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb30cb748 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 148] Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <148> was sent successfully Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:148 fl:4 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] event->req=0xb7275680) Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: <core> [parser/parse_addr_spec.c:176]: parse_to_param(): DEBUG: add_param: tag=90a2f67ea18c2dbc1dd6d5c5f690acb0-25e2 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: <core> [parser/parse_addr_spec.c:893]: parse_addr_spec(): end of header reached, state=29 ---->>>> Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: INFO: <script>: MSILO event on-delivered sip:test1@test.com to <<null>> Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset
Cheers, Roberto Fichera.
Cheers, Daniel
On 09/06/14 18:12, Roberto Fichera wrote:
On 06/09/2014 06:03 PM, Roberto Fichera wrote:
Hi,
On 06/09/2014 05:49 PM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
On 09/06/14 17:41, Roberto Fichera wrote:
[...]
your patch seems a bit to complex -- I didn't figure out why you store the message in pkg memory.
Ok! So I will need to shm_malloc() the memory in such case, right?
I don't get why you need to do that at all. If you need to access from, to, etc..., you can get them from the SIP response. You go in dangerous zone as you do that cloning.
The idea was to set a sip_msg just to have all the pseudo-variable available within the event route and nothing else.
Because you want to execute the event route on 200ok, the best is to run the event route with the SIP response structure.
At the beginning this was my choice, but I'd always got ps->req = NULL in the callback tmcb_params hence the event route wasn't executed. But I'll re-try it just to be sure.
I can confirm, I'm always getting ps->req = NULL
un 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [parser/msg_parser.c:170]: get_hdr_field(): get_hdr_field: cseq <CSeq>: <10> <MESSAGE> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:949]: t_reply_matching(): DEBUG: t_reply_matching: hash 39390 label 0 branch 0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1004]: t_reply_matching(): DEBUG: t_reply_matching: reply matched (T=0xb2f7ebfc)! Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1141]: t_check_msg(): DEBUG: t_check_msg: msg id=1 global id=1 T end=0xb2f7ebfc Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2206]: reply_received(): DEBUG: reply_received: org. status uas=0, uac[0]=0 local=2 is_invite=0) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=200 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0xb2f7ebfc, callback type 1024, id 0 entered Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb301669c Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 147] Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <147> was sent successfully Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:147 fl:4 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) --->>>>> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] ps->req=(nil)) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [xavp.c:448]: xavp_destroy_list(): destroying xavp list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [receive.c:296]: receive_msg(): receive_msg: cleaning up
BTW! using shm_malloc() I was finally able to execute the event route in the script with all the pseudo-variable correctly set!
Attached you will find the patch I'm actually using.
Cheers, Roberto Fichera.
Cheers, Roberto Fichera.
Cheers, Daniel -- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
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
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 - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
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,
the $ru should be the same as $tu in this case. $ru will change when the message loops back and there is a lookup("location") in the config, but in the callback you don't get it.
If you really want to get the content of the sip MESSAGE request sent out, you can find it in the t->uac[0].request.buffer (iirc) as plain text. you can take it from there and parse it in a sip_msg_t structure inside the callback. But with the SIP reply structure you may get what you need (if you just need $ru which is available in $tu).
Cheers, Daniel
On 09/06/14 18:29, Roberto Fichera wrote:
On 06/09/2014 06:16 PM, Daniel-Constantin Mierla wrote:
[...]
ps->req is null, because there is no incoming request, but you should have ps->rpl available if there is a 200ok.
Which is my case! Only triggered once a 200ok has been received! Anyway it seems to work because the event route get executed but $ru seems not defined:
Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event():
>> msilo_notification_event 0xb30cb748
Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 148] Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <148> was sent successfully Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:148 fl:4 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] event->req=0xb7275680) Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: <core> [parser/parse_addr_spec.c:176]: parse_to_param(): DEBUG: add_param: tag=90a2f67ea18c2dbc1dd6d5c5f690acb0-25e2 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: <core> [parser/parse_addr_spec.c:893]: parse_addr_spec(): end of header reached, state=29 ---->>>> Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: INFO: <script>: MSILO event on-delivered sip:test1@test.com to <<null>> Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset
Cheers, Roberto Fichera.
Cheers, Daniel
On 09/06/14 18:12, Roberto Fichera wrote:
On 06/09/2014 06:03 PM, Roberto Fichera wrote:
Hi,
On 06/09/2014 05:49 PM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
On 09/06/14 17:41, Roberto Fichera wrote:
[...]
> your patch seems a bit to complex -- I didn't figure out why you > store the message in pkg memory.
Ok! So I will need to shm_malloc() the memory in such case, right?
I don't get why you need to do that at all. If you need to access from, to, etc..., you can get them from the SIP response. You go in dangerous zone as you do that cloning.
The idea was to set a sip_msg just to have all the pseudo-variable available within the event route and nothing else.
Because you want to execute the event route on 200ok, the best is to run the event route with the SIP response structure.
At the beginning this was my choice, but I'd always got ps->req = NULL in the callback tmcb_params hence the event route wasn't executed. But I'll re-try it just to be sure.
I can confirm, I'm always getting ps->req = NULL
un 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [parser/msg_parser.c:170]: get_hdr_field(): get_hdr_field: cseq <CSeq>: <10> <MESSAGE> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:949]: t_reply_matching(): DEBUG: t_reply_matching: hash 39390 label 0 branch 0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1004]: t_reply_matching(): DEBUG: t_reply_matching: reply matched (T=0xb2f7ebfc)! Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1141]: t_check_msg(): DEBUG: t_check_msg: msg id=1 global id=1 T end=0xb2f7ebfc Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2206]: reply_received(): DEBUG: reply_received: org. status uas=0, uac[0]=0 local=2 is_invite=0) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=200 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0xb2f7ebfc, callback type 1024, id 0 entered Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb301669c Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 147] Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <147> was sent successfully Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:147 fl:4 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) --->>>>> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] ps->req=(nil)) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [xavp.c:448]: xavp_destroy_list(): destroying xavp list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [receive.c:296]: receive_msg(): receive_msg: cleaning up
BTW! using shm_malloc() I was finally able to execute the event route in the script with all the pseudo-variable correctly set!
Attached you will find the patch I'm actually using.
Cheers, Roberto Fichera.
Cheers, Roberto Fichera.
Cheers, Daniel -- Daniel-Constantin Mierla -http://www.asipto.com http://twitter.com/#!/miconda -http://www.linkedin.com/in/miconda
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
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 -http://www.asipto.com http://twitter.com/#!/miconda -http://www.linkedin.com/in/miconda
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
On 06/09/2014 08:55 PM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
the $ru should be the same as $tu in this case. $ru will change when the message loops back and there is a lookup("location") in the config, but in the callback you don't get it.
If you really want to get the content of the sip MESSAGE request sent out, you can find it in the t->uac[0].request.buffer (iirc) as plain text. you can take it from there and parse it in a sip_msg_t structure inside the callback. But with the SIP reply structure you may get what you need (if you just need $ru which is available in $tu).
I've tried your suggestion but looks like something is missing in the buffer, the code I've added just for testing is the following:
/* execute the msilo:on-delivered event route */ if(unlikely(msilo_event_on_delivered>=0)) { int sflag_bk; int backup_route_type; struct run_act_ctx ctx; struct sip_msg req;
-->>> if (parse_msg(t->uac[0].request.buffer, t->uac[0].request.buffer_len, &req) != 0) { LM_ERR("parse_msg failed\n"); goto done; }
LM_DBG("executing event_route[msilo:on-delivered] (%d)\n", msilo_event_on_delivered);
sflag_bk = getsflags(); backup_route_type = get_route_type();
set_route_type(EVENT_ROUTE); init_run_actions_ctx(&ctx); LM_DBG("event_route[msilo:on-delivered] req=%p)\n", &req); run_top_route(event_rt.rlist[msilo_event_on_delivered], &req, &ctx);
set_route_type(backup_route_type); setsflagsval(sflag_bk);
shm_free(event->req->buf); shm_free(event->req); shm_free(event); }
but doesn't properly work:
Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: DEBUG: msilo [msilo.c:1417]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] event->req=0xbf81b830) ---->>>> Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: ERROR: <core> [parser/parse_from.c:58]: parse_from_header(): ERROR:parse_from_header: bad msg or missing FROM header ---->>>> Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: ERROR: pv [pv_core.c:449]: pv_get_from_attr(): cannot parse From header Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: INFO: <script>: MSILO event on-delivered <<null>> to <??????? Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29250]: : <core> [pass_fd.c:293]: receive_fd(): ERROR: receive_fd: EOF on 13 Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29227]: ALERT: <core> [main.c:775]: handle_sigs(): child process 29231 exited by a signal 11 Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29250]: DEBUG: <core> [tcp_main.c:3595]: handle_ser_child(): DBG: handle_ser_child: dead child 2, pid 29231 (shutting down?) Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29227]: ALERT: <core> [main.c:778]: handle_sigs(): core was not generated Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29250]: DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x82cf640, 13, -1, 0x0) fd_no=23 called Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29227]: INFO: <core> [main.c:790]: handle_sigs(): INFO: terminating due to SIGCHLD Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29249]: INFO: <core> [main.c:841]: sig_usr(): INFO: signal 15 received
Cheers, Roberto Fichera.
Cheers, Daniel
On 09/06/14 18:29, Roberto Fichera wrote:
On 06/09/2014 06:16 PM, Daniel-Constantin Mierla wrote:
[...]
ps->req is null, because there is no incoming request, but you should have ps->rpl available if there is a 200ok.
Which is my case! Only triggered once a 200ok has been received! Anyway it seems to work because the event route get executed but $ru seems not defined:
Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb30cb748 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 148] Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <148> was sent successfully Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:148 fl:4 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] event->req=0xb7275680) Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: <core> [parser/parse_addr_spec.c:176]: parse_to_param(): DEBUG: add_param: tag=90a2f67ea18c2dbc1dd6d5c5f690acb0-25e2 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: <core> [parser/parse_addr_spec.c:893]: parse_addr_spec(): end of header reached, state=29 ---->>>> Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: INFO: <script>: MSILO event on-delivered sip:test1@test.com to <<null>> Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset
Cheers, Roberto Fichera.
Cheers, Daniel
On 09/06/14 18:12, Roberto Fichera wrote:
On 06/09/2014 06:03 PM, Roberto Fichera wrote:
Hi,
On 06/09/2014 05:49 PM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
On 09/06/14 17:41, Roberto Fichera wrote: > [...] > >> your patch seems a bit to complex -- I didn't figure out why you store the message in pkg memory. > > Ok! So I will need to shm_malloc() the memory in such case, right? I don't get why you need to do that at all. If you need to access from, to, etc..., you can get them from the SIP response. You go in dangerous zone as you do that cloning.
The idea was to set a sip_msg just to have all the pseudo-variable available within the event route and nothing else.
Because you want to execute the event route on 200ok, the best is to run the event route with the SIP response structure.
At the beginning this was my choice, but I'd always got ps->req = NULL in the callback tmcb_params hence the event route wasn't executed. But I'll re-try it just to be sure.
I can confirm, I'm always getting ps->req = NULL
un 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [parser/msg_parser.c:170]: get_hdr_field(): get_hdr_field: cseq <CSeq>: <10> <MESSAGE> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:949]: t_reply_matching(): DEBUG: t_reply_matching: hash 39390 label 0 branch 0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1004]: t_reply_matching(): DEBUG: t_reply_matching: reply matched (T=0xb2f7ebfc)! Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1141]: t_check_msg(): DEBUG: t_check_msg: msg id=1 global id=1 T end=0xb2f7ebfc Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2206]: reply_received(): DEBUG: reply_received: org. status uas=0, uac[0]=0 local=2 is_invite=0) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=200 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0xb2f7ebfc, callback type 1024, id 0 entered Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb301669c Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 147] Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <147> was sent successfully Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:147 fl:4 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) --->>>>> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] ps->req=(nil)) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [xavp.c:448]: xavp_destroy_list(): destroying xavp list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [receive.c:296]: receive_msg(): receive_msg: cleaning up
BTW! using shm_malloc() I was finally able to execute the event route in the script with all the pseudo-variable correctly set!
Attached you will find the patch I'm actually using.
Cheers, Roberto Fichera.
Cheers, Roberto Fichera.
Cheers, Daniel
Hello,
the parse from error don't seem to be from parse_msg().
Can you print the uac buffer and send it over here to see if it is something wrong there?
You get a crash as well, very likely due to the shm free at the end.
Cheers, Daniel
On 10/06/14 09:40, Roberto Fichera wrote:
On 06/09/2014 08:55 PM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
the $ru should be the same as $tu in this case. $ru will change when the message loops back and there is a lookup("location") in the config, but in the callback you don't get it.
If you really want to get the content of the sip MESSAGE request sent out, you can find it in the t->uac[0].request.buffer (iirc) as plain text. you can take it from there and parse it in a sip_msg_t structure inside the callback. But with the SIP reply structure you may get what you need (if you just need $ru which is available in $tu).
I've tried your suggestion but looks like something is missing in the buffer, the code I've added just for testing is the following:
/* execute the msilo:on-delivered event route */ if(unlikely(msilo_event_on_delivered>=0)) { int sflag_bk; int backup_route_type; struct run_act_ctx ctx; struct sip_msg req;
-->>> if (parse_msg(t->uac[0].request.buffer, t->uac[0].request.buffer_len, &req) != 0) { LM_ERR("parse_msg failed\n"); goto done; }
LM_DBG("executing event_route[msilo:on-delivered]
(%d)\n", msilo_event_on_delivered);
sflag_bk = getsflags(); backup_route_type = get_route_type(); set_route_type(EVENT_ROUTE); init_run_actions_ctx(&ctx); LM_DBG("event_route[msilo:on-delivered] req=%p)\n", &req);
run_top_route(event_rt.rlist[msilo_event_on_delivered], &req, &ctx);
set_route_type(backup_route_type); setsflagsval(sflag_bk); shm_free(event->req->buf); shm_free(event->req); shm_free(event); }
but doesn't properly work:
Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: DEBUG: msilo [msilo.c:1417]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] event->req=0xbf81b830) ---->>>> Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: ERROR: <core> [parser/parse_from.c:58]: parse_from_header(): ERROR:parse_from_header: bad msg or missing FROM header ---->>>> Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: ERROR: pv [pv_core.c:449]: pv_get_from_attr(): cannot parse From header Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: INFO: <script>: MSILO event on-delivered <<null>> to <������ͫ Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29250]: : <core> [pass_fd.c:293]: receive_fd(): ERROR: receive_fd: EOF on 13 Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29227]: ALERT: <core> [main.c:775]: handle_sigs(): child process 29231 exited by a signal 11 Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29250]: DEBUG: <core> [tcp_main.c:3595]: handle_ser_child(): DBG: handle_ser_child: dead child 2, pid 29231 (shutting down?) Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29227]: ALERT: <core> [main.c:778]: handle_sigs(): core was not generated Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29250]: DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x82cf640, 13, -1, 0x0) fd_no=23 called Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29227]: INFO: <core> [main.c:790]: handle_sigs(): INFO: terminating due to SIGCHLD Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29249]: INFO: <core> [main.c:841]: sig_usr(): INFO: signal 15 received
Cheers, Roberto Fichera.
Cheers, Daniel
On 09/06/14 18:29, Roberto Fichera wrote:
On 06/09/2014 06:16 PM, Daniel-Constantin Mierla wrote:
[...]
ps->req is null, because there is no incoming request, but you should have ps->rpl available if there is a 200ok.
Which is my case! Only triggered once a 200ok has been received! Anyway it seems to work because the event route get executed but $ru seems not defined:
Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb30cb748 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 148] Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <148> was sent successfully Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:148 fl:4 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] event->req=0xb7275680) Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: <core> [parser/parse_addr_spec.c:176]: parse_to_param(): DEBUG: add_param: tag=90a2f67ea18c2dbc1dd6d5c5f690acb0-25e2 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: <core> [parser/parse_addr_spec.c:893]: parse_addr_spec(): end of header reached, state=29 ---->>>> Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: INFO: <script>: MSILO event on-delivered sip:test1@test.com to <<null>> Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset
Cheers, Roberto Fichera.
Cheers, Daniel
On 09/06/14 18:12, Roberto Fichera wrote:
On 06/09/2014 06:03 PM, Roberto Fichera wrote:
Hi,
On 06/09/2014 05:49 PM, Daniel-Constantin Mierla wrote: > Hello,
Hi,
> On 09/06/14 17:41, Roberto Fichera wrote: >> [...] >> >>> your patch seems a bit to complex -- I didn't figure out why >>> you store the message in pkg memory. >> >> Ok! So I will need to shm_malloc() the memory in such case, right? > I don't get why you need to do that at all. If you need to > access from, to, etc..., you can get them from the SIP response. > You go in dangerous zone as you do that cloning.
The idea was to set a sip_msg just to have all the pseudo-variable available within the event route and nothing else.
> Because you want to execute the event route on 200ok, the best > is to run the event route with the SIP response structure.
At the beginning this was my choice, but I'd always got ps->req = NULL in the callback tmcb_params hence the event route wasn't executed. But I'll re-try it just to be sure.
I can confirm, I'm always getting ps->req = NULL
un 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [parser/msg_parser.c:170]: get_hdr_field(): get_hdr_field: cseq <CSeq>: <10> <MESSAGE> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:949]: t_reply_matching(): DEBUG: t_reply_matching: hash 39390 label 0 branch 0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1004]: t_reply_matching(): DEBUG: t_reply_matching: reply matched (T=0xb2f7ebfc)! Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1141]: t_check_msg(): DEBUG: t_check_msg: msg id=1 global id=1 T end=0xb2f7ebfc Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2206]: reply_received(): DEBUG: reply_received: org. status uas=0, uac[0]=0 local=2 is_invite=0) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=200 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0xb2f7ebfc, callback type 1024, id 0 entered Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb301669c Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 147] Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <147> was sent successfully Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:147 fl:4 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) --->>>>> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] ps->req=(nil)) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [xavp.c:448]: xavp_destroy_list(): destroying xavp list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [receive.c:296]: receive_msg(): receive_msg: cleaning up
BTW! using shm_malloc() I was finally able to execute the event route in the script with all the pseudo-variable correctly set!
Attached you will find the patch I'm actually using.
Cheers, Roberto Fichera.
Cheers, Roberto Fichera.
> > Cheers, > Daniel
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 06/10/2014 10:20 AM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
the parse from error don't seem to be from parse_msg().
Can you print the uac buffer and send it over here to see if it is something wrong there?
Jun 10 09:32:29 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29663]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): t->uac[0].request.buffer: MESSAGE sip:test1@test.com SIP/2.0
I've used LM_DBG() to print it.
You get a crash as well, very likely due to the shm free at the end.
The rest of the code hasn't changed, so I kept all the shm_malloc(), actually I do not expect them to fail.
Cheers, Roberto Fichera.
Cheers, Daniel
On 10/06/14 09:40, Roberto Fichera wrote:
On 06/09/2014 08:55 PM, Daniel-Constantin Mierla wrote:
Hello,
Hi,
the $ru should be the same as $tu in this case. $ru will change when the message loops back and there is a lookup("location") in the config, but in the callback you don't get it.
If you really want to get the content of the sip MESSAGE request sent out, you can find it in the t->uac[0].request.buffer (iirc) as plain text. you can take it from there and parse it in a sip_msg_t structure inside the callback. But with the SIP reply structure you may get what you need (if you just need $ru which is available in $tu).
I've tried your suggestion but looks like something is missing in the buffer, the code I've added just for testing is the following:
/* execute the msilo:on-delivered event route */ if(unlikely(msilo_event_on_delivered>=0)) { int sflag_bk; int backup_route_type; struct run_act_ctx ctx; struct sip_msg req;
-->>> if (parse_msg(t->uac[0].request.buffer, t->uac[0].request.buffer_len, &req) != 0) { LM_ERR("parse_msg failed\n"); goto done; }
LM_DBG("executing event_route[msilo:on-delivered] (%d)\n", msilo_event_on_delivered); sflag_bk = getsflags(); backup_route_type = get_route_type(); set_route_type(EVENT_ROUTE); init_run_actions_ctx(&ctx); LM_DBG("event_route[msilo:on-delivered] req=%p)\n", &req); run_top_route(event_rt.rlist[msilo_event_on_delivered], &req, &ctx); set_route_type(backup_route_type); setsflagsval(sflag_bk); shm_free(event->req->buf); shm_free(event->req); shm_free(event); }
but doesn't properly work:
Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: DEBUG: msilo [msilo.c:1417]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] event->req=0xbf81b830) ---->>>> Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: ERROR: <core> [parser/parse_from.c:58]: parse_from_header(): ERROR:parse_from_header: bad msg or missing FROM header ---->>>> Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: ERROR: pv [pv_core.c:449]: pv_get_from_attr(): cannot parse From header Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29231]: INFO: <script>: MSILO event on-delivered <<null>> to <??????? Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29250]: : <core> [pass_fd.c:293]: receive_fd(): ERROR: receive_fd: EOF on 13 Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29227]: ALERT: <core> [main.c:775]: handle_sigs(): child process 29231 exited by a signal 11 Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29250]: DEBUG: <core> [tcp_main.c:3595]: handle_ser_child(): DBG: handle_ser_child: dead child 2, pid 29231 (shutting down?) Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29227]: ALERT: <core> [main.c:778]: handle_sigs(): core was not generated Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29250]: DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x82cf640, 13, -1, 0x0) fd_no=23 called Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29227]: INFO: <core> [main.c:790]: handle_sigs(): INFO: terminating due to SIGCHLD Jun 10 08:32:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29249]: INFO: <core> [main.c:841]: sig_usr(): INFO: signal 15 received
Cheers, Roberto Fichera.
Cheers, Daniel
On 09/06/14 18:29, Roberto Fichera wrote:
On 06/09/2014 06:16 PM, Daniel-Constantin Mierla wrote:
[...]
ps->req is null, because there is no incoming request, but you should have ps->rpl available if there is a 200ok.
Which is my case! Only triggered once a 200ok has been received! Anyway it seems to work because the event route get executed but $ru seems not defined:
Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb30cb748 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 148] Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <148> was sent successfully Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:148 fl:4 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] event->req=0xb7275680) Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: <core> [parser/parse_addr_spec.c:176]: parse_to_param(): DEBUG: add_param: tag=90a2f67ea18c2dbc1dd6d5c5f690acb0-25e2 Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: <core> [parser/parse_addr_spec.c:893]: parse_addr_spec(): end of header reached, state=29 ---->>>> Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: INFO: <script>: MSILO event on-delivered sip:test1@test.com to <<null>> Jun 09 17:25:01 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25288]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset
Cheers, Roberto Fichera.
Cheers, Daniel
On 09/06/14 18:12, Roberto Fichera wrote:
On 06/09/2014 06:03 PM, Roberto Fichera wrote:
Hi,
> On 06/09/2014 05:49 PM, Daniel-Constantin Mierla wrote: >> Hello, > > Hi, > >> On 09/06/14 17:41, Roberto Fichera wrote: >>> [...] >>> >>>> your patch seems a bit to complex -- I didn't figure out why you store the message in pkg memory. >>> >>> Ok! So I will need to shm_malloc() the memory in such case, right? >> I don't get why you need to do that at all. If you need to access from, to, etc..., you can get them from the >> SIP response. You go in dangerous zone as you do that cloning. > > The idea was to set a sip_msg just to have all the pseudo-variable available > within the event route and nothing else. > >> Because you want to execute the event route on 200ok, the best is to run the event route with the SIP response >> structure. > > At the beginning this was my choice, but I'd always got ps->req = NULL in the callback tmcb_params > hence the event route wasn't executed. But I'll re-try it just to be sure.
I can confirm, I'm always getting ps->req = NULL
un 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [parser/msg_parser.c:170]: get_hdr_field(): get_hdr_field: cseq <CSeq>: <10> <MESSAGE> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:949]: t_reply_matching(): DEBUG: t_reply_matching: hash 39390 label 0 branch 0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1004]: t_reply_matching(): DEBUG: t_reply_matching: reply matched (T=0xb2f7ebfc)! Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_lookup.c:1141]: t_check_msg(): DEBUG: t_check_msg: msg id=1 global id=1 T end=0xb2f7ebfc Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2206]: reply_received(): DEBUG: reply_received: org. status uas=0, uac[0]=0 local=2 is_invite=0) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=200 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0xb2f7ebfc, callback type 1024, id 0 entered Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb301669c Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 147] Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <147> was sent successfully Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:147 fl:4 Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) --->>>>> Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: msilo [msilo.c:1410]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] ps->req=(nil)) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [xavp.c:448]: xavp_destroy_list(): destroying xavp list (nil) Jun 09 17:06:38 ip-10-227-0-26.localdomain /usr/sbin/kamailio[25089]: DEBUG: <core> [receive.c:296]: receive_msg(): receive_msg: cleaning up
> > BTW! using shm_malloc() I was finally able to execute the event route in the script with all the > pseudo-variable correctly set!
Attached you will find the patch I'm actually using.
Cheers, Roberto Fichera.
> > Cheers, > Roberto Fichera. > >> >> Cheers, >> Daniel
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 - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
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 10/06/14 10:37, Roberto Fichera wrote:
[..]
the parse from error don't seem to be from parse_msg().
Can you print the uac buffer and send it over here to see if it is something wrong there?
Jun 10 09:32:29 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29663]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): t->uac[0].request.buffer: MESSAGE sip:test1@test.com SIP/2.0
I've used LM_DBG() to print it.
Can you paste here the full LM_DBG line? It prints only the first line. Maybe you can print also the length of the buffer which is a special field just to see its value.
Cheers, Daniel
You get a crash as well, very likely due to the shm free at the end.
The rest of the code hasn't changed, so I kept all the shm_malloc(), actually I do not expect them to fail.
Cheers, Roberto Fichera.
On 06/10/2014 12:22 PM, Daniel-Constantin Mierla wrote:
Hi,
On 10/06/14 10:37, Roberto Fichera wrote:
[..]
the parse from error don't seem to be from parse_msg().
Can you print the uac buffer and send it over here to see if it is something wrong there?
Jun 10 09:32:29 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29663]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): t->uac[0].request.buffer: MESSAGE sip:test1@test.com SIP/2.0
I've used LM_DBG() to print it.
Can you paste here the full LM_DBG line? It prints only the first line. Maybe you can print also the length of the buffer which is a special field just to see its value.
this is what journalctl -xfa is printing out. Likely it is truncating the output.
Cheers, Daniel
You get a crash as well, very likely due to the shm free at the end.
The rest of the code hasn't changed, so I kept all the shm_malloc(), actually I do not expect them to fail.
Cheers, Roberto Fichera.
-- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
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 06/10/2014 12:40 PM, Roberto Fichera wrote:
Hi,
On 06/10/2014 12:22 PM, Daniel-Constantin Mierla wrote:
Hi,
On 10/06/14 10:37, Roberto Fichera wrote:
[..]
the parse from error don't seem to be from parse_msg().
Can you print the uac buffer and send it over here to see if it is something wrong there?
Jun 10 09:32:29 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29663]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): t->uac[0].request.buffer: MESSAGE sip:test1@test.com SIP/2.0
I've used LM_DBG() to print it.
Can you paste here the full LM_DBG line? It prints only the first line. Maybe you can print also the length of the buffer which is a special field just to see its value.
this is what journalctl -xfa is printing out. Likely it is truncating the output.
This is what the t->uac[0].request.buffer has in the callback:
MESSAGE sip:test1@test.com SIP/2.0 Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK6c43.66304147000000000000000000000000.0 To: sip:test1@test.com From: sip:test2@test.com;tag=90a2f67ea18c2dbc1dd6d5c5f690acb0-5ca3 CSeq: 10 MESSAGE Call-ID: 3f7b9fdc-4789@10.227.0.26 Max-Forwards: 70 Content-Length: 18 User-Agent: kamailio (4.1.3 (i386/linux)) Date: Wed, 11 Jun 2014 13:59:48 GMT Content-Type: text/chat DICE-Msg-Id: 332a0c12-82c5-4bac-ab3f-80626ebfa108 MSILO: true
test message
while the log shown:
Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:192]: get_hdr_field(): DEBUG: to body [sip:test1@test.com] Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:170]: get_hdr_field(): get_hdr_field: cseq <CSeq>: <10> <MESSAGE> Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_lookup.c:949]: t_reply_matching(): DEBUG: t_reply_matching: hash 59261 label 0 branch 0 Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_lookup.c:1004]: t_reply_matching(): DEBUG: t_reply_matching: reply matched (T=0xb2fc5bfc)! Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_lookup.c:1141]: t_check_msg(): DEBUG: t_check_msg: msg id=1 global id=1 T end=0xb2fc5bfc Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_reply.c:2206]: reply_received(): DEBUG: reply_received: org. status uas=0, uac[0]=0 local=2 is_invite=0) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=200 Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0xb2fc5bfc, callback type 1024, id 0 entered Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb30a4e14 Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 157] Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <157> was sent successfully Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:157 fl:4 Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:623]: parse_msg(): SIP Request: Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:625]: parse_msg(): method: <MESSAGE> Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:627]: parse_msg(): uri: sip:test1@test.com Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:629]: parse_msg(): version: <SIP/2.0> Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [msilo.c:1412]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [msilo.c:1419]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] req=0xbfcbbdd0) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: ERROR: <core> [parser/parse_from.c:58]: parse_from_header(): ERROR:parse_from_header: bad msg or missing FROM header Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: ERROR: pv [pv_core.c:449]: pv_get_from_attr(): cannot parse From header Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: INFO: <script>: MSILO event on-delivered <<null>> to sip:test1@test.com Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: INFO: <script>: AVP(MSILO)=<null> Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: INFO: <script>: AVP(DICE-Msg-Id)=<null> Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [xavp.c:448]: xavp_destroy_list(): destroying xavp list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [receive.c:296]: receive_msg(): receive_msg: cleaning up
Cheers, Roberto Fichera.
Cheers, Daniel
You get a crash as well, very likely due to the shm free at the end.
The rest of the code hasn't changed, so I kept all the shm_malloc(), actually I do not expect them to fail.
Cheers, Roberto Fichera.
-- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
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
On 06/11/2014 04:17 PM, Roberto Fichera wrote:
Hi Daniel,
do you have an idea why I'm getting the issue below?
Cheers, Roberto Fichera.
On 06/10/2014 12:40 PM, Roberto Fichera wrote:
Hi,
On 06/10/2014 12:22 PM, Daniel-Constantin Mierla wrote:
Hi,
On 10/06/14 10:37, Roberto Fichera wrote:
[..]
the parse from error don't seem to be from parse_msg().
Can you print the uac buffer and send it over here to see if it is something wrong there?
Jun 10 09:32:29 ip-10-227-0-26.localdomain /usr/sbin/kamailio[29663]: DEBUG: msilo [msilo.c:1403]: m_tm_callback_on_delivered_event(): t->uac[0].request.buffer: MESSAGE sip:test1@test.com SIP/2.0
I've used LM_DBG() to print it.
Can you paste here the full LM_DBG line? It prints only the first line. Maybe you can print also the length of the buffer which is a special field just to see its value.
this is what journalctl -xfa is printing out. Likely it is truncating the output.
This is what the t->uac[0].request.buffer has in the callback:
MESSAGE sip:test1@test.com SIP/2.0 Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK6c43.66304147000000000000000000000000.0 To: sip:test1@test.com From: sip:test2@test.com;tag=90a2f67ea18c2dbc1dd6d5c5f690acb0-5ca3 CSeq: 10 MESSAGE Call-ID: 3f7b9fdc-4789@10.227.0.26 Max-Forwards: 70 Content-Length: 18 User-Agent: kamailio (4.1.3 (i386/linux)) Date: Wed, 11 Jun 2014 13:59:48 GMT Content-Type: text/chat DICE-Msg-Id: 332a0c12-82c5-4bac-ab3f-80626ebfa108 MSILO: true
test message
while the log shown:
Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:192]: get_hdr_field(): DEBUG: to body [sip:test1@test.com] Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:170]: get_hdr_field(): get_hdr_field: cseq <CSeq>: <10> <MESSAGE> Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_lookup.c:949]: t_reply_matching(): DEBUG: t_reply_matching: hash 59261 label 0 branch 0 Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_lookup.c:1004]: t_reply_matching(): DEBUG: t_reply_matching: reply matched (T=0xb2fc5bfc)! Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_lookup.c:1141]: t_check_msg(): DEBUG: t_check_msg: msg id=1 global id=1 T end=0xb2fc5bfc Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_reply.c:2206]: reply_received(): DEBUG: reply_received: org. status uas=0, uac[0]=0 local=2 is_invite=0) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=200 Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0xb2fc5bfc, callback type 1024, id 0 entered Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [msilo.c:1378]: m_tm_callback_on_delivered_event(): >>>>>>> msilo_notification_event 0xb30a4e14 Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [msilo.c:1380]: m_tm_callback_on_delivered_event(): completed with status 200 [mid: 157] Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [msilo.c:1393]: m_tm_callback_on_delivered_event(): message <157> was sent successfully Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:157 fl:4 Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:623]: parse_msg(): SIP Request: Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:625]: parse_msg(): method: <MESSAGE> Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:627]: parse_msg(): uri: sip:test1@test.com Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [parser/msg_parser.c:629]: parse_msg(): version: <SIP/2.0> Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [msilo.c:1412]: m_tm_callback_on_delivered_event(): executing event_route[msilo:on-delivered] (1) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: msilo [msilo.c:1419]: m_tm_callback_on_delivered_event(): event_route[msilo:on-delivered] req=0xbfcbbdd0) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: ERROR: <core> [parser/parse_from.c:58]: parse_from_header(): ERROR:parse_from_header: bad msg or missing FROM header Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: ERROR: pv [pv_core.c:449]: pv_get_from_attr(): cannot parse From header Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: INFO: <script>: MSILO event on-delivered <<null>> to sip:test1@test.com Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: INFO: <script>: AVP(MSILO)=<null> Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: INFO: <script>: AVP(DICE-Msg-Id)=<null> Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: tm [t_reply.c:1663]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [usr_avp.c:644]: destroy_avp_list(): DEBUG:destroy_avp_list: destroying list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [xavp.c:448]: xavp_destroy_list(): destroying xavp list (nil) Jun 11 15:06:24 ip-10-227-0-26.localdomain /usr/sbin/kamailio[4895]: DEBUG: <core> [receive.c:296]: receive_msg(): receive_msg: cleaning up
Cheers, Roberto Fichera.
Cheers, Daniel
You get a crash as well, very likely due to the shm free at the end.
The rest of the code hasn't changed, so I kept all the shm_malloc(), actually I do not expect them to fail.
Cheers, Roberto Fichera.