Page 1 of 1

Patching chan_sip.c with CPD patch fails

PostPosted: Wed Jan 27, 2010 1:18 am
by raysolomon
Goal is to install the free trial of Sangoma Call Analyzer so I can have better call detection than the standard AMD.
The managers manual recommends to install this software and so have other people on this forum.

But before I can do that, there appears to be a prerequisite.
In the /docs/Sangoma_Netborder_CPD_Walkthrough.txt, it says to patch chan_sip.c with netborder-cpd-1.4.patch.

Here is basically what I did:

# cd /usr/src/asterisk/asterisk-1.4.21.2
# cp /usr/src/astguiclient/trunk/extras/netborder-cpd-1.4.patch .
# patch channels/chan_sip.c -p1 < netborder-cpd-1.4.patch

Hunk #1 FAILED at 1454.
Hunk #2 succeeded at 4280 with fuzz 2 (offset 32 lines).
Hunk #3 FAILED at 7028.
Hunk #4 succeeded at 7119 with fuzz 2 (offset 36 lines).
Hunk #5 FAILED at 12812.
3 out of 5 hunks FAILED -- saving rejects to file channels/chan_sip.c.rej


If I put the original chan_sip.c back, then patch it again with vicidial_paraxip_chan_sip-1.4.patch, then I get this error:

Hunk #1 FAILED at 6964.
Hunk #2 succeeded at 7087 with fuzz 2 (offset 36 lines).
Hunk #3 succeeded at 12254 (offset 36 lines).
1 out of 3 hunks FAILED -- saving rejects to file channels/chan_sip.c.rej

Both patches fail.
It appears the instructions are outdated and I saw no other suggestions on this forum.

What is the correct patching procedure?

PostPosted: Wed Jan 27, 2010 7:17 am
by mflorell
Our 1.4.21.2 package already has this patched in it:
http://download.vicidial.com/required-a ... ici.tar.gz

PostPosted: Wed Jan 27, 2010 3:16 pm
by raysolomon
ok thank you.

PostPosted: Thu Sep 23, 2010 12:35 pm
by omarrodriguezt
Hello,
I'm having the same situation.
The only way to get it work is upgrade to 1.4?
:)

having same patch problem

PostPosted: Wed Sep 28, 2011 2:37 pm
by kevinq9307
My Asterisk is 1.4.39.1-vici. I am doing the patch because when I change routing extension to 8369, system AMD would take over instead of working with Sangoma NCA. I have CPD AMD Action=message, AMD Send to VM exten=y, and a voice file in Answering Machine Message field. When I pick up the remote and speak Hello once, I would hear a click then it goes to message. But if I speak Hello twice with 1/2 second in between, it connects to an agent. Can someone help explain why this is happening. Thanks.

Here is the patch error:
Hunk #1 FAILED at 6964.
Hunk #2 succeeded at 7087 with fuzz 2 (offset 36 lines).
Hunk #3 succeeded at 12254 (offset 36 lines).
1 out of 3 hunks FAILED -- saving rejects to file channels/chan_sip.c.rej

Here is the Asterisk cli:

---
[Sep 28 12:33:17] -- SIP/paraxip-00000007 answered Local/913108184330@default-e1ec,2
[Sep 28 12:33:17] > Channel Local/913108184330@default-e1ec,1 was answered.
[Sep 28 12:33:17] -- Executing [8369@default:1] Playback("Local/913108184330@default-e1ec,1", "sip-silence") in new stack
[Sep 28 12:33:17] -- <Local/913108184330@default-e1ec,1> Playing 'sip-silence' (language 'en')
[Sep 28 12:33:17] WARNING[23159]: file.c:1297 waitstream_core: Unexpected control subclass '-1'
[Sep 28 12:33:17] -- Executing [h@default:1] DeadAGI("Local/913108184330@default-e1ec,2", "agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----16-----ANSWER-----12-----0") in new stack
[Sep 28 12:33:17] -- Executing [8369@default:2] AGI("SIP/paraxip-00000007", "agi://127.0.0.1:4577/call_log") in new stack
[Sep 28 12:33:17] -- AGI Script agi://127.0.0.1:4577/call_log completed, returning 0
[Sep 28 12:33:17] -- Executing [8369@default:3] AMD("SIP/paraxip-00000007", "500|500|1000|5000|120|50|4|256") in new stack
[Sep 28 12:33:17] -- AMD: SIP/paraxip-00000007 8005551212 (null) (Fmt: 64)
[Sep 28 12:33:17] -- AMD: initialSilence [500] greeting [500] afterGreetingSilence [1000] totalAnalysisTime [5000] minimumWordLength [120] betweenWordsSilence [50] maximumNumberOfWords [4] silenceThreshold [256]
[Sep 28 12:33:17] -- AMD: Changed state to STATE_IN_SILENCE
[Sep 28 12:33:18] -- AMD: ANSWERING MACHINE: silenceDuration:500 initialSilence:500
[Sep 28 12:33:18] -- Executing [8369@default:4] AGI("SIP/paraxip-00000007", "VD_amd.agi|8369") in new stack
[Sep 28 12:33:18] -- Launched AGI Script /var/lib/asterisk/agi-bin/VD_amd.agi
[Sep 28 12:33:18] -- Playing 'sip-silence' (escape_digits=) (sample_offset 0)
[Sep 28 12:33:18] -- Playing 'sip-silence' (escape_digits=) (sample_offset 0)
[Sep 28 12:33:18] -- Playing 'test16bit8mono2' (escape_digits=) (sample_offset 0)
[Sep 28 12:33:18] -- AGI Script agi://127.0.0.1:4577/call_log--HVcauses ... --12-----0 completed, returning 0
[Sep 28 12:33:18] == Spawn extension (default, 913108184330, 2) exited non-zero on 'Local/913108184330@default-e1ec,2'
[Sep 28 12:33:19] == Manager 'sendcron' logged off from 127.0.0.1

PostPosted: Wed Sep 28, 2011 2:43 pm
by mflorell
Why are you using 8369 for the routing extension?

You should be using 8368 if you have Sangoma CPD.

Sangoma NCA not leaving message

PostPosted: Wed Sep 28, 2011 5:16 pm
by kevinq9307
Thanks for the reply. You said nothing about patching. I assume the patch was already applied with the CE 2.1 ISO, which I installed. After setting to 8368, WaitForSilent=2000,2, AMD Send to VM=Y, and CPD AMD Action=Message, I test campaign to answer machine. It did not leave a message and instead dropped the call. Asterisk cli show the dialer sent a cancel message to Sangoma NCA before getting the 200ok.
My subsequent test with remote answered speaking into the handset worked good connecting to Agent within 1 second or so. Please advise. Thanks. Here is cli log:
<------------->
[Sep 28 14:47:08] --- (7 headers 0 lines) ---
[Sep 28 14:47:09]
<--- SIP read from 192.168.1.59:5060 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK02d83807;rport=5060
Contact: <sip:NetBorder@192.168.1.59:5060>
To: <sip:13108184330@192.168.103.253;cpd=on>;tag=58796638
From: "V9281447080000001018"<sip:8005551212@192.168.1.15>;tag=as2ccd7da2
Call-ID: 5e735584773a1e056c7df0fd3b5208c7@192.168.1.15
CSeq: 102 INVITE
Content-Length: 0


<------------->
[Sep 28 14:47:09] --- (8 headers 0 lines) ---
[Sep 28 14:47:09] -- SIP/paraxip-0000000f is ringing
[Sep 28 14:47:34] Reliably Transmitting (NAT) to 192.168.1.59:5060:
OPTIONS sip:192.168.103.253;cpd=on SIP/2.0
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK127a33aa;rport
From: "asterisk" <sip:asterisk@192.168.1.15>;tag=as459c9b57
To: <sip:192.168.103.253;cpd=on>
Contact: <sip:asterisk@192.168.1.15>
Call-ID: 44b6a8633ab65315235186e114218740@192.168.1.15
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Wed, 28 Sep 2011 21:47:34 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Length: 0


---
[Sep 28 14:47:34]
<--- SIP read from 192.168.1.59:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK127a33aa;rport=5060
Contact: <sip:192.168.1.59:5060>
To: <sip:192.168.103.253;cpd=on>;tag=764c6a6b
From: "asterisk"<sip:asterisk@192.168.1.15>;tag=as459c9b57
Call-ID: 44b6a8633ab65315235186e114218740@192.168.1.15
CSeq: 102 OPTIONS
Accept: application/sdp
Accept-Language: en
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, INFO
Content-Length: 0


<------------->
[Sep 28 14:47:34] --- (11 headers 0 lines) ---
[Sep 28 14:47:34] Scheduling destruction of SIP dialog '5e735584773a1e056c7df0fd3b5208c7@192.168.1.15' in 6400 ms (Method: INVITE)
[Sep 28 14:47:34] == Manager 'sendcron' logged off from 127.0.0.1
[Sep 28 14:47:34] Reliably Transmitting (NAT) to 192.168.1.59:5060:
CANCEL sip:13108184330@192.168.103.253;cpd=on SIP/2.0
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK02d83807;rport
From: "V9281447080000001018" <sip:8005551212@192.168.1.15>;tag=as2ccd7da2
To: <sip:13108184330@192.168.103.253;cpd=on>
Call-ID: 5e735584773a1e056c7df0fd3b5208c7@192.168.1.15
CSeq: 102 CANCEL
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: "V9281447080000001018" <sip:8005551212@192.168.1.15>;privacy=off;screen=no
Content-Length: 0


---
[Sep 28 14:47:34] Scheduling destruction of SIP dialog '5e735584773a1e056c7df0fd3b5208c7@192.168.1.15' in 6400 ms (Method: INVITE)
[Sep 28 14:47:34] == Spawn extension (default, 913108184330, 2) exited non-zero on 'Local/913108184330@default-5753,2'
[Sep 28 14:47:34] -- Executing [h@default:1] DeadAGI("Local/913108184330@default-5753,2", "agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----0-----CANCEL----------") in new stack
[Sep 28 14:47:34] Really destroying SIP dialog '44b6a8633ab65315235186e114218740@192.168.1.15' Method: OPTIONS
[Sep 28 14:47:34]
<--- SIP read from 192.168.1.59:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK02d83807;rport=5060
Contact: <sip:NetBorder@192.168.1.59:5060>
To: <sip:13108184330@192.168.103.253;cpd=on>;tag=58796638
From: "V9281447080000001018"<sip:8005551212@192.168.1.15>;tag=as2ccd7da2
Call-ID: 5e735584773a1e056c7df0fd3b5208c7@192.168.1.15
CSeq: 102 CANCEL
Content-Length: 0


<------------->
[Sep 28 14:47:34] --- (8 headers 0 lines) ---
[Sep 28 14:47:34]
<--- SIP read from 192.168.1.59:5060 --->
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK02d83807;rport=5060
To: <sip:13108184330@192.168.103.253;cpd=on>;tag=58796638
From: "V9281447080000001018"<sip:8005551212@192.168.1.15>;tag=as2ccd7da2
Call-ID: 5e735584773a1e056c7df0fd3b5208c7@192.168.1.15
CSeq: 102 INVITE
Content-Length: 0

PostPosted: Wed Sep 28, 2011 5:21 pm
by mflorell
1.4.39.1-vici already has the patch applied, you don't need to patch it.

I can't speak for Goautodial, we don't support it.

What version of Sangoma Netborder CPA are you using?

How many channels are in your CPA license?

What kind of license for CPA are you using?

What is your Vicidial campaign dial timeout set to?

PostPosted: Wed Sep 28, 2011 5:32 pm
by kevinq9307
Sangoma NCA 2.0.3
Trial license so I do not know how many channels. I do not have live call. This is still in test mode so only 1 call is tested at a time.

License should not be an issue because I am also active exchanging emails with Sangoma on this and they said it is the dialer issue.

Campaign dial timeout is 26 seconds

PostPosted: Wed Sep 28, 2011 5:43 pm
by mflorell
Change you Vicidial Campaign dial timeout to 110 seconds. When using Sangoma CPD you need to use the CPD timeout.

Sangoma NCA not leaving message

PostPosted: Wed Sep 28, 2011 7:11 pm
by kevinq9307
Thanks. Changing to 110 works very well to landline, but not good to cell phone. To cell phone, Sangoma NCA never get the 200ok from sip carrier because, I think, Sprint cell carrier play voice greeting without answer supervision. How do you fix this? Here is the log calling to cell phone.

<------------->
[Sep 28 16:58:12] --- (7 headers 0 lines) ---
[Sep 28 16:58:13]
<--- SIP read from 192.168.1.59:5060 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK55aa2e88;rport=5060
Contact: <sip:NetBorder@192.168.1.59:5060>
To: <sip:16266888171@192.168.103.253;cpd=on>;tag=79036869
From: "V9281658120000001048"<sip:8005551212@192.168.1.15>;tag=as464decc2
Call-ID: 5f8bfc7f61b6e9e31e20ae0e65ef4c5f@192.168.1.15
CSeq: 102 INVITE
Content-Length: 0

<------------->
[Sep 28 16:58:29] --- (11 headers 0 lines) ---
[Sep 28 16:58:29] Really destroying SIP dialog '1938dbf74d2bedf73611784a15cb80b1@192.168.1.15' Method: OPTIONS
[Sep 28 16:58:35]
<--- SIP read from 192.168.1.109:5060 --->



<------------->
[Sep 28 16:58:39]
<--- SIP read from 192.168.1.59:5060 --->
SIP/2.0 408 Request Timeout
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK55aa2e88;rport=5060
To: <sip:16266888171@192.168.103.253;cpd=on>;tag=79036869
From: "V9281658120000001048"<sip:8005551212@192.168.1.15>;tag=as464decc2
Call-ID: 5f8bfc7f61b6e9e31e20ae0e65ef4c5f@192.168.1.15
CSeq: 102 INVITE
Content-Length: 0
CPD-Result: No-Answer
X-Netborder-Detailed-CPD-Result-v2-0: No-Answer
X-Netborder-Call-ID: 1317254292-629761-20798-0


------------->
[Sep 28 16:58:39] --- (10 headers 0 lines) ---
[Sep 28 16:58:39] WARNING[16089]: chan_sip.c:13499 handle_response_invite: Re-invite to non-existing call leg on other UA. SIP dialog '5f8bfc7f61b6e9e31e20ae0e65ef4c5f@192.168.1.15'. Giving up.
[Sep 28 16:58:39] Transmitting (NAT) to 192.168.1.59:5060:
ACK sip:16266888171@192.168.103.253;cpd=on SIP/2.0
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK55aa2e88;rport
From: "V9281658120000001048" <sip:8005551212@192.168.1.15>;tag=as464decc2
To: <sip:16266888171@192.168.103.253;cpd=on>;tag=79036869
Contact: <sip:8005551212@192.168.1.15>
Call-ID: 5f8bfc7f61b6e9e31e20ae0e65ef4c5f@192.168.1.15
CSeq: 102 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: "V9281658120000001048" <sip:8005551212@192.168.1.15>;privacy=off;screen=no
Content-Length: 0


---
[Sep 28 16:58:39] Scheduling destruction of SIP dialog '5f8bfc7f61b6e9e31e20ae0e65ef4c5f@192.168.1.15' in 6400 ms (Method: INVITE)
[Sep 28 16:58:39] -- SIP/paraxip-0000002d is circuit-busy
[Sep 28 16:58:39] Scheduling destruction of SIP dialog '5f8bfc7f61b6e9e31e20ae0e65ef4c5f@192.168.1.15' in 6400 ms (Method: INVITE)
[Sep 28 16:58:39] == Everyone is busy/congested at this time (1:0/1/0)
[Sep 28 16:58:39] -- Executing [916266888171@default:3] Hangup("Local/916266888171@default-e9b7,2", "") in new stack
[Sep 28 16:58:39] == Spawn extension (default, 916266888171, 3) exited non-zero on 'Local/916266888171@default-e9b7,2'
[Sep 28 16:58:39] -- Executing [h@default:1] DeadAGI("Local/916266888171@default-e9b7,2", "agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----18-----CONGESTION----------") in new stack
[Sep 28 16:58:40] -- AGI Script agi://127.0.0.1:4577/call_log--HVcauses ... ---------- completed, returning 0
[Sep 28 16:58:40] == Manager 'sendcron' logged off from 127.0.0.1
[Sep 28 16:58:45] Really destroying SIP dialog '5f8bfc7f61b6e9e31e20ae0e65ef4c5f@192.168.1.15' Method: INVITE
[Sep 28 16:58:57] Reliably Transmitting (NAT) to 192.168.1.109:5060:
OPTIONS sip:4330@192.168.1.109:5060;rinstance=ef673be01fddb203;transport=UDP;cpd=on SIP/2.0
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK1a67d5eb;rport
From: "asterisk" <sip:asterisk@192.168.1.15>;tag=as74707ab8
To: <sip:4330@192.168.1.109:5060;rinstance=ef673be01fddb203;transport=UDP;cpd=on>
Contact: <sip:asterisk@192.168.1.15>
Call-ID: 3d6bfc5d0406a27264681667535df20b@192.168.1.15
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Wed, 28 Sep 2011 23:58:57 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Length: 0


---
[Sep 28 16:58:57]
<--- SIP read from 192.168.1.109:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.15:5060;branch=z9hG4bK1a67d5eb;rport=5060
Contact: <sip:192.168.1.109:5060>
To: <sip:4330@192.168.1.109:5060;rinstance=ef673be01fddb203;transport=UDP;cpd=on>;tag=8e78234a
From: "asterisk"<sip:asterisk@192.168.1.15>;tag=as74707ab8
Call-ID: 3d6bfc5d0406a27264681667535df20b@192.168.1.15
CSeq: 102 OPTIONS
Accept: application/sdp, application/sdp
Accept-Language: en
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Supported: replaces, norefersub, extended-refer, X-cisco-serviceuri
User-Agent: Zoiper rev.11137
Allow-Events: presence, kpml
Content-Length: 0


<------------->
[Sep 28 16:58:57] --- (14 headers 0 lines) ---
[Sep 28 16:58:57] Really destroying SIP dialog '3d6bfc5d0406a27264681667535df20b@192.168.1.15' Method: OPTIONS
[Sep 28 16:59:01] == Parsing '/etc/asterisk/manager.conf': [Sep 28 16:59:01] Found
[Sep 28 16:59:01] == Manager 'sendcron' logged on from 127.0.0.1
[Sep 28 16:59:01] == Manager 'sendcron' logged off from 127.0.0.1
[Sep 28 16:59:01] == Parsing '/etc/asterisk/manager.conf': [Sep 28 16:59:01] Found
[Sep 28 16:59:01] == Manager 'sendcron' logged on from 127.0.0.1
[Sep 28 16:59:04] == Manager 'sendcron' logged off from 127.0.0.1
[Sep 28 16:59:05]
<--- SIP read from 192.168.1.109:5060 --->

<------------->
[Sep 28 16:59:06] == Parsing '/etc/asterisk/manager.conf': [Sep 28 16:59:06] Found
[Sep 28 16:59:06] == Manager 'sendcron' logged on from 127.0.0.1
[Sep 28 16:59:06] == Manager 'sendcron' logged off from 127.0.0.1

PostPosted: Wed Sep 28, 2011 8:14 pm
by mflorell
We do quite a bit of CPA testing with Sprint cellphones, never had that issue with them. Have you tried another carrier?

PostPosted: Thu Sep 29, 2011 1:32 pm
by kevinq9307
Found out that Sangoma NCA was sending sip408 because the preconnect-timeout of outboundproxy.properties setting in NCA was 26sec timeout. Change it to 60sec fix the problem. I also change endofgreeting=true so messages do not get cutoff. This is working out great. Thank you very much for your help.

Re: Patching chan_sip.c with CPD patch fails

PostPosted: Wed Jan 02, 2013 12:15 pm
by omarrodriguezt
Thank you for share your experiences