[asterisk-dev] Enable SIP keepalive (OPTIONS?) for calls from unregistered but authenticated peers

Johan Sandgren jsa at svep.se
Mon Jun 3 04:53:49 CDT 2013


Unfortunately the log got corrupted after sending the email, so replacing it with empty line between log rows to make it readable again.

-----Ursprungligt meddelande-----
Från: asterisk-dev-bounces at lists.digium.com [mailto:asterisk-dev-bounces at lists.digium.com] För Johan Sandgren
Skickat: den 3 juni 2013 11:31
Till: Asterisk Developers Mailing List
Ämne: [asterisk-dev] Enable SIP keepalive (OPTIONS?) for calls from unregistered but authenticated peers


Hi everyone,

I need activate SIP keepalives "OPTIONS"-packet (over UDP) for unregistered, but authenticated calls into asterisk.
I have played with the sip.conf settings but have not been able to enable any SIP keepalives when not registered when calling with SIP into Asterisk.
So I decided to go into the source code to modify it to send then even for unregistered calls.

I'm using the registered case, to trace runtime where the code is executing when it's sending the OPTIONS packets every now (every 60s?).
I have tried to trace the code to see what triggers the call to the function "sip_poke_peer_s" but have not been able to see how, or where the 60sec timer is.

Can someone give me info on what triggers it?
And, am I on to a solution when I want to "enable" triggering of this function will send OPTION packets to active call-dialogues (ie in my case my unregistrered but authenticated ongoing call?) ?
Or should I do something else?

Attaching some log for you to see what I've got so far.

The log got corrupted with line endings,

[May 31 18:15:30] WARNING[10118]: chan_sip.c:7595 sip_read: sip_read:sip_read:chan_sip.c

[May 31 18:15:30] WARNING[10118]: chan_sip.c:6636 sip_write: sip_write:sip_write:chan_sip.c

[May 31 18:15:30] WARNING[10062]: chan_sip.c:13989 print_callstack: print_callstack: 7

[May 31 18:15:30] WARNING[10062]: chan_sip.c:14003 print_callstack: /usr/lib/asterisk/modules/chan_sip.so(+0x10cad) [0xb6f18cad]

[May 31 18:15:30] WARNING[10062]: chan_sip.c:14003 print_callstack: /usr/lib/asterisk/modules/chan_sip.so(+0x51b1d) [0xb6f59b1d]

[May 31 18:15:30] WARNING[10062]: chan_sip.c:14003 print_callstack: /usr/sbin/asterisk(ast_sched_runq+0x13b) [0x8185e96]

[May 31 18:15:30] WARNING[10062]: chan_sip.c:14003 print_callstack: /usr/lib/asterisk/modules/chan_sip.so(+0x60cec) [0xb6f68cec]

[May 31 18:15:30] WARNING[10062]: chan_sip.c:14003 print_callstack: /usr/sbin/asterisk() [0x819d58e]

[May 31 18:15:30] WARNING[10062]: chan_sip.c:14003 print_callstack: /lib/i686/cmov/libpthread.so.0(+0x5955) [0xb7463955]

[May 31 18:15:30] WARNING[10062]: chan_sip.c:14003 print_callstack: /lib/i686/cmov/libc.so.6(clone+0x5e) [0xb76fe1de]

[May 31 18:15:30] WARNING[10062]: chan_sip.c:14031 sip_poke_peer_s: poke call

[May 31 18:15:30] WARNING[10062]: chan_sip.c:26835 sip_poke_peer: sip_poke_peer() anropad...

[May 31 18:15:30] WARNING[10062]: chan_sip.c:26852 sip_poke_peer: sip_poke_peer() anropad... 2

[May 31 18:15:30] WARNING[10062]: chan_sip.c:26866 sip_poke_peer: Sip Alloc 12

[May 31 18:15:30] WARNING[10062]: chan_sip.c:7784 sip_alloc: sip_alloc:sip_alloc:chan_sip.c

[May 31 18:15:30] WARNING[10062]: chan_sip.c:3435 build_via: build_via:build_via:chan_sip.c

[May 31 18:15:30] WARNING[10062]: chan_sip.c:7683 build_callid_pvt: build_callid_pvt:build_callid_pvt:chan_sip.c

 [May 31 18:15:30] DEBUG[10062]: chan_sip.c:3122 initialize_initreq: Initializing initreq for method OPTIONS - callid 52c23df1087536651797666d72b1d2b7 at 10.40.0.1:5060

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header  0 [ 57]: OPTIONS sip:ip1 at 10.99.99.99:5060;transport=UDP;ob SIP/2.0

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header  1 [ 60]: Via: SIP/2.0/UDP 10.40.0.1:5060;branch=z9hG4bK7a2f48d0;rport

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header  2 [ 16]: Max-Forwards: 70

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header  3 [ 56]: From: "asterisk" <sip:asterisk at 10.40.0.1>;tag=as66da95f6

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header  4 [ 47]: To: <sip:ip1 at 10.99.99.99:5060;transport=UDP;ob>

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header  5 [ 38]: Contact: <sip:asterisk at 10.40.0.1:5060>

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header  6 [ 56]: Call-ID: 52c23df1087536651797666d72b1d2b7 at 10.40.0.1:5060

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header  7 [ 17]: CSeq: 102 OPTIONS

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header  8 [ 31]: User-Agent: Asterisk PBX 10.0.0

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header  9 [ 35]: Date: Fri, 31 May 2013 16:15:30 GMT

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header 10 [ 81]: Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH

[May 31 18:15:30] DEBUG[10062]: chan_sip.c:8765 parse_request:  Header 11 [ 26]: Supported: replaces, timer

[May 31 18:15:30] WARNING[10062]: chan_sip.c:4259 send_request: send_request:send_request:chan_sip.c

[May 31 18:15:30] WARNING[10062]: chan_sip.c:3238 sip_debug_test_addr: sip_debug_test_addr:sip_debug_test_addr:chan_sip.c


Cheers,
Johan

===================================================


Johan Sandgren
Software Engineer
Svep Design Center AB
S:t Lars väg 42A
222 70 Lund, Sweden
Phone +46 46 192 722
E-mail  jsa at svep.se
Website www.svep.se

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list