<div dir="ltr"><div>Hi,</div><div><br></div><div>Following some new behaviour on PJSIP, adding SIP header must be done using a subrouting.</div><div>Please find below my working configuration:</div><div><br></div><div><i>[subroutine]<br>exten => caller_handler,1,NoOp()<br>same =>n,Set(PJSIP_HEADER(add,X-CID)=${ARG1})<br>same => n,Return()</i></div><div><br></div><div>and then, add new parameters on Dial command: <i>same =>n,Dial(PJSIP/${EXTEN}@<peer>,,b(subroutine^caller_handler^1(${SIPCALLID})))</i><br></div><div><br></div><div>The first "<b>b</b>" before parenthesis gave direction (if header must be added to caller or callee). More information on <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Function_PJSIP_HEADER">https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Function_PJSIP_HEADER</a>.<br></div><div><br></div><div>Regards.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-02 17:06 GMT+02:00 Andre Gronwald <span dir="ltr"><<a href="mailto:andregronwald78@gmail.com" target="_blank">andregronwald78@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Hi,
<br>
I am trying to add a custom header to my calls to map several
call-legs into a global call for viewing.
<br>
<br>
For this to work I read the call-id from pjsip-channel and write
it into X-CID:
<br>
<br>
######
<br>
-- Executing [s@macro-dialout-trunk-<wbr>predial-hook:4]
Set("PJSIP/10-00000006",
"pjsipCallId=<wbr>313530363933383438363436353930<wbr>-1gh0bjceo933") in new
stack
<br>
-- Executing [s@macro-dialout-trunk-<wbr>predial-hook:5]
Set("PJSIP/10-00000006",
"PJSIP_HEADER(add,X-CID)=<wbr>313530363933383438363436353930<wbr>-1gh0bjceo933")
in new stack
<br>
-- Executing [s@macro-dialout-trunk:18]
GotoIf("PJSIP/10-00000006", "0?bypass,1") in new stack
<br>
-- Executing [s@macro-dialout-trunk:19]
ExecIf("PJSIP/10-00000006",
"1?Set(CONNECTEDLINE(num,i)=<wbr>0xxxxxxxxxxxxxx)") in new stack
<br>
-- Executing [s@macro-dialout-trunk:20]
ExecIf("PJSIP/10-00000006", "1?Set(CONNECTEDLINE(name,i)=<a class="m_7289965258724339029moz-txt-link-freetext">C<wbr>ID:3xxxxx</a>)")
in new stack
<br>
-- Executing [s@macro-dialout-trunk:21]
ExecIf("PJSIP/10-00000006", "0?Set(CONNECTEDLINE(name,i)=<a class="m_7289965258724339029moz-txt-link-freetext">C<wbr>ID:(Hidden)3xxxxx)</a>")
in new stack
<br>
-- Executing [s@macro-dialout-trunk:22]
GotoIf("PJSIP/10-00000006", "0?customtrunk") in new stack
<br>
-- Executing [s@macro-dialout-trunk:23]
Dial("PJSIP/10-00000006", "PJSIP/0xxxxxxxxxxxxxx@3xxxxx,<wbr>300,T") in
new stack
<br>
-- Called PJSIP/0xxxxxxxxxxxxxx@3xxxxx
<br>
<--- Transmitting SIP request (991 bytes) to
UDP:<a href="http://217.23.24.100:5060" target="_blank">217.23.24.100:5060</a> --->
<br>
INVITE <a class="m_7289965258724339029moz-txt-link-abbreviated" href="mailto:sip:0xxxxxxxxxxxxxx@sip.provid.er:5060" target="_blank">sip:0xxxxxxxxxxxxxx@sip.<wbr>provid.er:5060</a>
SIP/2.0
<br>
Via: SIP/2.0/UDP
192.168.253.185:15070;rport;<wbr>branch=z9hG4bKPj453d15e0-de58-<wbr>4945-8b95-d05b16b9e4c3<br>
From: <a class="m_7289965258724339029moz-txt-link-rfc2396E" href="mailto:sip:+49xxxxxxxxxxx@sip.provid.er" target="_blank"><sip:+49xxxxxxxxxxx@sip.<wbr>provid.er></a>;tag=080788ac-7c10-<wbr>4cf3-86b3-359764ffb5a2
<br>
To: <a class="m_7289965258724339029moz-txt-link-rfc2396E" href="mailto:sip:0xxxxxxxxxxxxxx@sip.provid.er" target="_blank"><sip:0xxxxxxxxxxxxxx@sip.<wbr>provid.er></a>
<br>
Contact: <a class="m_7289965258724339029moz-txt-link-rfc2396E" href="mailto:sip:+49xxxxxxxxx@192.168.253.185:15070" target="_blank"><sip:+49xxxxxxxxx@192.168.253.<wbr>185:15070></a>
<br>
Call-ID: de41b93b-51d8-44b5-9c34-<wbr>f2c0928192b0
<br>
CSeq: 1519 INVITE
<br>
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE,
CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
<br>
Supported: 100rel, timer, replaces, norefersub
<br>
Session-Expires: 1800
<br>
Min-SE: 90
<br>
Max-Forwards: 70
<br>
User-Agent: FPBX-14.0.1.10(14.6.2)
<br>
Content-Type: application/sdp
<br>
Content-Length: 308
<br>
<br>
v=0
<br>
o=- 1719768133 1719768133 IN IP4 192.168.253.185
<br>
s=Asterisk
<br>
c=IN IP4 192.168.253.185
<br>
t=0 0
<br>
m=audio 55112 RTP/AVP 107 9 8 3 101
<br>
a=rtpmap:107 opus/48000/2
<br>
a=rtpmap:9 G722/8000
<br>
a=rtpmap:8 PCMA/8000
<br>
a=rtpmap:3 GSM/8000
<br>
a=rtpmap:101 telephone-event/8000
<br>
a=fmtp:101 0-16
<br>
a=ptime:20
<br>
a=maxptime:20
<br>
a=sendrecv
<br>
<br>
<--- Received SIP response (559 bytes) from
UDP:<a href="http://217.23.24.100:5060" target="_blank">217.23.24.100:5060</a> --->
<br>
[...]
<br>
<br>
######
<br>
<br>
<br>
<br>
<br>
But I can't see that header anywhere in my call-legs. What am I
missing?
<br>
<br>
<br>
kind regards,
<br>
andre</p>
</div>
<br>--<br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.<wbr>org/</a><br>
<br>
New to Asterisk? Start here:<br>
<a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/<wbr>wiki/display/AST/Getting+<wbr>Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-<wbr>users</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><p><font size="2"><span style="color:rgb(68,68,68)"><span style="font-family:tahoma,sans-serif"><b>Loïc CHABERT - Responsable technique</b></span></span><span style="font-family:tahoma,sans-serif;color:rgb(68,68,68)"><b><br></b></span><b style="color:rgb(68,68,68);font-family:tahoma,sans-serif">Voxity - Libérez vos Télécoms<br></b></font></p><p><span style="color:rgb(68,68,68);font-size:small;font-family:tahoma,sans-serif">85 Rue des Alliés 38100 Grenoble<br></span><span style="color:rgb(68,68,68);font-family:tahoma,sans-serif;font-size:small">Tel : </span><span style="color:rgb(68,68,68);font-family:tahoma,sans-serif;font-size:small">0975181257 - Fax : 04.816.801.14<br></span><span style="color:rgb(68,68,68);font-family:tahoma,sans-serif;font-size:small">Email : <a href="mailto:jp.ramoul@voxity.fr" target="_blank">loic.chabert@voxity.fr</a><br></span></p><span style="font-family:tahoma,sans-serif"><font size="2"><font color="#818181">Restons connectés : </font><font color="#9fc5e8"><a href="http://www.voxity.fr" target="_blank">Site Web</a> - <a href="http://twitter.com/voxity" target="_blank">Twitter</a> - <a href="http://www.facebook.com/voxity" target="_blank">Facebook</a> </font></font></span><font color="#9fc5e8"><span style="font-family:tahoma,sans-serif;font-size:small">- </span><a href="https://www.linkedin.com/profile/view?id=25351096" target="_blank"><font size="2" face="tahoma, sans-serif">L</font>inkedIn</a><span style="color:rgb(153,153,153)"><span style="color:rgb(204,204,204)"><span><span style="font-family:tahoma,sans-serif"><font size="2"><font color="#818181"><br><b>Nouveau !</b> Découvrez Voxity en vidéo : <a href="https://www.youtube.com/watch?v=nUVL5fTNmVU" target="_blank">Youtube</a></font></font></span></span></span></span></font></div></div></div></div>
</div>